mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-19 17:39:34 +00:00
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.
This commit is contained in:
parent
fd78464de9
commit
a06eb84705
|
@ -23,21 +23,21 @@ stdenv.mkDerivation rec {
|
||||||
url = https://github.com/garrynewman/bootil/pull/22.patch;
|
url = https://github.com/garrynewman/bootil/pull/22.patch;
|
||||||
name = "github-pull-request-22.patch";
|
name = "github-pull-request-22.patch";
|
||||||
sha256 = "1qf8wkv00pb9w1aa0dl89c8gm4rmzkxfl7hidj4gz0wpy7a24qa2";
|
sha256 = "1qf8wkv00pb9w1aa0dl89c8gm4rmzkxfl7hidj4gz0wpy7a24qa2";
|
||||||
})];
|
}) ];
|
||||||
|
|
||||||
platform =
|
# Avoid guessing where files end up. Just use current directory.
|
||||||
if stdenv.isLinux then "linux"
|
postPatch = ''
|
||||||
else if stdenv.isDarwin then "macosx"
|
substituteInPlace projects/premake4.lua \
|
||||||
else throw "unrecognized system ${stdenv.hostPlatform.system}";
|
--replace 'location ( os.get() .. "/" .. _ACTION )' 'location ( ".." )'
|
||||||
|
substituteInPlace projects/bootil.lua \
|
||||||
|
--replace 'targetdir ( "../lib/" .. os.get() .. "/" .. _ACTION )' 'targetdir ( ".." )'
|
||||||
|
'';
|
||||||
|
|
||||||
buildInputs = [ premake4 ];
|
nativeBuildInputs = [ premake4 ];
|
||||||
|
premakefile = "projects/premake4.lua";
|
||||||
configurePhase = "premake4 --file=projects/premake4.lua gmake";
|
|
||||||
makeFlags = "-C projects/${platform}/gmake";
|
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/lib
|
install -D libbootil_static.a $out/lib/libbootil_static.a
|
||||||
cp lib/${platform}/gmake/libbootil_static.a $out/lib/
|
cp -r include $out
|
||||||
cp -r include $out/
|
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue