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