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