From 814d3efcf58fcbb6bfaf1c092df4f1b0854f393c Mon Sep 17 00:00:00 2001 From: Nathan Owens Date: Sun, 22 Dec 2019 21:33:27 -0600 Subject: [PATCH] fotoxx: fix build on musl Signed-off-by: Nathan Owens --- srcpkgs/fotoxx/files/libexecinfo_link.patch | 13 +++++++++++ srcpkgs/fotoxx/patches/musl_build.patch | 25 +++++++++++++++++++++ srcpkgs/fotoxx/template | 14 ++++++++---- 3 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 srcpkgs/fotoxx/files/libexecinfo_link.patch create mode 100644 srcpkgs/fotoxx/patches/musl_build.patch diff --git a/srcpkgs/fotoxx/files/libexecinfo_link.patch b/srcpkgs/fotoxx/files/libexecinfo_link.patch new file mode 100644 index 00000000000..858d9c3c869 --- /dev/null +++ b/srcpkgs/fotoxx/files/libexecinfo_link.patch @@ -0,0 +1,13 @@ +diff --git Makefile Makefile +index e191e72..6922391 100644 +--- Makefile ++++ Makefile +@@ -47,7 +47,7 @@ CFLAGS = $(CXXFLAGS) $(CPPFLAGS) -c \ + -I/usr/include/libchamplain-0.12/ + + LIBS = `$(PKG_CONFIG) --libs gtk+-3.0` \ +- -lrt -lpthread -llcms2 -ltiff -lpng -lraw -ljpeg \ ++ -lrt -lexecinfo -lpthread -llcms2 -ltiff -lpng -lraw -ljpeg \ + -lclutter-1.0 -lclutter-gtk-1.0 -lchamplain-0.12 -lchamplain-gtk-0.12 + + ALLFILES = fotoxx.o f.widgets.o f.file.o f.gallery.o f.albums.o f.area.o f.meta.o \ diff --git a/srcpkgs/fotoxx/patches/musl_build.patch b/srcpkgs/fotoxx/patches/musl_build.patch new file mode 100644 index 00000000000..29a6e7f302b --- /dev/null +++ b/srcpkgs/fotoxx/patches/musl_build.patch @@ -0,0 +1,25 @@ +diff --git f.file.cc f.file.cc +index ef8d59a..de26b74 100644 +--- f.file.cc ++++ f.file.cc +@@ -3344,16 +3344,17 @@ int find_imagefiles(cchar *folder, int flags, char **&flist, int &NF, int Finit) + + globflags = GLOB_NOSORT; + Fimages = Fthumbs = Fdirs = Frecurse = 0; +- ++ + if (flags & 1) Fimages = 1; + if (flags & 2) Fthumbs = 1; + if (flags & 4) globflags += GLOB_PERIOD; + if (flags & 8) Fdirs = 1; + if (flags & 16) Frecurse = 1; +- ++ ++#ifdef __GLIBC__ + if (Fdirs && ! Fimages && ! Fthumbs) + globflags += GLOB_ONLYDIR; +- ++#endif + globdata.gl_pathc = 0; // glob() setup + globdata.gl_offs = 0; + globdata.gl_pathc = 0; diff --git a/srcpkgs/fotoxx/template b/srcpkgs/fotoxx/template index 9d9602e6ccf..00e92847094 100644 --- a/srcpkgs/fotoxx/template +++ b/srcpkgs/fotoxx/template @@ -15,14 +15,20 @@ homepage="https://www.kornelix.net/fotoxx/fotoxx.html" distfiles="https://www.kornelix.net/downloads/downloads/fotoxx-${version}.tar.gz" checksum=bfa6f20bc5121fbf521354ddf19489e0cfba1f8aa72db1e63fdb26fc5d935752 -case "$XBPS_TARGET_MACHINE" in - *-musl) broken="execinfo.h is a GNU specific header, and doesn’t exist under musl.";; -esac - if [ "$CROSS_BUILD" ]; then hostmakedepends+=" libchamplain-devel" fi +case "$XBPS_TARGET_LIBC" in + musl) makedepends+=" libexecinfo-devel";; +esac + +pre_build() { + case "$XBPS_TARGET_LIBC" in + musl) patch -Np0 < "$FILESDIR"/libexecinfo_link.patch ;; + esac +} + post_install() { rm -v ${DESTDIR}/usr/share/doc/fotoxx/{changelog.gz,copyright,fotoxx.man} rm -rv ${DESTDIR}/usr/share/appdata