about summary refs log tree commit diff
path: root/pkgs/development/libraries/bootil
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-11-26 18:02:16 -0600
committerMatthew Bauer <mjbauer95@gmail.com>2018-11-28 20:14:29 -0600
commita06eb847058584480487e840a1c9b78cb7828e84 (patch)
treed9341dc513f47a1b00b825c1b92cffca4ae09a2d /pkgs/development/libraries/bootil
parentfd78464de91d5d64dda217397586996e0b7ff37f (diff)
downloadnixlib-a06eb847058584480487e840a1c9b78cb7828e84.tar
nixlib-a06eb847058584480487e840a1c9b78cb7828e84.tar.gz
nixlib-a06eb847058584480487e840a1c9b78cb7828e84.tar.bz2
nixlib-a06eb847058584480487e840a1c9b78cb7828e84.tar.lz
nixlib-a06eb847058584480487e840a1c9b78cb7828e84.tar.xz
nixlib-a06eb847058584480487e840a1c9b78cb7828e84.tar.zst
nixlib-a06eb847058584480487e840a1c9b78cb7828e84.zip
bootil: cleanup installation
A few changes needed here:

- We don’t want to guess what our platform is. We can patch location
  and targetdir to not put things in an unpredictable directory.
- Make premake4 a native build input.
- Set the premakefile variable.
Diffstat (limited to 'pkgs/development/libraries/bootil')
-rw-r--r--pkgs/development/libraries/bootil/default.nix26
1 files changed, 13 insertions, 13 deletions
diff --git a/pkgs/development/libraries/bootil/default.nix b/pkgs/development/libraries/bootil/default.nix
index b64cdd5245fd..0ed223832b6c 100644
--- a/pkgs/development/libraries/bootil/default.nix
+++ b/pkgs/development/libraries/bootil/default.nix
@@ -23,21 +23,21 @@ stdenv.mkDerivation rec {
     url = https://github.com/garrynewman/bootil/pull/22.patch;
     name = "github-pull-request-22.patch";
     sha256 = "1qf8wkv00pb9w1aa0dl89c8gm4rmzkxfl7hidj4gz0wpy7a24qa2";
-  })];
-
-  platform =
-    if stdenv.isLinux then "linux"
-    else if stdenv.isDarwin then "macosx"
-    else throw "unrecognized system ${stdenv.hostPlatform.system}";
-
-  buildInputs = [ premake4 ];
+  }) ];
+
+  # Avoid guessing where files end up. Just use current directory.
+  postPatch = ''
+    substituteInPlace projects/premake4.lua \
+      --replace 'location ( os.get() .. "/" .. _ACTION )' 'location ( ".." )'
+    substituteInPlace projects/bootil.lua \
+      --replace 'targetdir ( "../lib/" .. os.get() .. "/" .. _ACTION )' 'targetdir ( ".." )'
+  '';
 
-  configurePhase = "premake4 --file=projects/premake4.lua gmake";
-  makeFlags = "-C projects/${platform}/gmake";
+  nativeBuildInputs = [ premake4 ];
+  premakefile = "projects/premake4.lua";
 
   installPhase = ''
-    mkdir -p $out/lib
-    cp lib/${platform}/gmake/libbootil_static.a $out/lib/
-    cp -r include $out/
+    install -D libbootil_static.a $out/lib/libbootil_static.a
+    cp -r include $out
   '';
 }