on iko/ghcjs-patch-master help sign in
Fix propagation of pkgconfig and frameworks (#715)
9c6eb16Hamish Mackenzie
builder/comp-builder.nix+7−5
@@ -215,12 +215,14 @@ stdenv.mkDerivation ({
215
215
216 enableParallelBuilding = true;
216 enableParallelBuilding = true;
217
217
218+ propagatedBuildInputs =
219+ frameworks # Frameworks will be needed at link time
220+ # Not sure why pkgconfig needs to be propagatedBuildInputs but
221+ # for gi-gtk-hs it seems to help.
222+ ++ builtins.concatLists pkgconfig;
223+
218 buildInputs = component.libs
224 buildInputs = component.libs
219− ++ frameworks
225+ ++ map (d: d.components.library or d) component.depends;
220− ++ builtins.concatLists pkgconfig
221− # Note: This is a hack until we can fix properly. See:
222− # https://github.com/haskell-gi/haskell-gi/issues/226
223− ++ lib.optional (lib.strings.hasPrefix "gi-" fullName) gobject-introspection;
224
226
225 nativeBuildInputs =
227 nativeBuildInputs =
226 [shellWrappers buildPackages.removeReferencesTo]
228 [shellWrappers buildPackages.removeReferencesTo]
builder/hspkg-builder.nix+1
@@ -84,6 +84,7 @@ let
84 component = components.setup // {
84 component = components.setup // {
85 depends = config.setup-depends ++ components.setup.depends ++ package.setup-depends;
85 depends = config.setup-depends ++ components.setup.depends ++ package.setup-depends;
86 extraSrcFiles = components.setup.extraSrcFiles ++ [ "Setup.hs" "Setup.lhs" ];
86 extraSrcFiles = components.setup.extraSrcFiles ++ [ "Setup.hs" "Setup.lhs" ];
87+ pkgconfig = if components ? library then components.library.pkgconfig or [] else [];
87 };
88 };
88 inherit package name src flags revision patches defaultSetupSrc;
89 inherit package name src flags revision patches defaultSetupSrc;
89 inherit (pkg) preUnpack postUnpack;
90 inherit (pkg) preUnpack postUnpack;
builder/shell-for.nix+7−1
@@ -28,6 +28,12 @@ let
28 # because cabal will end up ignoring that built version;
28 # because cabal will end up ignoring that built version;
29 removeSelected = lib.filter
29 removeSelected = lib.filter
30 (input: lib.all (cfg: (input.identifier or null) != cfg.identifier) selected);
30 (input: lib.all (cfg: (input.identifier or null) != cfg.identifier) selected);
31+ # Also since a will include the library component of b in its buildInputs
32+ # (to make `propagatedBuildInputs` of `pkgconfig-depends` work) those should
33+ # also be excluded (the pkgconfig depends of b will still be included in the
34+ # system shells buildInputs via b's own buildInputs).
35+ removeSelectedInputs = lib.filter
36+ (input: lib.all (cfg: input != cfg.components.library or null) selected);
31
37
32 packageInputs = removeSelected
38 packageInputs = removeSelected
33 (lib.concatMap (cfg: cfg.depends) selectedConfigs
39 (lib.concatMap (cfg: cfg.depends) selectedConfigs
@@ -37,7 +43,7 @@ let
37
43
38 # Add the system libraries and build tools of the selected haskell
44 # Add the system libraries and build tools of the selected haskell
39 # packages to the shell.
45 # packages to the shell.
40− systemInputs = lib.concatMap (p: p.components.all.buildInputs) selected;
46+ systemInputs = removeSelectedInputs (lib.concatMap (p: p.components.all.buildInputs) selected);
41 nativeBuildInputs = removeSelected
47 nativeBuildInputs = removeSelected
42 (lib.concatMap (p: p.components.all.executableToolDepends) selected);
48 (lib.concatMap (p: p.components.all.executableToolDepends) selected);
43
49
package-set.nix+1−1
@@ -13,7 +13,7 @@ in pkgs.lib.evalModules {
13 # as well as pkgconfPkgs, which are used to resolve pkgconfig name to nixpkgs names. We simply
13 # as well as pkgconfPkgs, which are used to resolve pkgconfig name to nixpkgs names. We simply
14 # augment the existing pkgs set with the specific mappings:
14 # augment the existing pkgs set with the specific mappings:
15 pkgs = pkgs // (import ./lib/system-nixpkgs-map.nix pkgs);
15 pkgs = pkgs // (import ./lib/system-nixpkgs-map.nix pkgs);
16− pkgconfPkgs = pkgs // (import ./lib/pkgconf-nixpkgs-map.nix pkgs);
16+ pkgconfPkgs = import ./lib/pkgconf-nixpkgs-map.nix pkgs;
17
17
18 inherit buildModules;
18 inherit buildModules;
19 };
19 };