83 lines
1.6 KiB
Nix
83 lines
1.6 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchurl
|
|
, lsb-release
|
|
, fftw
|
|
, fftwFloat
|
|
, libpng
|
|
, lua51Packages
|
|
, zlib
|
|
, tree
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "im";
|
|
version = "3.15";
|
|
|
|
src = fetchurl {
|
|
url = "mirror://sourceforge/imtoolkit/${version}/Docs%20and%20Sources/${pname}-${version}_Sources.tar.gz";
|
|
sha256 = "sha256-NsxCV/j1+BEouFS7O+KcXL3QkUdlKPMVr2ZtCTC5tX4=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
lsb-release
|
|
];
|
|
|
|
buildInputs = [
|
|
fftw
|
|
fftwFloat
|
|
libpng
|
|
lua51Packages.lua
|
|
zlib
|
|
];
|
|
|
|
pc = ''
|
|
prefix=${placeholder "out"}
|
|
exec_prefix=${placeholder "out"}
|
|
libdir=${placeholder "out"}/lib
|
|
includedir=${placeholder "out"}/include
|
|
|
|
Name: IM
|
|
Description: A toolkit for image representation, storage, capture and processing
|
|
Version: ${version}
|
|
Libs: -L${placeholder "out"} -lim
|
|
Cflags: -I${placeholder "out"}/include
|
|
Requires: fftw3 libpng zlib
|
|
'';
|
|
|
|
postPatch = ''
|
|
patchShebangs .
|
|
sed -i '1i#include <unistd.h>' src/libjasper2/base/jas_stream.c
|
|
'';
|
|
|
|
makeFlags = [ "NO_DEPEND=Yes" ];
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/{include,lib/pkgconfig}
|
|
|
|
cp -vr include/* $out/include/
|
|
|
|
cp -v lib/Linux*/*.so $out/lib/
|
|
cp -v lib/Linux*/*.a $out/lib/ || true
|
|
|
|
cp -v lib/Linux*/Lua*/*.so $out/lib/
|
|
cp -v lib/Linux*/Lua*/*.a $out/lib/ || true
|
|
|
|
# Since IM doesn't supply it, provide pkg-config file.
|
|
cat > $out/lib/pkgconfig/im.pc <<EOF
|
|
${pc}
|
|
EOF
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "A toolkit for image representation, storage, capture and processing";
|
|
license = licenses.mit;
|
|
maintainers = [ eko5z ];
|
|
platforms = with platforms; gnu ++ linux ++ darwin;
|
|
};
|
|
}
|