summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/python-magic
diff options
context:
space:
mode:
authorMatthew Justin Bauer <mjbauer95@gmail.com>2018-04-21 14:48:30 -0500
committerGitHub <noreply@github.com>2018-04-21 14:48:30 -0500
commit7a516cd0c3ee89c4b180d2d7a5b9e7c1a77bc677 (patch)
tree47edc96c97ea1f6aa7735a283f637227f1559bc1 /pkgs/development/python-modules/python-magic
parenta2e40f72547a888066698a41fa54ca4c675aaad0 (diff)
parentdff29c676b07ce0f9e7de5bd4281c92717225401 (diff)
Merge branch 'master' into feat/nsd/dnssec
Diffstat (limited to 'pkgs/development/python-modules/python-magic')
-rw-r--r--pkgs/development/python-modules/python-magic/default.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/python-magic/default.nix b/pkgs/development/python-modules/python-magic/default.nix
new file mode 100644
index 000000000000..d48a6288a7dd
--- /dev/null
+++ b/pkgs/development/python-modules/python-magic/default.nix
@@ -0,0 +1,28 @@
+{ buildPythonPackage, lib, fetchPypi, file, stdenv }:
+
+buildPythonPackage rec {
+ pname = "python-magic";
+ version = "0.4.15";
+
+ src = fetchPypi {
+ inherit pname version;
+ sha256 = "f3765c0f582d2dfc72c15f3b5a82aecfae9498bd29ca840d72f37d7bd38bfcd5";
+ };
+
+ postPatch = ''
+ substituteInPlace magic.py --replace "ctypes.util.find_library('magic')" "'${file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}'"
+ '';
+
+ doCheck = false;
+
+ # TODO: tests are failing
+ #checkPhase = ''
+ # ${python}/bin/${python.executable} ./test.py
+ #'';
+
+ meta = {
+ description = "A python interface to the libmagic file type identification library";
+ homepage = https://github.com/ahupp/python-magic;
+ license = lib.licenses.mit;
+ };
+}