summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/python-magic
diff options
context:
space:
mode:
authorYegor Timoshenko <yegortimoshenko@riseup.net>2018-05-18 10:39:44 +0300
committerGitHub <noreply@github.com>2018-05-18 10:39:44 +0300
commit16ed09a10eff75674e93b76370bb5b8df3adb433 (patch)
treeba47a3d02d440b2ba1eeff53430bc5f7a478d533 /pkgs/development/python-modules/python-magic
parent0cb623c3d996638c548c8622c7df96d2cb4d1b05 (diff)
parent4c07c5635a81698d87c7a3d254ae2fe10d3e6c31 (diff)
Merge branch 'master' into fetchurl-user-agent
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;
+ };
+}