about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/capstone
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-04-01 15:50:50 +0000
committerAlyssa Ross <hi@alyssa.is>2020-04-01 15:50:50 +0000
commit75eafe97f7df0d653bec67f3962214d7c357831f (patch)
tree09f2cc901e0e637876cbb78d192dfe2fcfef8156 /nixpkgs/pkgs/development/libraries/capstone
parenta53b121bf4331497da63df3b1b7f1a7897dad146 (diff)
parenta2e06fc3423c4be53181b15c28dfbe0bcf67dd73 (diff)
downloadnixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar
nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar.gz
nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar.bz2
nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar.lz
nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar.xz
nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar.zst
nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.zip
Merge commit 'a2e06fc3423c4be53181b15c28dfbe0bcf67dd73'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/capstone')
-rw-r--r--nixpkgs/pkgs/development/libraries/capstone/default.nix22
1 files changed, 18 insertions, 4 deletions
diff --git a/nixpkgs/pkgs/development/libraries/capstone/default.nix b/nixpkgs/pkgs/development/libraries/capstone/default.nix
index 956fd74da585..b8d00984cd64 100644
--- a/nixpkgs/pkgs/development/libraries/capstone/default.nix
+++ b/nixpkgs/pkgs/development/libraries/capstone/default.nix
@@ -9,9 +9,23 @@ stdenv.mkDerivation rec {
     sha256 = "1isxw2qwy1fi3m3w7igsr5klzczxc5cxndz0a78dfss6ps6ymfvr";
   };
 
+  # replace faulty macos detection
+  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+    sed -i 's/^IS_APPLE := .*$/IS_APPLE := 1/' Makefile
+  '';
+
   configurePhase = '' patchShebangs make.sh '';
-  buildPhase = '' ./make.sh '';
-  installPhase = '' env PREFIX=$out ./make.sh install '';
+  buildPhase = "PREFIX=$out ./make.sh";
+
+  doCheck = true;
+  checkPhase = ''
+    # first remove fuzzing steps from check target
+    substituteInPlace Makefile --replace "fuzztest fuzzallcorp" ""
+    make check
+  '';
+
+  installPhase = (stdenv.lib.optionalString stdenv.isDarwin "HOMEBREW_CAPSTONE=1 ")
+    + "PREFIX=$out ./make.sh install";
   
   nativeBuildInputs = [
     pkgconfig
@@ -23,7 +37,7 @@ stdenv.mkDerivation rec {
     description = "Advanced disassembly library";
     homepage    = "http://www.capstone-engine.org";
     license     = stdenv.lib.licenses.bsd3;
-    platforms   = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+    platforms   = stdenv.lib.platforms.unix;
+    maintainers = with stdenv.lib.maintainers; [ thoughtpolice ris ];
   };
 }