Bug 131681 - Add OPTIONS framework to multimedia/gpac-libgpac
Summary: Add OPTIONS framework to multimedia/gpac-libgpac
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Li-Wen Hsu
Depends on:
Reported: 2009-02-14 20:10 UTC by josh.carroll
Modified: 2009-02-27 11:10 UTC (History)
0 users

See Also:

file.diff (986 bytes, patch)
2009-02-14 20:10 UTC, josh.carroll
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description josh.carroll 2009-02-14 20:10:00 UTC
I wanted to disable IPv6 and OpenGL support for the gpac-libgpac port, but there were no existing knobs.

So I added OPTIONS support to this port and added two configurable options to enable/disable IPV6 and OpenGL. Both default to "on" and thus the port should build by default with the same options as before.

I also made a minor change to the CONFIGURE_ARGS to add --enable-pic rather than manually adding -fPIC to the --extra-ldflags option.

Below is the plain text of the patch (in case the attachment does not work - I seem to have problems attaching patches to PRs - user error, I know).


Fix: diff -urN gpac-libgpac.old/Makefile gpac-libgpac/Makefile
--- gpac-libgpac.old/Makefile   2009-02-14 13:52:47.000000000 -0500
+++ gpac-libgpac/Makefile       2009-02-14 14:54:56.000000000 -0500
@@ -27,9 +27,22 @@
 LIBVER=        1

 CONFIGURE_ARGS=        --cc="${CC}" \
-               --extra-cflags="${CFLAGS} ${PTHREAD_CFLAGS} -fPIC" \
-               --extra-ldflags="${LDFLAGS} ${PTHREAD_LIBS}" \
-               --disable-opengl
+                               --enable-pic \
+                               --extra-cflags="${CFLAGS} ${PTHREAD_CFLAGS}" \
+                               --extra-ldflags="${LDFLAGS} ${PTHREAD_LIBS}"
+OPTIONS=       OPENGL  "OpenGL support" on \
+                       IPV6    "IPv6 support" on
+.include <bsd.port.pre.mk>
+.if defined(WITHOUT_OPENGL)
+CONFIGURE_ARGS+=       --disable-opengl
+.if defined(WITHOUT_IPV6)
+CONFIGURE_ARGS+=       --disable-ipv6

        ${CHMOD} +x ${WRKSRC}/configure
@@ -42,4 +55,4 @@
        ${LN} -sf libgpac.so.${LIBVER} ${PREFIX}/lib/libgpac.so
        ${INSTALL_DATA} ${INSTALL_WRKSRC}/libgpac_static.a ${PREFIX}/lib

-.include <bsd.port.mk>
+.include <bsd.port.post.mk>

Patch attached with submission follows:
How-To-Repeat: n/a
Comment 1 josh.carroll 2009-02-14 20:43:52 UTC
Here is an updated patch which adds a LIB_DEPEND for the libGL port if
the OPENGL option is selected (which is the default).


--- Makefile.orig	2009-02-13 20:55:45.000000000 -0500
+++ Makefile	2009-02-14 15:41:15.000000000 -0500
@@ -27,9 +27,25 @@

 CONFIGURE_ARGS=	--cc="${CC}" \
-		--extra-cflags="${CFLAGS} ${PTHREAD_CFLAGS} -fPIC" \
+		--enable-pic \
+		--extra-cflags="${CFLAGS} ${PTHREAD_CFLAGS}" \
 		--extra-ldflags="${LDFLAGS} ${PTHREAD_LIBS}"

+OPTIONS=	OPENGL	"OpenGL support" on \
+			IPV6	"IPv6 support" on
+.include <bsd.port.pre.mk>
+.if defined(WITHOUT_OPENGL)
+CONFIGURE_ARGS+=	--disable-opengl
+LIB_DEPENDS+=	GL.1:${PORTSDIR}/graphics/libGL
+.if defined(WITHOUT_IPV6)
+CONFIGURE_ARGS+=	--disable-ipv6
 	${CHMOD} +x ${WRKSRC}/configure

@@ -41,4 +57,4 @@
 	${LN} -sf libgpac.so.${LIBVER} ${PREFIX}/lib/libgpac.so
 	${INSTALL_DATA} ${INSTALL_WRKSRC}/libgpac_static.a ${PREFIX}/lib

-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2009-02-15 21:05:36 UTC
Responsible Changed
From-To: freebsd-ports-bugs->freebsd-multimedia

Fix synopsis and assign.
Comment 3 Li-Wen Hsu freebsd_committer 2009-02-15 23:14:44 UTC
Responsible Changed
From-To: freebsd-multimedia->lwhsu

I'll take it.
Comment 4 dfilter service freebsd_committer 2009-02-19 23:21:12 UTC
jkim        2009-02-19 23:20:57 UTC

  FreeBSD ports repository

  Modified files:
    multimedia/gpac-libgpac Makefile 
  Added files:
    multimedia/gpac-libgpac/files patch-configure 
  Removed files:
    multimedia/gpac-libgpac/files patch-src_Makefile 
  - Make IPv6 and OpenGL optional but turn them on by default[1].
  - Fix build with OpenGL and register its dependency when it is enabled.
  - Move FreeBSD-specific stuff into configure script from src/Makefile.
  - Make portlint happy with PKGNAMESUFFIX.
  PR:     ports/131681[1], ports/131713, ports/131789
  Revision  Changes    Path
  1.17      +23 -8     ports/multimedia/gpac-libgpac/Makefile
  1.1       +66 -0     ports/multimedia/gpac-libgpac/files/patch-configure (new)
  1.3       +0 -19     ports/multimedia/gpac-libgpac/files/patch-src_Makefile (dead)
cvs-all@freebsd.org mailing list
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 Li-Wen Hsu freebsd_committer 2009-02-27 11:10:05 UTC
State Changed
From-To: open->closed

jkim Committed. Thanks!