1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5}:
6
7stdenv.mkDerivation {
8 pname = "blocksruntime";
9 version = "0-unstable-2017-10-28";
10
11 src = fetchFromGitHub {
12 owner = "mackyle";
13 repo = "blocksruntime";
14 rev = "9cc93ae2b58676c23fd02cf0c686fa15b7a3ff81";
15 sha256 = "sha256-pQMNZBgkF4uADOVCWXB5J3qQt8JMe8vo6ZmbtSVA5Xo=";
16 };
17
18 buildPhase = ''
19 runHook preBuild
20 ./buildlib ${lib.optionalString (!stdenv.hostPlatform.isStatic) "-shared"}
21 runHook postBuild
22 '';
23
24 installPhase = ''
25 runHook preInstall
26 prefix="/" DESTDIR=$out ./installlib ${
27 if stdenv.hostPlatform.isStatic then "-static" else "-shared"
28 }
29 runHook postInstall
30 '';
31
32 checkPhase = ''
33 runHook preCheck
34 ./checktests
35 runHook postCheck
36 '';
37
38 doCheck = false; # hasdescriptor.c test fails, hrm.
39
40 meta = with lib; {
41 description = "Installs the BlocksRuntime library from the compiler-rt";
42 homepage = "https://github.com/mackyle/blocksruntime";
43 license = licenses.mit;
44 };
45}