3
0
Fork 0
forked from mirrors/nixpkgs

* 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:
Eelco Dolstra 2010-12-29 19:19:56 +00:00
parent 0d582266a8
commit b7c7550c43
2 changed files with 12 additions and 15 deletions

View file

@ -2,6 +2,7 @@
stdenv.mkDerivation {
name = "file-5.03";
src = fetchurl {
url = ftp://ftp.astron.com/pub/file/file-5.03.tar.gz;
sha256 = "1fwmpplwc6h2g89ribq7w8x2np0yn5k7bw042815rv7jkrzv9nhy";

View file

@ -899,26 +899,22 @@ rec {
};
};
magic = buildPythonPackage rec {
name = "magic-0.3.1";
magic = pkgs.stdenv.mkDerivation rec {
name = "python-${pkgs.file.name}";
src = fetchurl {
url = "http://pypi.python.org/packages/source/p/python-magic/python-${name}.tar.gz";
md5 = "397cff81d2502e81fd3830a61ca2ad2c";
};
src = pkgs.file.src;
preConfigure =
''
# Ensure that the module can find libmagic by hard-coding the
# path to libmagic.so. Maybe there is a nicer way.
substituteInPlace magic.py --replace \
"ctypes.util.find_library('magic')" \
"'${pkgs.file}/lib/libmagic.so'"
'';
buildInputs = [ python pkgs.file ];
configurePhase = "cd python";
buildPhase = "python setup.py build";
installPhase = "python setup.py install --prefix=$out";
meta = {
description = "A Python wrapper around libmagic";
homepage = https://github.com/ahupp/python-magic;
homepage = http://www.darwinsys.com/file/;
};
};