From d1dff550bc76b8ab2eb172fb356ef30ed140f8db Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Tue, 27 Jun 2023 10:15:07 +0200 Subject: [PATCH] package/macos: add an option to select the (lib)VLC license Some contribs may be disabled depending on the license chosen. By default we build with GPLv3 compatibility. libvlc-only builds may want to restrict to LGPL v3 with ad-clause or LGPL v2.1 with ad-clause. faad is automatically picked when building for GPL and not picked otherwise. We should never force it. --- extras/package/macosx/build.sh | 25 ++++++++++++++++++++++++- extras/package/macosx/configure.sh | 1 - 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/extras/package/macosx/build.sh b/extras/package/macosx/build.sh index a493c25fd4..f806922390 100755 --- a/extras/package/macosx/build.sh +++ b/extras/package/macosx/build.sh @@ -40,6 +40,10 @@ OPTIONS: -C Use the specified VLC build dir -b Enable breakpad support and send crash reports to this URL -d Disable debug mode (on by default) + -g Select the license of contribs + g: GPLv3 (default) + l: LGPLv3 + ad-clauses + a: LGPLv2 + ad-clauses EOF } @@ -54,7 +58,7 @@ spopd() popd > /dev/null } -while getopts "qhvrcdpi:k:a:j:C:b:" OPTION +while getopts "qhvrcdpi:k:a:j:C:b:g:" OPTION do case $OPTION in h) @@ -95,6 +99,9 @@ do b) BREAKPAD=$OPTARG ;; + g) + LICENSE=$OPTARG + ;; *) usage exit 1 @@ -161,6 +168,22 @@ vlcSetContribEnvironment "$MINIMAL_OSX_VERSION" info "Building contribs" spushd "${vlcroot}/contrib" +case $LICENSE in + l) + # LGPL v3 + ad-clauses + CONTRIBFLAGS="$CONTRIBFLAGS --disable-gpl --enable-ad-clauses" + VLC_CONFIGURE_ARGS="$VLC_CONFIGURE_ARGS --disable-a52" + ;; + a) + # LGPL v2.1 + ad-clauses + CONTRIBFLAGS="$CONTRIBFLAGS --disable-gpl --disable-gnuv3 --enable-ad-clauses" + VLC_CONFIGURE_ARGS="$VLC_CONFIGURE_ARGS --disable-a52" + ;; + g|*) + # GPL v3 + ;; +esac + if [ "$REBUILD" = "yes" ]; then rm -rf contrib-$HOST_TRIPLET rm -rf $HOST_TRIPLET diff --git a/extras/package/macosx/configure.sh b/extras/package/macosx/configure.sh index 7c45417689..8c7cd19667 100755 --- a/extras/package/macosx/configure.sh +++ b/extras/package/macosx/configure.sh @@ -11,7 +11,6 @@ OPTIONS=" --enable-macosx --enable-merge-ffmpeg --enable-osx-notifications - --enable-faad --enable-flac --enable-theora --enable-shout