agg: enable build on darwin

Co-authored-by: OPNA2608 <christoph.neidahl@gmail.com>
Co-authored-by: SuperSandro2000 <sandro.jaeckel@gmail.com>
This commit is contained in:
Zack A 2021-08-30 04:24:30 -07:00 committed by Zack A.
parent 9b6319edee
commit ba489ce318
No known key found for this signature in database
GPG Key ID: 6310C97DE31D1545

View File

@ -9,7 +9,15 @@ stdenv.mkDerivation rec {
sha256 = "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ autoconf automake libtool freetype SDL libX11 ];
buildInputs = [
autoconf
automake
libtool
freetype
SDL
] ++ lib.optionals stdenv.isLinux [
libX11
];
postPatch = ''
substituteInPlace include/agg_renderer_outline_aa.h \
@ -22,7 +30,13 @@ stdenv.mkDerivation rec {
sh autogen.sh
'';
configureFlags = [ "--x-includes=${libX11.dev}/include" "--x-libraries=${libX11.out}/lib" "--enable-examples=no" ];
configureFlags = [
(lib.strings.enableFeature stdenv.isLinux "platform")
"--enable-examples=no"
] ++ lib.optionals stdenv.isLinux [
"--x-includes=${lib.getDev libX11}/include"
"--x-libraries=${lib.getLib libX11}/lib"
];
# libtool --tag=CXX --mode=link g++ -g -O2 libexamples.la ../src/platform/X11/libaggplatformX11.la ../src/libagg.la -o alpha_mask2 alpha_mask2.o
# libtool: error: cannot find the library 'libexamples.la'
@ -43,6 +57,6 @@ stdenv.mkDerivation rec {
license = lib.licenses.gpl2Plus;
homepage = "http://www.antigrain.com/";
platforms = lib.platforms.linux;
platforms = lib.platforms.unix;
};
}