1{ stdenv, fetchFromGitHub, fetchpatch, premake4 }:
2
3stdenv.mkDerivation rec {
4 name = "bootil-unstable-2015-12-17";
5
6 meta = {
7 description = "Garry Newman's personal utility library";
8 homepage = https://github.com/garrynewman/bootil;
9 # License unsure - see https://github.com/garrynewman/bootil/issues/21
10 license = stdenv.lib.licenses.free;
11 maintainers = [ stdenv.lib.maintainers.abigailbuccaneer ];
12 platforms = stdenv.lib.platforms.all;
13 # Build uses `-msse` and `-mfpmath=sse`
14 badPlatforms = [ "aarch64-linux" ];
15 };
16
17 src = fetchFromGitHub {
18 owner = "garrynewman";
19 repo = "bootil";
20 rev = "1d3e321fc2be359e2350205b8c7f1cad2164ee0b";
21 sha256 = "03wq526r80l2px797hd0n5m224a6jibwipcbsvps6l9h740xabzg";
22 };
23
24 patches = [ (fetchpatch {
25 url = https://github.com/garrynewman/bootil/pull/22.patch;
26 name = "github-pull-request-22.patch";
27 sha256 = "1qf8wkv00pb9w1aa0dl89c8gm4rmzkxfl7hidj4gz0wpy7a24qa2";
28 }) ];
29
30 # Avoid guessing where files end up. Just use current directory.
31 postPatch = ''
32 substituteInPlace projects/premake4.lua \
33 --replace 'location ( os.get() .. "/" .. _ACTION )' 'location ( ".." )'
34 substituteInPlace projects/bootil.lua \
35 --replace 'targetdir ( "../lib/" .. os.get() .. "/" .. _ACTION )' 'targetdir ( ".." )'
36 '';
37
38 nativeBuildInputs = [ premake4 ];
39 premakefile = "projects/premake4.lua";
40
41 installPhase = ''
42 install -D libbootil_static.a $out/lib/libbootil_static.a
43 cp -r include $out
44 '';
45}