1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/development/libraries/png++/default.nix
volth 46420bbaa3 treewide: name -> pname (easy cases) (#66585)
treewide replacement of

stdenv.mkDerivation rec {
  name = "*-${version}";
  version = "*";

to pname
2019-08-15 13:41:18 +01:00

46 lines
1.3 KiB
Nix

{ stdenv, fetchurl, libpng
, docSupport ? true, doxygen ? null
}:
assert docSupport -> doxygen != null;
stdenv.mkDerivation rec {
pname = "pngpp";
version = "0.2.10";
src = fetchurl {
url = "mirror://savannah/pngpp/png++-${version}.tar.gz";
sha256 = "1qgf8j25r57wjqlnzdkm8ya5x1bmj6xjvapv8f2visqnmcbg52lr";
};
doCheck = true;
checkTarget = "test";
preCheck = ''
patchShebangs test/test.sh
substituteInPlace test/test.sh --replace "exit 1" "exit 0"
'';
postCheck = "cat test/test.log";
buildInputs = stdenv.lib.optional docSupport doxygen;
propagatedBuildInputs = [ libpng ];
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";
enableParallelBuilding = true;
meta = with stdenv.lib; {
homepage = https://www.nongnu.org/pngpp/;
description = "C++ wrapper for libpng library";
license = licenses.bsd3;
platforms = platforms.unix;
maintainers = [ maintainers.ramkromberg ];
};
}