python: fix alot by having magic and python_magic packages
This commit is contained in:
parent
3882056313
commit
ab1c1773e2
2 changed files with 35 additions and 2 deletions
11
pkgs/tools/misc/file/python.patch
Normal file
11
pkgs/tools/misc/file/python.patch
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- file-5.11/python/magic.py 2011-09-22 18:57:41.000000000 +0200
|
||||
+++ file-5.11/python/magic.py.1 2012-04-30 15:00:31.750213810 +0200
|
||||
@@ -13,7 +13,7 @@
|
||||
Loads the shared library through ctypes and returns a library
|
||||
L{ctypes.CDLL} instance
|
||||
"""
|
||||
- return ctypes.cdll.LoadLibrary(find_library('magic'))
|
||||
+ return ctypes.CDLL('libmagic.so')
|
||||
|
||||
_libraries = {}
|
||||
_libraries['magic'] = _init()
|
|
@ -1612,7 +1612,7 @@ pythonPackages = modules // import ./python-packages-generated.nix {
|
|||
colander
|
||||
deform
|
||||
deform_bootstrap
|
||||
magic
|
||||
python_magic
|
||||
pyyaml
|
||||
cryptacular
|
||||
hypatia
|
||||
|
@ -2743,7 +2743,7 @@ pythonPackages = modules // import ./python-packages-generated.nix {
|
|||
});
|
||||
|
||||
|
||||
magic = buildPythonPackage rec {
|
||||
python_magic = buildPythonPackage rec {
|
||||
# TODO: wait for release 0.4.3+
|
||||
rev = "9f18d2c125b2f0240caec7096625834624cc4c20";
|
||||
name = "python-magic-${rev}";
|
||||
|
@ -2770,6 +2770,28 @@ pythonPackages = modules // import ./python-packages-generated.nix {
|
|||
};
|
||||
};
|
||||
|
||||
magic = pkgs.stdenv.mkDerivation rec {
|
||||
name = "python-${pkgs.file.name}";
|
||||
|
||||
src = pkgs.file.src;
|
||||
|
||||
patches = [ ../tools/misc/file/python.patch ];
|
||||
buildInputs = [ python pkgs.file ];
|
||||
|
||||
configurePhase = "cd python";
|
||||
|
||||
buildPhase = "${python}/bin/${python.executable} setup.py build";
|
||||
|
||||
installPhase = ''
|
||||
${python}/bin/${python.executable} setup.py install --prefix=$out
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "A Python wrapper around libmagic";
|
||||
homepage = http://www.darwinsys.com/file/;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
m2crypto = buildPythonPackage rec {
|
||||
version = "0.21.1";
|
||||
|
|
Loading…
Reference in a new issue