summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--media-video/gpac/Manifest1
-rw-r--r--media-video/gpac/files/gpac-2.0.0-configure.patch113
-rw-r--r--media-video/gpac/gpac-2.0.0.ebuild154
-rw-r--r--media-video/gpac/gpac-9999.ebuild6
4 files changed, 271 insertions, 3 deletions
diff --git a/media-video/gpac/Manifest b/media-video/gpac/Manifest
index 3119d5d920e5..84cbbe3a0255 100644
--- a/media-video/gpac/Manifest
+++ b/media-video/gpac/Manifest
@@ -1 +1,2 @@
DIST gpac-1.0.1.tar.gz 10352926 BLAKE2B 80bdbd568551f9028a44acfa0cfeba585b69f24392393c1fb1bfe16f4b614eb79cda5f641f0b61854734f0dd85eb17520c2012040d3c47d68f66e5beb66fb2db SHA512 533371d59e72250bef315be03ec3437cd66782d0fb6bdb6486a6f4d57d06a6a7deff1b31fe8bfd360be1d1c848b33b5d25e7268f56f27f8e92cbcb7da1aba82b
+DIST gpac-2.0.0.tar.gz 11362932 BLAKE2B a8489831efb77c374d13e2edb3951e60a94907c4cd8601919e1390aee0e9002249e97a9200fd006c2aa783c516f701f7695aa84b5f3596a3bc90290916ff4086 SHA512 e95e6d78167fc306917b3ac89e56ba511bbcb0c825da118f5ba374504499352104b5c1f3ee71e7ec018015b8e302f9b07162d22287ddb21c8564b097d900913f
diff --git a/media-video/gpac/files/gpac-2.0.0-configure.patch b/media-video/gpac/files/gpac-2.0.0-configure.patch
new file mode 100644
index 000000000000..2b54d16a8d22
--- /dev/null
+++ b/media-video/gpac/files/gpac-2.0.0-configure.patch
@@ -0,0 +1,113 @@
+* Makes static libs optional
+* Removes auto-SSE2 detection
+----
+Index: gpac-2.0.0/Makefile
+===================================================================
+--- gpac-2.0.0.orig/Makefile
++++ gpac-2.0.0/Makefile
+@@ -298,8 +298,9 @@ ifeq ($(GPAC_ENST),yes)
+ endif
+
+ $(INSTALL) -d "$(DESTDIR)$(prefix)/$(lib_dir)"
++ifeq ($(STATIC_LIBS), yes)
+ $(INSTALL) $(INSTFLAGS) -m 644 "./bin/gcc/libgpac_static.a" "$(DESTDIR)$(prefix)/$(lib_dir)" || true
+-
++endif
+ $(INSTALL) -d $(DESTDIR)$(prefix)/$(lib_dir)/pkgconfig
+ $(INSTALL) $(INSTFLAGS) -m 644 gpac.pc "$(DESTDIR)$(prefix)/$(lib_dir)/pkgconfig"
+
+Index: gpac-2.0.0/configure
+===================================================================
+--- gpac-2.0.0.orig/configure
++++ gpac-2.0.0/configure
+@@ -106,6 +106,7 @@ has_dvb4linux="no"
+ has_openjpeg="no"
+ gprof_build="no"
+ static_build="no"
++static_libs="no"
+ want_pic="no"
+ want_gcov="no"
+ has_joystick="no"
+@@ -271,6 +272,7 @@ GPAC configuration options:
+ --static-modules use static modules in libgpac rather than dynamic library modules
+ --static-build link statically against libgpac but still allow dependencies to shared libraries (enable --static-modules)
+ --enable-static-bin old name for --static-build, deprecated
++ --enable-static-lib GPAC static libraries build
+ --static-bin enable static linking of MP4Box and gpac only (enable --static-build), disable MP4Client and all libraries not linkable statically.
+ --static-mp4box old name for --static-bin, deprecated
+ --enable-depth enables depth handling in the compositor
+@@ -741,14 +743,6 @@ if docc -lz -Wno-pointer-sign ; then
+ fi
+
+
+-#GCC opt
+-if test "$no_gcc_opt" = "no"; then
+- CFLAGS="-O3 $CFLAGS"
+-else
+- CFLAGS="-O0 $CFLAGS"
+-fi
+-
+-
+ #GCC PIC
+ if test "$cross_prefix" != "" ; then
+ want_pic="no"
+@@ -776,10 +770,6 @@ cat > $TMPC << EOF
+ int main( void ) { return 0; }
+ EOF
+
+-if docc -msse2 $LDFLAGS ; then
+- CFLAGS="$CFLAGS -msse2"
+-fi
+-
+
+ #look for zlib
+ cat > $TMPC << EOF
+@@ -1790,6 +1780,8 @@ for opt do
+ echo "$opt deprecated, use --static-build instead"
+ static_build="yes";
+ ;;
++ --enable-static-libs) static_libs="yes";
++ ;;
+ --disable-ipv6) has_ipv6="no"
+ ;;
+ --disable-platinum) has_platinum="no"
+@@ -2521,6 +2513,7 @@ else
+ fi
+ echo "debug version: $debuginfo"
+ echo "GProf enabled: $gprof_build"
++echo "Static libs enabled: $static_libs"
+ echo "Memory tracking enabled: $use_memory_tracking"
+ echo "Sanitizer enabled: $enable_sanitizer"
+ echo "Fixed-Point Version: $use_fixed_point"
+@@ -3252,6 +3245,7 @@ echo "DEBUGBUILD=$debuginfo" >> config.m
+ echo "GPROFBUILD=$gprof_build" >> config.mak
+ echo "STATIC_BINARY=$static_bin" >> config.mak
+ echo "STATICBUILD=$static_build" >> config.mak
++echo "STATICLIBS=$static_libs" >> config.mak
+
+ echo "CONFIG_IPV6=$has_ipv6" >> config.mak
+ if test "$has_ipv6" = "yes" ; then
+Index: gpac-2.0.0/src/Makefile
+===================================================================
+--- gpac-2.0.0.orig/src/Makefile
++++ gpac-2.0.0/src/Makefile
+@@ -387,7 +387,6 @@ jsmods: $(LIBGPAC_JSMODS)
+ # @echo "LIBS $(EXTRALIBS)"
+
+ ifeq ($(CONFIG_DARWIN),yes)
+-
+ $(LIBTOOL) -s -o ../bin/gcc/libgpac_static.a $(OBJS)
+ $(RANLIB) ../bin/gcc/libgpac_static.a
+ ifneq ($(STATICBUILD),yes)
+@@ -395,9 +394,10 @@ ifneq ($(STATICBUILD),yes)
+ endif
+
+ else
+-
++ifeq ($(STATICLIBS), yes)
+ $(AR) cr ../bin/gcc/libgpac_static.a $(OBJS)
+ $(RANLIB) ../bin/gcc/libgpac_static.a
++endif
+ ifneq ($(STATICBUILD),yes)
+ $(CC) $(SHFLAGS) $(LD_SONAME) -o $@ $(OBJS) $(EXTRALIBS) $(LDFLAGS)
+ mv $@ $@.$(VERSION_SONAME)
diff --git a/media-video/gpac/gpac-2.0.0.ebuild b/media-video/gpac/gpac-2.0.0.ebuild
new file mode 100644
index 000000000000..1c87f44bd3fe
--- /dev/null
+++ b/media-video/gpac/gpac-2.0.0.ebuild
@@ -0,0 +1,154 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+if [[ ${PV} == *9999 ]] ; then
+ SCM="git-r3"
+ EGIT_REPO_URI="https://github.com/gpac/gpac"
+else
+ SRC_URI="https://github.com/gpac/gpac/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
+fi
+
+inherit flag-o-matic toolchain-funcs ${SCM} xdg
+
+DESCRIPTION="Implementation of the MPEG-4 Systems standard developed from scratch in ANSI C"
+HOMEPAGE="https://gpac.wp.imt.fr/"
+
+LICENSE="GPL-2"
+# subslot == libgpac major
+SLOT="0/11"
+IUSE="a52 aac alsa cpu_flags_x86_sse2 debug dvb ffmpeg ipv6 jack jpeg jpeg2k mad opengl oss png
+ pulseaudio sdl ssl static-libs theora truetype vorbis xml xvid X"
+
+BDEPEND="virtual/pkgconfig"
+RDEPEND="
+ media-libs/libogg
+ sys-libs/zlib
+ a52? ( media-libs/a52dec )
+ aac? ( media-libs/faad2 )
+ alsa? ( media-libs/alsa-lib )
+ ffmpeg? ( media-video/ffmpeg:0= )
+ jack? ( virtual/jack )
+ jpeg? ( virtual/jpeg:0 )
+ jpeg2k? ( media-libs/openjpeg:2 )
+ mad? ( media-libs/libmad )
+ opengl? (
+ media-libs/freeglut
+ virtual/glu
+ virtual/opengl
+ )
+ png? ( media-libs/libpng:0= )
+ pulseaudio? ( media-sound/pulseaudio )
+ theora? ( media-libs/libtheora )
+ truetype? ( media-libs/freetype:2 )
+ sdl? ( media-libs/libsdl )
+ ssl? (
+ dev-libs/openssl:0=
+ )
+ vorbis? ( media-libs/libvorbis )
+ X? (
+ x11-libs/libXt
+ x11-libs/libX11
+ x11-libs/libXv
+ x11-libs/libXext
+ )
+ xml? ( dev-libs/libxml2:2= )
+ xvid? ( media-libs/xvid )
+"
+DEPEND="
+ ${RDEPEND}
+ dvb? ( sys-kernel/linux-headers )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.0.0-configure.patch"
+ "${FILESDIR}/${PN}-1.0.0-zlib-compile.patch"
+)
+
+DOCS=(
+ share/doc/CODING_STYLE
+ share/doc/GPAC\ UPnP.doc
+ share/doc/ISO\ 639-2\ codes.txt
+ share/doc/SceneGenerators
+ share/doc/ipmpx_syntax.bt
+ Changelog
+ README.md
+)
+
+HTML_DOCS="share/doc/*.html"
+
+my_use() {
+ local flag="$1" pflag="${2:-$1}"
+ if use ${flag}; then
+ echo "--use-${pflag}=system"
+ else
+ echo "--use-${pflag}=no"
+ fi
+}
+
+src_prepare() {
+ default
+ sed -i -e "s:\(--disable-.*\)=\*):\1):" configure || die
+}
+
+src_configure() {
+ tc-export CC CXX AR RANLIB
+
+ local myeconfargs=(
+ --cc="$(tc-getCC)"
+ --libdir="$(get_libdir)"
+ --verbose
+ --enable-pic
+ --enable-svg
+ --disable-amr
+ --use-js=no
+ --use-ogg=system
+ $(use_enable alsa)
+ $(use_enable debug)
+ $(use_enable dvb dvb4linux)
+ $(use_enable ipv6)
+ $(use_enable jack jack yes)
+ $(use_enable opengl 3d)
+ $(use_enable oss oss-audio)
+ $(use_enable pulseaudio pulseaudio yes)
+ $(use_enable sdl)
+ $(use_enable ssl)
+ $(use_enable static-libs static-lib)
+ $(use_enable X x11)
+ $(use_enable X x11-shm)
+ $(use_enable X x11-xv)
+ $(my_use a52)
+ $(my_use aac faad)
+ $(my_use dvb dvbx)
+ $(my_use ffmpeg)
+ $(my_use jpeg)
+ $(my_use jpeg2k openjpeg)
+ $(my_use mad)
+ $(my_use png)
+ $(my_use theora)
+ $(my_use truetype ft)
+ $(my_use vorbis)
+ $(my_use xvid)
+ )
+
+ if use amd64 || use x86 ; then
+ # Don't pass -mno-sse2 on non amd64/x86
+ myeconfargs+=(
+ --extra-cflags="${CFLAGS} $(usex cpu_flags_x86_sse2 '-msse2' '-mno-sse2')"
+ )
+ else
+ myeconfargs+=(
+ --extra-cflags="${CFLAGS}"
+ )
+ fi
+
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ einstalldocs
+ emake STRIP="true" DESTDIR="${ED}" install
+ emake STRIP="true" DESTDIR="${ED}" install-lib
+}
diff --git a/media-video/gpac/gpac-9999.ebuild b/media-video/gpac/gpac-9999.ebuild
index e1c72932c19e..1c87f44bd3fe 100644
--- a/media-video/gpac/gpac-9999.ebuild
+++ b/media-video/gpac/gpac-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -18,7 +18,7 @@ HOMEPAGE="https://gpac.wp.imt.fr/"
LICENSE="GPL-2"
# subslot == libgpac major
-SLOT="0/10"
+SLOT="0/11"
IUSE="a52 aac alsa cpu_flags_x86_sse2 debug dvb ffmpeg ipv6 jack jpeg jpeg2k mad opengl oss png
pulseaudio sdl ssl static-libs theora truetype vorbis xml xvid X"
@@ -63,7 +63,7 @@ DEPEND="
"
PATCHES=(
- "${FILESDIR}/${PN}-1.0.1-configure.patch"
+ "${FILESDIR}/${PN}-2.0.0-configure.patch"
"${FILESDIR}/${PN}-1.0.0-zlib-compile.patch"
)