2016-07-10 23:20:03 +02:00
|
|
|
{ stdenv, fetchurl, libpng
|
|
|
|
, docSupport ? true, doxygen ? null
|
|
|
|
}:
|
|
|
|
assert docSupport -> doxygen != null;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "pngpp";
|
2019-08-05 13:14:55 +02:00
|
|
|
version = "0.2.10";
|
2016-07-10 23:20:03 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://savannah/pngpp/png++-${version}.tar.gz";
|
2019-08-05 13:14:55 +02:00
|
|
|
sha256 = "1qgf8j25r57wjqlnzdkm8ya5x1bmj6xjvapv8f2visqnmcbg52lr";
|
2016-07-10 23:20:03 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkTarget = "test";
|
|
|
|
preCheck = ''
|
|
|
|
patchShebangs test/test.sh
|
|
|
|
substituteInPlace test/test.sh --replace "exit 1" "exit 0"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postCheck = "cat test/test.log";
|
|
|
|
|
2018-01-11 21:44:45 +01:00
|
|
|
buildInputs = stdenv.lib.optional docSupport doxygen;
|
2016-07-10 23:20:03 +02:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ libpng ];
|
|
|
|
|
2018-01-11 21:44:45 +01:00
|
|
|
preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace error.hpp --replace "#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE" "#if (__clang__ || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE"
|
|
|
|
'' + ''
|
|
|
|
sed "s|\(PNGPP := .\)|PREFIX := ''${out}\n\\1|" -i Makefile
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = stdenv.lib.optional docSupport "docs";
|
2016-07-10 23:20:03 +02:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.nongnu.org/pngpp/";
|
2016-07-10 23:20:03 +02:00
|
|
|
description = "C++ wrapper for libpng library";
|
|
|
|
license = licenses.bsd3;
|
2018-01-11 21:44:45 +01:00
|
|
|
platforms = platforms.unix;
|
2016-07-10 23:20:03 +02:00
|
|
|
maintainers = [ maintainers.ramkromberg ];
|
|
|
|
};
|
|
|
|
}
|