about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/unicorn/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/unicorn/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/unicorn/default.nix22
1 files changed, 11 insertions, 11 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/unicorn/default.nix b/nixpkgs/pkgs/development/python-modules/unicorn/default.nix
index 725c73960f5d..86542439439e 100644
--- a/nixpkgs/pkgs/development/python-modules/unicorn/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/unicorn/default.nix
@@ -1,23 +1,23 @@
-{ stdenv, buildPackages, buildPythonPackage, fetchPypi }:
+{ stdenv, buildPythonPackage, setuptools, unicorn-emu }:
 
 buildPythonPackage rec {
   pname = "unicorn";
-  version = "1.0.1";
+  version = stdenv.lib.getVersion unicorn-emu;
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "0a5b4vh734b3wfkgapzzf8x18rimpmzvwwkly56da84n27wfw9bg";
-  };
+  src = unicorn-emu.src;
+  sourceRoot = "unicorn-${version}/bindings/python";
 
-  # needs python2 at build time
-  PYTHON=buildPackages.python2.interpreter;
+  prePatch = ''
+    ln -s ${unicorn-emu}/lib/libunicorn${stdenv.targetPlatform.extensions.sharedLibrary} prebuilt/
+    ln -s ${unicorn-emu}/lib/libunicorn.a prebuilt/
+  '';
 
-  setupPyBuildFlags = [ "--plat-name" "linux" ];
+  propagatedBuildInputs = [ setuptools ];
 
   meta = with stdenv.lib; {
-    description = "Unicorn CPU emulator engine";
+    description = "Python bindings for Unicorn CPU emulator engine";
     homepage = "http://www.unicorn-engine.org/";
     license = [ licenses.gpl2 ];
-    maintainers = [ maintainers.bennofs ];
+    maintainers = with maintainers; [ bennofs ris ];
   };
 }