1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 premake4,
6 zlib,
7}:
8
9stdenv.mkDerivation {
10 pname = "bootil";
11 version = "unstable-2019-11-18";
12
13 src = fetchFromGitHub {
14 owner = "garrynewman";
15 repo = "bootil";
16 rev = "beb4cec8ad29533965491b767b177dc549e62d23";
17 sha256 = "1njdj6nvmwf7j2fwqbyvd1cf5l52797vk2wnsliylqdzqcjmfpij";
18 };
19
20 enableParallelBuilding = true;
21
22 # Avoid guessing where files end up. Just use current directory.
23 postPatch = ''
24 substituteInPlace projects/premake4.lua \
25 --replace-fail 'location ( os.get() .. "/" .. _ACTION )' 'location ( ".." )'
26 substituteInPlace projects/bootil.lua \
27 --replace-fail 'targetdir ( "../lib/" .. os.get() .. "/" .. _ACTION )' 'targetdir ( ".." )'
28
29 rm src/3rdParty/zlib -rf
30 mkdir src/3rdParty/zlib
31 cp -r ${zlib.dev}/include/z{conf,lib}.h src/3rdParty/zlib
32 '';
33
34 nativeBuildInputs = [ premake4 ];
35
36 premakefile = "projects/premake4.lua";
37
38 installPhase = ''
39 install -D libbootil_static.a $out/lib/libbootil_static.a
40 cp -r include $out
41 '';
42
43 meta = with lib; {
44 description = "Garry Newman's personal utility library";
45 homepage = "https://github.com/garrynewman/bootil";
46 # License unsure - see https://github.com/garrynewman/bootil/issues/21
47 license = licenses.free;
48 maintainers = with maintainers; [ abigailbuccaneer ];
49 # Build uses `-msse` and `-mfpmath=sse`
50 platforms = platforms.all;
51 badPlatforms = [ "aarch64-linux" ];
52 };
53}