diff options
author | Patrick Mahoney <pat@polycrystal.org> | 2021-06-12 09:05:08 -0500 |
---|---|---|
committer | Patrick Mahoney <pat@polycrystal.org> | 2021-06-12 09:05:08 -0500 |
commit | ceed1e28400a73e1bb2e18cc20ff1683056e6ab5 (patch) | |
tree | ce4b48560c769e05c6c4969632e60189e0ebc89a /pkgs/applications/audio | |
parent | 1fe827462c840649f77cf1e2d722c60a640d7787 (diff) | |
download | nixpkgs-ceed1e28400a73e1bb2e18cc20ff1683056e6ab5.tar nixpkgs-ceed1e28400a73e1bb2e18cc20ff1683056e6ab5.tar.gz nixpkgs-ceed1e28400a73e1bb2e18cc20ff1683056e6ab5.tar.bz2 nixpkgs-ceed1e28400a73e1bb2e18cc20ff1683056e6ab5.tar.lz nixpkgs-ceed1e28400a73e1bb2e18cc20ff1683056e6ab5.tar.xz nixpkgs-ceed1e28400a73e1bb2e18cc20ff1683056e6ab5.tar.zst nixpkgs-ceed1e28400a73e1bb2e18cc20ff1683056e6ab5.zip |
faust: fix compiler flags when used outside nix shell
Fixes https://github.com/NixOS/nixpkgs/issues/78610 The issue is some additional environment variables added to the nix compiler wrappers that also need to be exported by the faust wrapper. This "wrapWithBuildEnv" solution is very hacky, but I don't know of a better solution.
Diffstat (limited to 'pkgs/applications/audio')
-rw-r--r-- | pkgs/applications/audio/faust/faust2.nix | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/applications/audio/faust/faust2.nix b/pkgs/applications/audio/faust/faust2.nix index 995618af4ce..c1d351fa53e 100644 --- a/pkgs/applications/audio/faust/faust2.nix +++ b/pkgs/applications/audio/faust/faust2.nix @@ -178,6 +178,12 @@ let # export parts of the build environment for script in "$out"/bin/*; do + # e.g. NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu + nix_cc_wrapper_target_host="$(printenv | grep ^NIX_CC_WRAPPER_TARGET_HOST | sed 's/=.*//')" + + # e.g. NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu + nix_bintools_wrapper_target_host="$(printenv | grep ^NIX_BINTOOLS_WRAPPER_TARGET_HOST | sed 's/=.*//')" + wrapProgram "$script" \ --set FAUSTLDDIR "${faust}/lib" \ --set FAUSTLIB "${faust}/share/faust" \ @@ -187,7 +193,9 @@ let --prefix PKG_CONFIG_PATH : "$PKG_CONFIG_PATH" \ --set NIX_CFLAGS_COMPILE "$NIX_CFLAGS_COMPILE" \ --set NIX_LDFLAGS "$NIX_LDFLAGS -lpthread" \ - --prefix LIBRARY_PATH $libPath + --set "$nix_cc_wrapper_target_host" "''${!nix_cc_wrapper_target_host}" \ + --set "$nix_bintools_wrapper_target_host" "''${!nix_bintools_wrapper_target_host}" \ + --prefix LIBRARY_PATH "$libPath" done ''; }); |