* Replace the Python "magic" module with the (apparently) more
common one from the "file" package. svn path=/nixpkgs/trunk/; revision=25322
This commit is contained in:
parent
0d582266a8
commit
b7c7550c43
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "file-5.03";
|
name = "file-5.03";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = ftp://ftp.astron.com/pub/file/file-5.03.tar.gz;
|
url = ftp://ftp.astron.com/pub/file/file-5.03.tar.gz;
|
||||||
sha256 = "1fwmpplwc6h2g89ribq7w8x2np0yn5k7bw042815rv7jkrzv9nhy";
|
sha256 = "1fwmpplwc6h2g89ribq7w8x2np0yn5k7bw042815rv7jkrzv9nhy";
|
||||||
|
@ -899,26 +899,22 @@ rec {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
magic = buildPythonPackage rec {
|
magic = pkgs.stdenv.mkDerivation rec {
|
||||||
name = "magic-0.3.1";
|
name = "python-${pkgs.file.name}";
|
||||||
|
|
||||||
src = fetchurl {
|
src = pkgs.file.src;
|
||||||
url = "http://pypi.python.org/packages/source/p/python-magic/python-${name}.tar.gz";
|
|
||||||
md5 = "397cff81d2502e81fd3830a61ca2ad2c";
|
|
||||||
};
|
|
||||||
|
|
||||||
preConfigure =
|
buildInputs = [ python pkgs.file ];
|
||||||
''
|
|
||||||
# Ensure that the module can find libmagic by hard-coding the
|
configurePhase = "cd python";
|
||||||
# path to libmagic.so. Maybe there is a nicer way.
|
|
||||||
substituteInPlace magic.py --replace \
|
buildPhase = "python setup.py build";
|
||||||
"ctypes.util.find_library('magic')" \
|
|
||||||
"'${pkgs.file}/lib/libmagic.so'"
|
installPhase = "python setup.py install --prefix=$out";
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "A Python wrapper around libmagic";
|
description = "A Python wrapper around libmagic";
|
||||||
homepage = https://github.com/ahupp/python-magic;
|
homepage = http://www.darwinsys.com/file/;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user