nixpkgs/pkgs/desktops/xfce/mkXfceDerivation.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
1.6 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitLab, pkg-config, xfce4-dev-tools, hicolor-icon-theme, xfce, wrapGAppsHook3, gitUpdater }:
{ category
, pname
, version
, attrPath ? "xfce.${pname}"
, rev-prefix ? "${pname}-"
, rev ? "${rev-prefix}${version}"
, sha256
, odd-unstable ? true
, patchlevel-unstable ? true
, passthru ? { }
, meta ? { }
, ...
} @ args:
2017-12-17 15:02:52 +00:00
let
inherit (builtins) filter getAttr head isList;
2021-01-15 13:21:58 +00:00
inherit (lib) attrNames concatLists recursiveUpdate zipAttrsWithNames;
2017-12-17 15:02:52 +00:00
filterAttrNames = f: attrs:
filter (n: f (getAttr n attrs)) (attrNames attrs);
concatAttrLists = attrsets:
zipAttrsWithNames (filterAttrNames isList (head attrsets)) (_: concatLists) attrsets;
template = {
nativeBuildInputs = [ pkg-config xfce4-dev-tools wrapGAppsHook3 ];
buildInputs = [ hicolor-icon-theme ];
2017-12-17 15:02:52 +00:00
configureFlags = [ "--enable-maintainer-mode" ];
src = fetchFromGitLab {
domain = "gitlab.xfce.org";
owner = category;
repo = pname;
inherit rev sha256;
2017-12-17 15:02:52 +00:00
};
enableParallelBuilding = true;
outputs = [ "out" "dev" ];
pos = builtins.unsafeGetAttrPos "pname" args;
passthru = {
updateScript = gitUpdater {
inherit rev-prefix odd-unstable patchlevel-unstable;
};
} // passthru;
meta = with lib; {
homepage = "https://gitlab.xfce.org/${category}/${pname}";
2021-03-02 12:07:57 +00:00
license = licenses.gpl2Plus; # some libraries are under LGPLv2+
2017-12-17 15:02:52 +00:00
platforms = platforms.linux;
} // meta;
2017-12-17 15:02:52 +00:00
};
publicArgs = removeAttrs args [ "category" "sha256" ];
2017-12-17 15:02:52 +00:00
in
stdenv.mkDerivation (publicArgs // template // concatAttrLists [ template args ])