Unverified Commit f8b14e49 authored by Artturin's avatar Artturin Committed by GitHub
Browse files

libblocksruntime: unstable-2014-06-24 -> unstable-2017-10-28 and modernize (#346913)

parents 22b91d6b bb0a8ccd
Loading
Loading
Loading
Loading
+24 −13
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub, clang }:
{
  lib,
  stdenv,
  fetchFromGitHub,
}:

stdenv.mkDerivation {
  pname = "blocksruntime";
  version = "unstable-2014-06-24";
  version = "unstable-2017-10-28";

  src = fetchFromGitHub {
    owner = "mackyle";
    repo = "blocksruntime";
    rev = "b5c5274daf1e0e46ecc9ad8f6f69889bce0a0a5d";
    sha256 = "0ic4lagagkylcvwgf10mg0s1i57h4i25ds2fzvms22xj4zwzk1sd";
    rev = "9cc93ae2b58676c23fd02cf0c686fa15b7a3ff81";
    sha256 = "sha256-pQMNZBgkF4uADOVCWXB5J3qQt8JMe8vo6ZmbtSVA5Xo=";
  };

  buildInputs = [ clang ];

  configurePhase = ''
    export CC=clang
    export CXX=clang++
  buildPhase = ''
    runHook preBuild
    ./buildlib ${lib.optionalString (!stdenv.hostPlatform.isStatic) "-shared"}
    runHook postBuild
  '';

  buildPhase = "./buildlib";
  installPhase = ''
    runHook preInstall
    prefix="/" DESTDIR=$out ./installlib ${
      if stdenv.hostPlatform.isStatic then "-static" else "-shared"
    }
    runHook postInstall
  '';

  checkPhase = "./checktests";
  checkPhase = ''
    runHook preCheck
    ./checktests
    runHook postChck
  '';

  doCheck = false; # hasdescriptor.c test fails, hrm.

  installPhase = ''prefix="/" DESTDIR=$out ./installlib'';

  meta = with lib; {
    description = "Installs the BlocksRuntime library from the compiler-rt";
    homepage = "https://github.com/mackyle/blocksruntime";