From 40124cd0cf474dd17959b5ae36c8a98112c173c0 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Thu, 2 Nov 2017 21:51:35 +0000 Subject: [PATCH] Add wrapper for idris exe for gcc/gmp runtime deps Fixes #10450 When compiling packages with -o the executable invokes gcc. There is no compile time flag to control this invocation so for now we create a wrapper which provides the dependency at runtime. --- pkgs/development/idris-modules/default.nix | 9 +++++++-- pkgs/development/idris-modules/idris-wrapper.nix | 14 ++++++++++++++ pkgs/top-level/all-packages.nix | 5 ++++- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/idris-modules/idris-wrapper.nix diff --git a/pkgs/development/idris-modules/default.nix b/pkgs/development/idris-modules/default.nix index 4d7c4928283a..16f6c65b094a 100644 --- a/pkgs/development/idris-modules/default.nix +++ b/pkgs/development/idris-modules/default.nix @@ -1,4 +1,4 @@ -{ pkgs, idris, overrides ? (self: super: {}) }: let +{ pkgs, idris-no-deps, overrides ? (self: super: {}) }: let inherit (pkgs.lib) callPackageWith fix' extends; /* Taken from haskell-modules/default.nix, should probably abstract this away */ @@ -33,7 +33,12 @@ value = callPackage (./. + "/${name}.nix") {}; }) files)) // { - inherit idris callPackage; + inherit idris-no-deps callPackage; + # See #10450 about why we have to wrap the executable + idris = + (pkgs.callPackage ./idris-wrapper.nix {}) + idris-no-deps + { path = [ pkgs.gcc ]; lib = [pkgs.gmp]; }; # A list of all of the libraries that come with idris builtins = pkgs.lib.mapAttrsToList (name: value: value) builtins_; diff --git a/pkgs/development/idris-modules/idris-wrapper.nix b/pkgs/development/idris-modules/idris-wrapper.nix new file mode 100644 index 000000000000..32424ba1f862 --- /dev/null +++ b/pkgs/development/idris-modules/idris-wrapper.nix @@ -0,0 +1,14 @@ +{ symlinkJoin, makeWrapper, stdenv }: idris: { path, lib }: + +symlinkJoin { + name = idris.name; + src = idris.src; + paths = [ idris ]; + buildInputs = [ makeWrapper ]; + postBuild = '' + wrapProgram $out/bin/idris \ + --suffix PATH : ${ stdenv.lib.makeBinPath path } \ + --suffix LIBRARY_PATH : ${stdenv.lib.makeLibraryPath lib} + ''; + } + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a76c4eac651f..294a79b101ef 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5876,7 +5876,8 @@ with pkgs; icedtea_web = icedtea8_web; idrisPackages = callPackage ../development/idris-modules { - idris = + + idris-no-deps = let inherit (self.haskell) lib; haskellPackages = self.haskellPackages.override { @@ -5893,6 +5894,8 @@ with pkgs; haskellPackages.idris; }; + idris = idrisPackages.with-packages [ idrisPackages.base ] ; + intercal = callPackage ../development/compilers/intercal { }; irony-server = callPackage ../development/tools/irony-server/default.nix {