pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/multimedia/gpac gpac: Fix building on notdarwin.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ade62c3e6581
branches:  trunk
changeset: 458491:ade62c3e6581
user:      nia <nia%pkgsrc.org@localhost>
date:      Fri Sep 17 00:10:21 2021 +0000

description:
gpac: Fix building on notdarwin.

diffstat:

 multimedia/gpac/Makefile                                   |  21 ++---
 multimedia/gpac/PLIST                                      |  15 +++-
 multimedia/gpac/distinfo                                   |   9 ++-
 multimedia/gpac/options.mk                                 |  42 ++++++++++++-
 multimedia/gpac/patches/patch-Makefile                     |  21 +++++-
 multimedia/gpac/patches/patch-include_gpac_Remotery.h      |  15 ++++
 multimedia/gpac/patches/patch-src_quickjs_cutils.h         |  24 +++++++
 multimedia/gpac/patches/patch-src_quickjs_quickjs.c        |  15 ++++
 multimedia/gpac/patches/patch-src_utils_Remotery.c         |  24 +++++++
 multimedia/gpac/patches/patch-src_utils_os__config__init.c |  44 ++++++++++++++
 10 files changed, 204 insertions(+), 26 deletions(-)

diffs (truncated from 354 to 300 lines):

diff -r baf7d69aa562 -r ade62c3e6581 multimedia/gpac/Makefile
--- a/multimedia/gpac/Makefile  Thu Sep 16 23:48:02 2021 +0000
+++ b/multimedia/gpac/Makefile  Fri Sep 17 00:10:21 2021 +0000
@@ -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-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 @@
 
 .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 -r baf7d69aa562 -r ade62c3e6581 multimedia/gpac/PLIST
--- a/multimedia/gpac/PLIST     Thu Sep 16 23:48:02 2021 +0000
+++ b/multimedia/gpac/PLIST     Fri Sep 17 00:10:21 2021 +0000
@@ -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/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.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/webvtt-renderer.js
 share/gpac/shaders/fragment.glsl
 share/gpac/shaders/vertex.glsl
+share/pixmaps/gpac.png
diff -r baf7d69aa562 -r ade62c3e6581 multimedia/gpac/distinfo
--- a/multimedia/gpac/distinfo  Thu Sep 16 23:48:02 2021 +0000
+++ b/multimedia/gpac/distinfo  Fri Sep 17 00:10:21 2021 +0000
@@ -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 -r baf7d69aa562 -r ade62c3e6581 multimedia/gpac/options.mk
--- a/multimedia/gpac/options.mk        Thu Sep 16 23:48:02 2021 +0000
+++ b/multimedia/gpac/options.mk        Fri Sep 17 00:10:21 2021 +0000
@@ -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=         alsa jack pulseaudio x11
 
-PKG_OPTIONS_VAR=       PKG_OPTIONS.gpac
-PKG_SUPPORTED_OPTIONS= x11
-PKG_SUGGESTED_OPTIONS= 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 -r baf7d69aa562 -r ade62c3e6581 multimedia/gpac/patches/patch-Makefile
--- a/multimedia/gpac/patches/patch-Makefile    Thu Sep 16 23:48:02 2021 +0000
+++ b/multimedia/gpac/patches/patch-Makefile    Fri Sep 17 00:10:21 2021 +0000
@@ -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 -r baf7d69aa562 -r ade62c3e6581 multimedia/gpac/patches/patch-include_gpac_Remotery.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/gpac/patches/patch-include_gpac_Remotery.h     Fri Sep 17 00:10:21 2021 +0000
@@ -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 -r baf7d69aa562 -r ade62c3e6581 multimedia/gpac/patches/patch-src_quickjs_cutils.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/gpac/patches/patch-src_quickjs_cutils.h        Fri Sep 17 00:10:21 2021 +0000
@@ -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 -r baf7d69aa562 -r ade62c3e6581 multimedia/gpac/patches/patch-src_quickjs_quickjs.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/gpac/patches/patch-src_quickjs_quickjs.c       Fri Sep 17 00:10:21 2021 +0000
@@ -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 -r baf7d69aa562 -r ade62c3e6581 multimedia/gpac/patches/patch-src_utils_Remotery.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/gpac/patches/patch-src_utils_Remotery.c        Fri Sep 17 00:10:21 2021 +0000
@@ -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__)



Home | Main Index | Thread Index | Old Index