2022-02-21 02:11:49 +01:00
|
|
|
{ lib, stdenv, fetchFromGitLab, pkg-config, xfce4-dev-tools, hicolor-icon-theme, xfce, wrapGAppsHook, gitUpdater }:
|
2020-04-13 23:12:16 +02:00
|
|
|
|
|
|
|
{ category
|
|
|
|
, pname
|
|
|
|
, version
|
|
|
|
, attrPath ? "xfce.${pname}"
|
|
|
|
, rev-prefix ? "${pname}-"
|
|
|
|
, rev ? "${rev-prefix}${version}"
|
|
|
|
, sha256
|
|
|
|
, odd-unstable ? true
|
|
|
|
, patchlevel-unstable ? true
|
|
|
|
, ...
|
|
|
|
} @ args:
|
2017-12-17 16:02:52 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
inherit (builtins) filter getAttr head isList;
|
2021-01-15 14:21:58 +01:00
|
|
|
inherit (lib) attrNames concatLists recursiveUpdate zipAttrsWithNames;
|
2017-12-17 16:02:52 +01:00
|
|
|
|
|
|
|
filterAttrNames = f: attrs:
|
|
|
|
filter (n: f (getAttr n attrs)) (attrNames attrs);
|
|
|
|
|
|
|
|
concatAttrLists = attrsets:
|
|
|
|
zipAttrsWithNames (filterAttrNames isList (head attrsets)) (_: concatLists) attrsets;
|
|
|
|
|
2020-04-13 23:12:16 +02:00
|
|
|
template = rec {
|
2020-12-27 21:28:16 +01:00
|
|
|
inherit pname version;
|
2017-12-17 16:02:52 +01:00
|
|
|
|
2021-01-17 03:21:50 +01:00
|
|
|
nativeBuildInputs = [ pkg-config xfce4-dev-tools wrapGAppsHook ];
|
2018-07-21 23:07:49 +02:00
|
|
|
buildInputs = [ hicolor-icon-theme ];
|
2017-12-17 16:02:52 +01:00
|
|
|
configureFlags = [ "--enable-maintainer-mode" ];
|
|
|
|
|
2020-12-27 14:34:29 +01:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.xfce.org";
|
|
|
|
owner = category;
|
|
|
|
repo = pname;
|
2018-07-21 23:00:53 +02:00
|
|
|
inherit rev sha256;
|
2017-12-17 16:02:52 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2020-04-05 03:53:24 +02:00
|
|
|
pos = builtins.unsafeGetAttrPos "pname" args;
|
|
|
|
|
2022-02-21 02:11:49 +01:00
|
|
|
passthru.updateScript = gitUpdater {
|
2020-04-13 23:12:16 +02:00
|
|
|
inherit pname version attrPath rev-prefix odd-unstable patchlevel-unstable;
|
|
|
|
};
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2021-06-13 23:00:58 +02:00
|
|
|
homepage = "https://gitlab.xfce.org/${category}/${pname}";
|
2021-03-02 13:07:57 +01:00
|
|
|
license = licenses.gpl2Plus; # some libraries are under LGPLv2+
|
2017-12-17 16:02:52 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
publicArgs = removeAttrs args [ "category" "pname" "sha256" ];
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation (recursiveUpdate template publicArgs // concatAttrLists [ template args ])
|
2021-06-17 01:49:10 +02:00
|
|
|
# TODO [ AndersonTorres ]: verify if it allows using hash attribute as an option to sha256
|