pngpp: darwin support

1) Building with clang is addressed by navigating a minor #if in some
of the code.

2) I noticed that even when things were building correctly, passing
`${out}` as a variable assignment to `make` was actually not working:
there were compiler warnings about missing include directories whose
bogus paths involved the literal string `out`. I ended up fixing this
by performing the assignment to the make variable `PREFIX` in the
`Makefile` itself.

+9 -5
+9 -5
pkgs/development/libraries/png++/default.nix
··· 21 22 postCheck = "cat test/test.log"; 23 24 - buildInputs = [ ] 25 - ++ stdenv.lib.optional docSupport doxygen; 26 27 propagatedBuildInputs = [ libpng ]; 28 29 - makeFlags = [ "PREFIX=\${out}" ] 30 - ++ stdenv.lib.optional docSupport "docs"; 31 32 enableParallelBuilding = true; 33 ··· 35 homepage = http://www.nongnu.org/pngpp/; 36 description = "C++ wrapper for libpng library"; 37 license = licenses.bsd3; 38 - platforms = platforms.linux; 39 maintainers = [ maintainers.ramkromberg ]; 40 }; 41 }
··· 21 22 postCheck = "cat test/test.log"; 23 24 + buildInputs = stdenv.lib.optional docSupport doxygen; 25 26 propagatedBuildInputs = [ libpng ]; 27 28 + preConfigure = stdenv.lib.optionalString stdenv.isDarwin '' 29 + 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" 30 + '' + '' 31 + sed "s|\(PNGPP := .\)|PREFIX := ''${out}\n\\1|" -i Makefile 32 + ''; 33 + 34 + makeFlags = stdenv.lib.optional docSupport "docs"; 35 36 enableParallelBuilding = true; 37 ··· 39 homepage = http://www.nongnu.org/pngpp/; 40 description = "C++ wrapper for libpng library"; 41 license = licenses.bsd3; 42 + platforms = platforms.unix; 43 maintainers = [ maintainers.ramkromberg ]; 44 }; 45 }