2023-01-20 10:41:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, libjpeg
|
|
|
|
, libpng
|
|
|
|
, libmng
|
|
|
|
, lcms1
|
|
|
|
, libtiff
|
|
|
|
, openexr
|
|
|
|
, libGL
|
|
|
|
, libX11
|
|
|
|
, pkg-config
|
|
|
|
, OpenGL
|
|
|
|
, runtimeShell
|
|
|
|
, withXorg ? true
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libdevil";
|
|
|
|
version = "1.7.8";
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/openil/DevIL-${version}.tar.gz";
|
|
|
|
sha256 = "1zd850nn7nvkkhasrv7kn17kzgslr5ry933v6db62s4lr0zzlbv8";
|
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
buildInputs = [ libjpeg libpng libmng lcms1 libtiff openexr ]
|
|
|
|
++ lib.optionals withXorg [ libX11 libGL ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ OpenGL ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [ "--enable-ILU" "--enable-ILUT" ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
sed -i 's, -std=gnu99,,g' configure
|
|
|
|
sed -i 's,malloc.h,stdlib.h,g' src-ILU/ilur/ilur.c
|
2021-02-05 17:12:51 +00:00
|
|
|
'' + lib.optionalString stdenv.cc.isClang ''
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -i 's/libIL_la_CXXFLAGS = $(AM_CFLAGS)/libIL_la_CXXFLAGS =/g' lib/Makefile.in
|
|
|
|
'';
|
|
|
|
|
|
|
|
postConfigure = ''
|
|
|
|
sed -i '/RESTRICT_KEYWORD/d' include/IL/config.h
|
|
|
|
'';
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
patches = [
|
|
|
|
(fetchurl {
|
2020-12-03 08:41:04 +00:00
|
|
|
url = "https://sources.debian.org/data/main/d/devil/1.7.8-10/debian/patches/03_CVE-2009-3994.diff";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "0qkx2qfv02igbrmsn6z5a3lbrbwjfh3rb0c2sj54wy0j1f775hbc";
|
2023-01-20 10:41:00 +00:00
|
|
|
})
|
|
|
|
./ftbfs-libpng15.patch
|
|
|
|
./il_endian.h.patch
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
for a in test/Makefile.in test/format_test/format_checks.sh.in ; do
|
|
|
|
substituteInPlace $a \
|
2023-01-20 10:41:00 +00:00
|
|
|
--replace /bin/bash ${runtimeShell}
|
2020-04-24 23:36:52 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2023-01-20 10:41:00 +00:00
|
|
|
homepage = "https://openil.sourceforge.net/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An image library which can can load, save, convert, manipulate, filter and display a wide variety of image formats";
|
|
|
|
license = licenses.lgpl2;
|
|
|
|
platforms = platforms.mesaPlatforms;
|
2023-01-20 10:41:00 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|