summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornia <nia@pkgsrc.org>2021-09-17 00:10:21 +0000
committernia <nia@pkgsrc.org>2021-09-17 00:10:21 +0000
commitc5a00d836074ecfc3a1c8a105f37dc68c7b03502 (patch)
treedb4c0577881b287700f5fff53871a0c0aeb481b6
parent2e0c64683d375cf09f9795894e69a5173043424d (diff)
downloadpkgsrc-c5a00d836074ecfc3a1c8a105f37dc68c7b03502.tar.gz
gpac: Fix building on notdarwin.
-rw-r--r--multimedia/gpac/Makefile21
-rw-r--r--multimedia/gpac/PLIST15
-rw-r--r--multimedia/gpac/distinfo9
-rw-r--r--multimedia/gpac/options.mk42
-rw-r--r--multimedia/gpac/patches/patch-Makefile21
-rw-r--r--multimedia/gpac/patches/patch-include_gpac_Remotery.h15
-rw-r--r--multimedia/gpac/patches/patch-src_quickjs_cutils.h24
-rw-r--r--multimedia/gpac/patches/patch-src_quickjs_quickjs.c15
-rw-r--r--multimedia/gpac/patches/patch-src_utils_Remotery.c24
-rw-r--r--multimedia/gpac/patches/patch-src_utils_os__config__init.c44
10 files changed, 204 insertions, 26 deletions
diff --git a/multimedia/gpac/Makefile b/multimedia/gpac/Makefile
index ccc4a9d9f10..777cd7aea1b 100644
--- a/multimedia/gpac/Makefile
+++ b/multimedia/gpac/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.82 2021/07/30 12:27:02 ryoon Exp $
+# $NetBSD: Makefile,v 1.83 2021/09/17 00:10:21 nia Exp $
DISTNAME= gpac-1.0.1
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= multimedia
MASTER_SITES= ${MASTER_SITE_GITHUB:=gpac/}
GITHUB_TAG= v${PKGVERSION_NOREV}
@@ -21,7 +21,8 @@ CONFIGURE_ARGS+= --extra-cflags="${CFLAGS}"
CONFIGURE_ARGS+= --extra-ldflags="${LDFLAGS}"
CFLAGS+= -I${BUILDLINK_PREFIX.faad2}/${BUILDLINK_INCDIRS.faad2}
-.include "options.mk"
+# malloc_usable_size()
+LDFLAGS.NetBSD+= -ljemalloc
# Pre-generate header and avoid git dependency.
pre-build:
@@ -29,37 +30,33 @@ pre-build:
.include "../../mk/bsd.prefs.mk"
+PLIST_VARS+= darwin notdarwin
.if ${SHLIB_TYPE} == "dylib"
+PLIST.darwin= yes
PLIST_SUBST+= LIBEXT=dylib
post-install:
cd ${DESTDIR}${PREFIX} && find lib/gpac -name "*.dylib" | while read lib; do \
install_name_tool -id ${PREFIX}/$${lib} $${lib}; \
done
.else
-PLIST_SUBST+= LIBEXT=so
+PLIST.notdarwin= yes
+PLIST_SUBST+= LIBEXT=so
.endif
+.include "options.mk"
.include "../../audio/faad2/buildlink3.mk"
.include "../../audio/liba52/buildlink3.mk"
.include "../../audio/libmad/buildlink3.mk"
.include "../../audio/libvorbis/buildlink3.mk"
-.include "../../audio/pulseaudio/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../graphics/freetype2/buildlink3.mk"
.include "../../graphics/openjpeg/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
-# doesn't work yet
-#.include "../../lang/spidermonkey/buildlink3.mk"
.include "../../multimedia/ffmpeg4/buildlink3.mk"
.include "../../multimedia/libogg/buildlink3.mk"
.include "../../multimedia/libtheora/buildlink3.mk"
.include "../../multimedia/xvidcore/buildlink3.mk"
.include "../../security/openssl/buildlink3.mk"
.include "../../textproc/xmlrpc-c/buildlink3.mk"
-PLIST_VARS+= oss
-.if ${OPSYS} != "Darwin"
-.include "../../mk/oss.buildlink3.mk"
-PLIST.oss= yes
-.endif
.include "../../mk/jpeg.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/multimedia/gpac/PLIST b/multimedia/gpac/PLIST
index 2a656c97bbe..45f599a5b61 100644
--- a/multimedia/gpac/PLIST
+++ b/multimedia/gpac/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.10 2021/07/14 01:35:23 schmonz Exp $
+@comment $NetBSD: PLIST,v 1.11 2021/09/17 00:10:21 nia Exp $
bin/MP4Box
bin/MP4Client
bin/gpac
@@ -95,12 +95,15 @@ include/gpac/version.h
include/gpac/webvtt.h
include/gpac/xml.h
lib/gpac/gm_ft_font.${LIBEXT}
-${PLIST.oss}lib/gpac/gm_oss_audio.${LIBEXT}
-lib/gpac/gm_pulseaudio.${LIBEXT}
+${PLIST.alsa}lib/gpac/gm_alsa.${LIBEXT}
+${PLIST.jack}lib/gpac/gm_jack.${LIBEXT}
+${PLIST.pulseaudio}lib/gpac/gm_pulseaudio.${LIBEXT}
lib/gpac/gm_validator.${LIBEXT}
${PLIST.x11}lib/gpac/gm_x11_out.${LIBEXT}
-lib/libgpac.10.1.0.${LIBEXT}
-lib/libgpac.10.${LIBEXT}
+${PLIST.darwin}lib/libgpac.10.1.0.${LIBEXT}
+${PLIST.darwin}lib/libgpac.10.${LIBEXT}
+${PLIST.notdarwin}lib/libgpac.${LIBEXT}.10.1.0
+${PLIST.notdarwin}lib/libgpac.${LIBEXT}.10
lib/libgpac.${LIBEXT}
lib/libgpac_static.a
lib/pkgconfig/gpac.pc
@@ -108,6 +111,7 @@ man/man1/gpac-filters.1
man/man1/gpac.1
man/man1/mp4box.1
man/man1/mp4client.1
+share/applications/gpac.desktop
share/gpac/default.cfg
share/gpac/gui/extensions/H2B2VS/H2B2VS.png
share/gpac/gui/extensions/H2B2VS/h2b2vs.js
@@ -199,3 +203,4 @@ share/gpac/scripts/ttml-renderer.js
share/gpac/scripts/webvtt-renderer.js
share/gpac/shaders/fragment.glsl
share/gpac/shaders/vertex.glsl
+share/pixmaps/gpac.png
diff --git a/multimedia/gpac/distinfo b/multimedia/gpac/distinfo
index 4014908fc12..e25bfef4c54 100644
--- a/multimedia/gpac/distinfo
+++ b/multimedia/gpac/distinfo
@@ -1,8 +1,13 @@
-$NetBSD: distinfo,v 1.18 2021/07/14 01:35:23 schmonz Exp $
+$NetBSD: distinfo,v 1.19 2021/09/17 00:10:21 nia Exp $
SHA1 (gpac-1.0.1.tar.gz) = ceda4a9ffc2fb51958fa292b432d1f0f9a457a60
RMD160 (gpac-1.0.1.tar.gz) = 1e19dba1a2770268f64947f6ba34fb458028764f
SHA512 (gpac-1.0.1.tar.gz) = 533371d59e72250bef315be03ec3437cd66782d0fb6bdb6486a6f4d57d06a6a7deff1b31fe8bfd360be1d1c848b33b5d25e7268f56f27f8e92cbcb7da1aba82b
Size (gpac-1.0.1.tar.gz) = 10352926 bytes
-SHA1 (patch-Makefile) = 4fa2a8034ef1e01bc3c716f8b3b60be976e620f1
+SHA1 (patch-Makefile) = 1478bc37c42f8e62dbf44e9dfe2fa988ef68e0b5
SHA1 (patch-configure) = b76d24b134b7e10c613411f08d8374f0e0202599
+SHA1 (patch-include_gpac_Remotery.h) = 0a8775a6cb7b16e2c5c7b6018c940bf9a049cc31
+SHA1 (patch-src_quickjs_cutils.h) = df7662578bf2c727da43dce91d94bc380f6da84d
+SHA1 (patch-src_quickjs_quickjs.c) = 276e3d2dfa51a64bf99795b294bb7e16405a9627
+SHA1 (patch-src_utils_Remotery.c) = dfd01780211bcccfc574c572690241c91d941ce0
+SHA1 (patch-src_utils_os__config__init.c) = 99e339d969e319a0a29fc8b366f6335c19ca4c50
diff --git a/multimedia/gpac/options.mk b/multimedia/gpac/options.mk
index cb9f5202f78..2b003a25f34 100644
--- a/multimedia/gpac/options.mk
+++ b/multimedia/gpac/options.mk
@@ -1,11 +1,45 @@
-# $NetBSD: options.mk,v 1.3 2020/09/19 03:38:07 schmonz Exp $
+# $NetBSD: options.mk,v 1.4 2021/09/17 00:10:21 nia Exp $
-PKG_OPTIONS_VAR= PKG_OPTIONS.gpac
-PKG_SUPPORTED_OPTIONS= x11
-PKG_SUGGESTED_OPTIONS= x11
+PKG_OPTIONS_VAR= PKG_OPTIONS.gpac
+PKG_SUPPORTED_OPTIONS= alsa jack pulseaudio x11
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+.if ${OPSYS} == "Linux"
+PKG_SUGGESTED_OPTIONS= alsa x11
+.else
+PKG_SUGGESTED_OPTIONS= x11
+.endif
.include "../../mk/bsd.options.mk"
+PLIST_VARS+= alsa
+.if !empty(PKG_OPTIONS:Malsa)
+PLIST.alsa= yes
+CONFIGURE_ARGS+= --enable-alsa
+.include "../../audio/alsa-lib/buildlink3.mk"
+.else
+CONFIGURE_ARGS+= --disable-alsa
+.endif
+
+PLIST_VARS+= jack
+.if !empty(PKG_OPTIONS:Mjack)
+PLIST.jack= yes
+CONFIGURE_ARGS+= --enable-jack
+.include "../../audio/jack/buildlink3.mk"
+.else
+CONFIGURE_ARGS+= --disable-jack
+.endif
+
+PLIST_VARS+= pulseaudio
+.if !empty(PKG_OPTIONS:Mpulseaudio)
+PLIST.pulseaudio= yes
+CONFIGURE_ARGS+= --enable-pulseaudio
+.include "../../audio/pulseaudio/buildlink3.mk"
+.else
+CONFIGURE_ARGS+= --disable-pulseaudio
+.endif
+
PLIST_VARS+= x11
.if !empty(PKG_OPTIONS:Mx11)
CONFIGURE_ARGS+= --X11-path=${X11BASE}
diff --git a/multimedia/gpac/patches/patch-Makefile b/multimedia/gpac/patches/patch-Makefile
index 074a8f4409b..220452ac204 100644
--- a/multimedia/gpac/patches/patch-Makefile
+++ b/multimedia/gpac/patches/patch-Makefile
@@ -1,10 +1,25 @@
-$NetBSD: patch-Makefile,v 1.4 2021/07/14 01:35:24 schmonz Exp $
+$NetBSD: patch-Makefile,v 1.5 2021/09/17 00:10:21 nia Exp $
-Remove non-standard cp(1) option.
+- Install desktop files on Darwin too.
+- Remove non-standard cp(1) option.
--- Makefile.orig 2020-09-10 16:38:49.000000000 +0000
+++ Makefile
-@@ -171,15 +171,9 @@ endif
+@@ -156,13 +156,11 @@ endif
+ $(INSTALL) $(INSTFLAGS) -m 644 $(SRC_PATH)/share/res/gpac.png $(DESTDIR)$(prefix)/share/gpac/res/
+ $(INSTALL) $(INSTFLAGS) -m 644 $(SRC_PATH)/share/default.cfg $(DESTDIR)$(prefix)/share/gpac/
+
+-ifneq ($(CONFIG_DARWIN),yes)
+ $(INSTALL) -d "$(DESTDIR)$(prefix)/share/pixmaps"
+ $(INSTALL) -d "$(DESTDIR)$(prefix)/share/applications"
+
+ $(INSTALL) $(INSTFLAGS) -m 644 $(SRC_PATH)/share/res/gpac.png "$(DESTDIR)$(prefix)/share/pixmaps/"
+ $(INSTALL) $(INSTFLAGS) -m 644 $(SRC_PATH)/share/gpac.desktop "$(DESTDIR)$(prefix)/share/applications/"
+-endif
+
+ $(INSTALL) $(INSTFLAGS) -m 644 $(SRC_PATH)/share/gui/gui.bt "$(DESTDIR)$(prefix)/share/gpac/gui/"
+ $(INSTALL) $(INSTFLAGS) -m 644 $(SRC_PATH)/share/gui/gui.js "$(DESTDIR)$(prefix)/share/gpac/gui/"
+@@ -171,15 +169,9 @@ endif
$(INSTALL) $(INSTFLAGS) -m 644 $(SRC_PATH)/share/scripts/ttml-renderer.js "$(DESTDIR)$(prefix)/share/gpac/scripts/"
diff --git a/multimedia/gpac/patches/patch-include_gpac_Remotery.h b/multimedia/gpac/patches/patch-include_gpac_Remotery.h
new file mode 100644
index 00000000000..46629740aa4
--- /dev/null
+++ b/multimedia/gpac/patches/patch-include_gpac_Remotery.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-include_gpac_Remotery.h,v 1.1 2021/09/17 00:10:21 nia Exp $
+
+Add support for NetBSD.
+
+--- include/gpac/Remotery.h.orig 2020-09-10 16:38:49.000000000 +0000
++++ include/gpac/Remotery.h
+@@ -120,7 +120,7 @@ documented just below this comment.
+ // Platform identification
+ #if defined(_WINDOWS) || defined(_WIN32)
+ #define RMT_PLATFORM_WINDOWS
+-#elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)
++#elif defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ #define RMT_PLATFORM_LINUX
+ #define RMT_PLATFORM_POSIX
+ #elif defined(__APPLE__)
diff --git a/multimedia/gpac/patches/patch-src_quickjs_cutils.h b/multimedia/gpac/patches/patch-src_quickjs_cutils.h
new file mode 100644
index 00000000000..b8951117316
--- /dev/null
+++ b/multimedia/gpac/patches/patch-src_quickjs_cutils.h
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_quickjs_cutils.h,v 1.1 2021/09/17 00:10:21 nia Exp $
+
+Avoid colliding with NetBSD libc functions.
+
+--- src/quickjs/cutils.h.orig 2020-09-10 16:38:49.000000000 +0000
++++ src/quickjs/cutils.h
+@@ -266,6 +266,9 @@ static inline void put_u8(uint8_t *tab,
+ *tab = val;
+ }
+
++#ifdef __NetBSD__
++#include <sys/endian.h>
++#else
+ static inline uint16_t bswap16(uint16_t x)
+ {
+ return (x >> 8) | (x << 8);
+@@ -288,6 +291,7 @@ static inline uint64_t bswap64(uint64_t
+ ((v & ((uint64_t)0xff << (1 * 8))) << (5 * 8)) |
+ ((v & ((uint64_t)0xff << (0 * 8))) << (7 * 8));
+ }
++#endif
+
+ /* XXX: should take an extra argument to pass slack information to the caller */
+ typedef void *DynBufReallocFunc(void *opaque, void *ptr, size_t size);
diff --git a/multimedia/gpac/patches/patch-src_quickjs_quickjs.c b/multimedia/gpac/patches/patch-src_quickjs_quickjs.c
new file mode 100644
index 00000000000..79a1883b216
--- /dev/null
+++ b/multimedia/gpac/patches/patch-src_quickjs_quickjs.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_quickjs_quickjs.c,v 1.1 2021/09/17 00:10:21 nia Exp $
+
+Add support for NetBSD.
+
+--- src/quickjs/quickjs.c.orig 2020-09-10 16:38:49.000000000 +0000
++++ src/quickjs/quickjs.c
+@@ -36,7 +36,7 @@
+ #include <math.h>
+ #if defined(__APPLE__)
+ #include <malloc/malloc.h>
+-#elif defined(__linux__) || defined(__NX__)
++#elif defined(__linux__) || defined(__NX__) || defined(__NetBSD__)
+ #include <malloc.h>
+ #endif
+
diff --git a/multimedia/gpac/patches/patch-src_utils_Remotery.c b/multimedia/gpac/patches/patch-src_utils_Remotery.c
new file mode 100644
index 00000000000..3d57abdb54e
--- /dev/null
+++ b/multimedia/gpac/patches/patch-src_utils_Remotery.c
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_utils_Remotery.c,v 1.1 2021/09/17 00:10:21 nia Exp $
+
+Add support for NetBSD.
+
+--- src/utils/Remotery.c.orig 2020-09-10 16:38:49.000000000 +0000
++++ src/utils/Remotery.c
+@@ -114,7 +114,7 @@ static rmtBool g_SettingsInitialized = R
+ #include <time.h>
+ #if defined(__FreeBSD__) || defined(__OpenBSD__)
+ #include <pthread_np.h>
+- #else
++ #elif !defined(__NetBSD__)
+ #include <sys/prctl.h>
+ #endif
+ #endif
+@@ -5269,6 +5269,8 @@ static void SetDebuggerThreadName(const
+ strncat_s(name_clamp, sizeof(name_clamp), name, 15);
+ #if defined(__FreeBSD__) || defined(__OpenBSD__)
+ pthread_set_name_np(pthread_self(), name_clamp);
++ #elif defined(__NetBSD__)
++ pthread_setname_np(pthread_self(), "%s", name_clamp);
+ #else
+ prctl(PR_SET_NAME,name_clamp,0,0,0);
+ #endif
diff --git a/multimedia/gpac/patches/patch-src_utils_os__config__init.c b/multimedia/gpac/patches/patch-src_utils_os__config__init.c
new file mode 100644
index 00000000000..612413a0e42
--- /dev/null
+++ b/multimedia/gpac/patches/patch-src_utils_os__config__init.c
@@ -0,0 +1,44 @@
+$NetBSD: patch-src_utils_os__config__init.c,v 1.1 2021/09/17 00:10:21 nia Exp $
+
+Support NetBSD.
+
+--- src/utils/os_config_init.c.orig 2020-09-10 16:38:49.000000000 +0000
++++ src/utils/os_config_init.c
+@@ -71,6 +71,10 @@
+ #define TEST_MODULE "gm_"
+ #endif
+
++#if defined(__NetBSD__)
++#include <sys/sysctl.h>
++#endif
++
+ #endif
+
+ #if !defined(GPAC_STATIC_MODULES) && !defined(GPAC_MP4BOX_MINI)
+@@ -295,6 +299,10 @@ static Bool get_default_install_path(cha
+ #if (defined(__DARWIN__) || defined(__APPLE__) || defined(GPAC_CONFIG_LINUX))
+ u32 size;
+ #endif
++#if defined(__NetBSD__)
++ int mib[] = { CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME };
++ size_t size;
++#endif
+
+ /*on OSX, Linux & co, user home is where we store the cfg file*/
+ if (path_type==GF_PATH_CFG) {
+@@ -342,6 +350,15 @@ static Bool get_default_install_path(cha
+ return 1;
+ }
+
++#elif defined(__NetBSD__)
++ size = sizeof(app_path);
++ if (sysctl(mib, 4, app_path, &size, NULL, 0) != -1) {
++ realpath(app_path, file_path);
++ sep = strrchr(file_path, '/');
++ if (sep) sep[0] = 0;
++ return 1;
++ }
++
+ #elif defined(GPAC_CONFIG_LINUX)
+ size = readlink("/proc/self/exe", file_path, GF_MAX_PATH-1);
+ if (size>0) {