mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-11 15:15:36 +00:00
6d6cbd316d
The original build broke with the following linker issue: ``` CXXLD _PythonMagick.la /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/ld: cannot find -l-L/nix/store/4gh6ynzsd5ndx37hmkl62xa8z30k43y1-imagemagick-6.9.9-34/lib collect2: error: ld returned 1 exit status ``` This happens since `BOOST_PYTHON_LIB` wasn't set properly, however `_PythonMagick.la` was linked with `-l$(BOOST_PYTHON_LIB) $(MAGICK_LIBS)`. With an empty `BOOST_PYTHON_LIB` the linker got confused. To work around this, the `boost` library directory needs to be specified explicitly. To ensure that the changes take effect, the original `configure` script shipped with `$src` needs to be removed and recreated using the `autoreconfHook`. Additionally the `imagemagick` license (https://spdx.org/licenses/ImageMagick.html) needs to be added to `lib/licenses.nix` to document the proper license of `pythonmagick` in the meta section.
29 lines
900 B
Nix
29 lines
900 B
Nix
# This expression provides Python bindings to ImageMagick. Python libraries are supposed to be called via `python-packages.nix`.
|
|
|
|
{ stdenv, fetchurl, python, pkgconfig, imagemagick, autoreconfHook }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "pythonmagick-${version}";
|
|
version = "0.9.16";
|
|
|
|
src = fetchurl {
|
|
url = "mirror://imagemagick/python/releases/PythonMagick-${version}.tar.xz";
|
|
sha256 = "137278mfb5079lns2mmw73x8dhpzgwha53dyl00mmhj2z25varpn";
|
|
};
|
|
|
|
postPatch = ''
|
|
rm configure
|
|
'';
|
|
|
|
configureFlags = [ "--with-boost=${python.pkgs.boost}" ];
|
|
|
|
nativeBuildInputs = [ pkgconfig autoreconfHook ];
|
|
buildInputs = [ python python.pkgs.boost imagemagick ];
|
|
|
|
meta = with stdenv.lib; {
|
|
homepage = http://www.imagemagick.org/script/api.php;
|
|
license = licenses.imagemagick;
|
|
description = "PythonMagick provides object oriented bindings for the ImageMagick Library.";
|
|
};
|
|
}
|