haskellPackages.gtk: refactor configuration-nix

- using lib.pipe
This commit is contained in:
Miao, ZhiCheng 2023-04-23 19:14:53 +03:00
parent ec4d9834ce
commit 77fb04d83e
No known key found for this signature in database
GPG Key ID: 1080B4863AD0F5D1

View File

@ -263,11 +263,14 @@ self: super: builtins.intersectAttrs super {
gio = disableHardening ["fortify"] (addPkgconfigDepend pkgs.glib (addBuildTool self.buildHaskellPackages.gtk2hs-buildtools super.gio));
glib = disableHardening ["fortify"] (addPkgconfigDepend pkgs.glib (addBuildTool self.buildHaskellPackages.gtk2hs-buildtools super.glib));
gtk3 = disableHardening ["fortify"] (super.gtk3.override { inherit (pkgs) gtk3; });
gtk = let gtk1 = addBuildTool self.buildHaskellPackages.gtk2hs-buildtools super.gtk;
gtk2 = addPkgconfigDepend pkgs.gtk2 gtk1;
gtk3 = disableHardening ["fortify"] gtk1;
gtk4 = if pkgs.stdenv.isDarwin then appendConfigureFlag "-fhave-quartz-gtk" gtk3 else gtk4;
in gtk3;
gtk = lib.pipe super.gtk (
[ (disableHardening ["fortify"])
(addBuildTool self.buildHaskellPackages.gtk2hs-buildtools)
(addPkgconfigDepends (with pkgs; [ gtk2 pcre2 util-linux libselinux libsepol pcre fribidi
libthai libdatrie xorg.libXdmcp libdeflate ]))
] ++
( if pkgs.stdenv.isDarwin then [(appendConfigureFlag "-fhave-quartz-gtk")] else [] )
);
gtksourceview2 = addPkgconfigDepend pkgs.gtk2 super.gtksourceview2;
gtk-traymanager = addPkgconfigDepend pkgs.gtk3 super.gtk-traymanager;