on iko/ghcjs-patch-master help sign in
Fix libnuma dependency in rts.conf (#1342)
18ebf60Cheng Shao
builder/comp-builder.nix+1−1
@@ -1,4 +1,4 @@
1−{ pkgs, stdenv, buildPackages, ghc, lib, gobject-introspection ? null, haskellLib, makeConfigFiles, haddockBuilder, ghcForComponent, hsPkgs, compiler, runCommand, libffi, gmp, zlib, ncurses, numactl, nodejs }@defaults:
1+{ pkgs, stdenv, buildPackages, ghc, lib, gobject-introspection ? null, haskellLib, makeConfigFiles, haddockBuilder, ghcForComponent, hsPkgs, compiler, runCommand, libffi, gmp, zlib, ncurses, nodejs }@defaults:
2lib.makeOverridable (
2lib.makeOverridable (
3let self =
3let self =
4{ componentId
4{ componentId
compiler/ghc/default.nix+14−1
@@ -90,6 +90,8 @@ let
90
90
91 targetIconv = targetPackages.libiconv or libiconv;
91 targetIconv = targetPackages.libiconv or libiconv;
92
92
93+ targetNumactl = targetPackages.numactl or numactl;
94+
93 # TODO(@Ericson2314) Make unconditional
95 # TODO(@Ericson2314) Make unconditional
94 targetPrefix = lib.optionalString
96 targetPrefix = lib.optionalString
95 (targetPlatform != hostPlatform)
97 (targetPlatform != hostPlatform)
@@ -259,7 +261,18 @@ stdenv.mkDerivation (rec {
259 ++ lib.optional stdenv.targetPlatform.isAarch32 "pic"
261 ++ lib.optional stdenv.targetPlatform.isAarch32 "pic"
260 ++ lib.optional stdenv.targetPlatform.isMusl "pie";
262 ++ lib.optional stdenv.targetPlatform.isMusl "pie";
261
263
262− postInstall = ''
264+ postInstall = lib.optionalString (enableNUMA && targetPlatform.isLinux) ''
265+ # Patch rts.conf to ensure libnuma can be found
266+
267+ for file in $(find "$out/lib" -name "rts*.conf"); do
268+ if grep -q numa $file; then
269+ substituteInPlace $file \
270+ --replace "library-dirs:" "library-dirs: ${targetNumactl}/lib" \
271+ --replace "include-dirs:" "include-dirs: ${targetNumactl}/include"
272+ "$out/bin/${targetPrefix}ghc-pkg" recache
273+ fi
274+ done
275+ '' + ''
263 # Install the bash completion file.
276 # Install the bash completion file.
264 install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
277 install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
265
278
test/with-packages/default.nix+2−2
@@ -1,4 +1,4 @@
1−{ stdenv, lib, numactl, util, mkPkgSet, recurseIntoAttrs, testSrc, compiler-nix-name }:
1+{ stdenv, lib, util, mkPkgSet, recurseIntoAttrs, testSrc, compiler-nix-name }:
2
2
3with lib;
3with lib;
4with util;
4with util;
@@ -33,7 +33,7 @@ let
33
33
34 pkgId = p: "${p.identifier.name}-${p.identifier.version}";
34 pkgId = p: "${p.identifier.name}-${p.identifier.version}";
35 showDepends = component: concatMapStringsSep " " pkgId (component.depends or []);
35 showDepends = component: concatMapStringsSep " " pkgId (component.depends or []);
36− extraFlags = if stdenv.isLinux then "-L${numactl}/lib" else "";
36+ extraFlags = "";
37
37
38in recurseIntoAttrs {
38in recurseIntoAttrs {
39 meta.disabled = compiler-nix-name != "ghc865";
39 meta.disabled = compiler-nix-name != "ghc865";