summary refs log tree commit diff
path: root/pkgs/development/python-modules/unicorn
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2019-12-31 21:24:13 +0000
committerAustin Seipp <aseipp@pobox.com>2020-01-04 15:08:56 -0600
commit8b3e1e72a7fa91e9f35350ef55b3adb97b255292 (patch)
treef15383724debadc295600ad8c5bbc7e698020d85 /pkgs/development/python-modules/unicorn
parent7766de0a5355b46a189d54bfe9e2aa1c2f30c60f (diff)
downloadnixpkgs-8b3e1e72a7fa91e9f35350ef55b3adb97b255292.tar
nixpkgs-8b3e1e72a7fa91e9f35350ef55b3adb97b255292.tar.gz
nixpkgs-8b3e1e72a7fa91e9f35350ef55b3adb97b255292.tar.bz2
nixpkgs-8b3e1e72a7fa91e9f35350ef55b3adb97b255292.tar.lz
nixpkgs-8b3e1e72a7fa91e9f35350ef55b3adb97b255292.tar.xz
nixpkgs-8b3e1e72a7fa91e9f35350ef55b3adb97b255292.tar.zst
nixpkgs-8b3e1e72a7fa91e9f35350ef55b3adb97b255292.zip
pythonPackages.unicorn: redesign to become a wrapper package around unicorn-emu
this allows us to easily keep the two in sync and gives a more flexible
result, also add self as co-maintainer.
Diffstat (limited to 'pkgs/development/python-modules/unicorn')
-rw-r--r--pkgs/development/python-modules/unicorn/default.nix22
1 files changed, 11 insertions, 11 deletions
diff --git a/pkgs/development/python-modules/unicorn/default.nix b/pkgs/development/python-modules/unicorn/default.nix
index 725c73960f5..86542439439 100644
--- a/pkgs/development/python-modules/unicorn/default.nix
+++ b/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 ];
   };
 }