From 9bbf54ea2daaa15111af5d4973fe98375a419727 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Mon, 15 Oct 2018 11:53:02 -0400 Subject: [PATCH] pythonPackages.capstone: refactor move to python-modules --- .../python-modules/capstone/default.nix | 38 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 28 +------------- 2 files changed, 39 insertions(+), 27 deletions(-) create mode 100644 pkgs/development/python-modules/capstone/default.nix diff --git a/pkgs/development/python-modules/capstone/default.nix b/pkgs/development/python-modules/capstone/default.nix new file mode 100644 index 000000000000..91e00ed7e43c --- /dev/null +++ b/pkgs/development/python-modules/capstone/default.nix @@ -0,0 +1,38 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, fetchpatch +}: + +buildPythonPackage rec { + pname = "capstone"; + version = "3.0.4"; + + src = fetchPypi { + inherit pname version; + sha256 = "945d3b8c3646a1c3914824c416439e2cf2df8969dd722c8979cdcc23b40ad225"; + }; + + patches = [ + (fetchpatch { + stripLen = 2; + url = "https://patch-diff.githubusercontent.com/raw/aquynh/capstone/pull/783/commits/23fe9f36622573c747e2bab6119ff245437bf276.patch"; + sha256 = "0yizqrdlxqxn16873593kdx2vrr7gvvilhgcf9xy6hr0603d3m5r"; + }) + ]; + + postPatch = '' + patchShebangs src/make.sh + ''; + + preCheck = '' + mv src/libcapstone.so capstone + ''; + + meta = with stdenv.lib; { + homepage = "http://www.capstone-engine.org/"; + license = licenses.bsdOriginal; + description = "Capstone disassembly engine"; + maintainers = with maintainers; [ bennofs ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0c894af384d1..3f54712ddc98 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1070,33 +1070,7 @@ in { numpy = self.numpy; }; - capstone = buildPythonPackage rec { - name = "capstone-3.0.4"; - src = pkgs.fetchurl { - url = "mirror://pypi/c/capstone/${name}.tar.gz"; - sha256 = "945d3b8c3646a1c3914824c416439e2cf2df8969dd722c8979cdcc23b40ad225"; - }; - patches = [ - (pkgs.fetchpatch { - stripLen = 2; - url = "https://patch-diff.githubusercontent.com/raw/aquynh/capstone/pull/783/commits/23fe9f36622573c747e2bab6119ff245437bf276.patch"; - sha256 = "0yizqrdlxqxn16873593kdx2vrr7gvvilhgcf9xy6hr0603d3m5r"; - }) - ]; - postPatch = '' - patchShebangs src/make.sh - ''; - propagatedBuildInputs = [ ]; - preCheck = '' - mv src/libcapstone.so capstone - ''; - meta = with pkgs.stdenv.lib; { - homepage = "http://www.capstone-engine.org/"; - license = licenses.bsdOriginal; - description = "Capstone disassembly engine"; - maintainers = with maintainers; [ bennofs ]; - }; - }; + capstone = callPackage ../development/python-modules/capstone { }; cement = callPackage ../development/python-modules/cement {};