summaryrefslogtreecommitdiffstats
path: root/vlc/build
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2007-09-05 13:10:47 +0000
committer Eric Hameleers <alien@slackware.com>2007-09-05 13:10:47 +0000
commit9c2b2392abbcddc2a991a9fa180d0b3ded491ed9 (patch)
tree14dc1775eb01d1f0b24dfbf13f2f9673cd0794c6 /vlc/build
parent4cc34fcd2696b66fe53416177a63dec9becc32eb (diff)
downloadasb-9c2b2392abbcddc2a991a9fa180d0b3ded491ed9.tar.gz
asb-9c2b2392abbcddc2a991a9fa180d0b3ded491ed9.tar.xz
Allow building without lame/AMR patented code
Diffstat (limited to 'vlc/build')
-rwxr-xr-xvlc/build/vlc-1.0.SlackBuild128
1 files changed, 90 insertions, 38 deletions
diff --git a/vlc/build/vlc-1.0.SlackBuild b/vlc/build/vlc-1.0.SlackBuild
index 3a0e953b..2722111c 100755
--- a/vlc/build/vlc-1.0.SlackBuild
+++ b/vlc/build/vlc-1.0.SlackBuild
@@ -34,7 +34,7 @@
# 0.8.6b-1: 25/apr/2007 by Eric Hameleers <alien@slackware.com>
# * Update.
# 0.8.6c-1: 04/sep/2007 by Eric Hameleers <alien@slackware.com>
-# * Update.
+# * Update. Allow vlc to be built without patented code (lame/amr).
#
# Run 'sh vlc.SlackBuild --cleanup' to build a Slackware package.
# The package (.tgz) plus descriptive .txt file are created in /tmp .
@@ -53,6 +53,28 @@
# /Eric Hameleers/
#
+# -- PATENT ALERT! --
+# FFmpeg can be built with MP3 (lame) and AMR audio encoders
+# (needed for FLV videos) but these libraries are 'contaminated' with
+# patents from Fraunhofer and GGP.
+# You can build these patended algorithms into ffmpeg, and if you are an
+# ordinary end user, no one will bother you for using them.
+# For the binaries based on this SlackBuild that I distribute, it is a
+# different story. I am not allowed to distribute binary packages that
+# incorporate patented code. So here you go. My Slackware package was built
+# with "USE_PATENTS=NO" i.e. without using the lame mp3 libary and without the
+# AMR libraries.
+#USE_PATENTS="NO"
+USE_PATENTS=${USE_PATENTS:-"YES"}
+
+if [ "${USE_PATENTS}" == "YES" ]; then
+ echo ""
+ echo "**"
+ echo "** This build uses patented code (MP3 / AMR encoders)"
+ echo "**"
+ echo ""
+fi
+
# Set initial variables:
PRGNAM=vlc
@@ -142,13 +164,16 @@ SRCURL[1]="http://ffmpeg.mplayerhq.hu/ffmpeg-export-snapshot.tar.bz2"
# AMR encoder libraries used in ffmpeg to generate FLV (Flash Video)
SOURCE[2]="$SRCDIR/${AMRWB_FLOAT}.zip"
SRCURL[2]="http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/${AMRWB_FLOAT}.zip"
+SRCPAT[2]="YES"
SOURCE[3]="$SRCDIR/${AMR_FLOAT}.zip"
SRCURL[3]="http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/${AMR_FLOAT}.zip"
+SRCPAT[3]="YES"
# Lame is used for the audio in FLV videos; will statically link with ffmpeg
SOURCE[4]="$SRCDIR/lame-$LAME.tar.gz"
SRCURL[4]="http://dl.sourceforge.net/lame/lame-$LAME.tar.gz"
+SRCPAT[4]="YES"
# XVIDcore library, will be statically linked against with ffmpeg
SOURCE[5]="$SRCDIR/xvidcore-$XVID.tar.gz"
@@ -242,8 +267,10 @@ SRCURL[26]="http://www.ggi-project.org/ftp/ggi/v2.2/ggi-${GGI}-bundle.src.tar.bz
SOURCE[27]="$SRCDIR/x264-snapshot-${X264}.tar.bz2"
SRCURL[27]="ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264}.tar.bz2"
-#"$SRCDIR/libdvdcss-${DVDCSS}.tar.bz2"
-#"http://download.videolan.org/pub/libdvdcss/${DVDCSS}/libdvdcss-${DVDCSS}.tar.bz2"
+# CSS decoding - VLC can do without if you install an external libdvdcss package.
+#SOURCE[XX]="$SRCDIR/libdvdcss-${DVDCSS}.tar.bz2"
+#SRCURL[XX]="http://download.videolan.org/pub/libdvdcss/${DVDCSS}/libdvdcss-${DVDCSS}.tar.bz2"
+#SRCPAT[XX]="YES"
##
@@ -309,21 +336,24 @@ fi
# --- SOURCE FILE AVAILABILITY ---
for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do
- if ! [ -f ${SOURCE[$i]} ]; then
- if ! [ "x${SRCURL[$i]}" == "x" ]; then
- # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
- [ -w "$SRCDIR" ] || SOURCE[$i]="$OUTPUT/`basename ${SOURCE[$i]}`"
- echo "Source '`basename ${SOURCE[$i]}`' not available yet..."
- echo "Will download file to `dirname $SOURCE[$i]`"
- wget -nv --connect-timeout=20 -O "${SOURCE[$i]}" "${SRCURL[$i]}" || true
- if [ $? -ne 0 -o ! -s "${SOURCE[$i]}" ]; then
- echo "Downloading '`basename ${SOURCE[$i]}`' failed.. aborting the build."
- mv -f "${SOURCE[$i]}" "${SOURCE[$i]}".FAIL
+ # Only download patented code if we are allowing it:
+ if [ "${USE_PATENTS}" == "YES" -o "${SRCPAT[$i]}" != "YES" ]; then
+ if ! [ -f ${SOURCE[$i]} ]; then
+ if ! [ "x${SRCURL[$i]}" == "x" ]; then
+ # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
+ [ -w "$SRCDIR" ] || SOURCE[$i]="$OUTPUT/`basename ${SOURCE[$i]}`"
+ echo "Source '`basename ${SOURCE[$i]}`' not available yet..."
+ echo "Will download file to `dirname $SOURCE[$i]`"
+ wget -nv --connect-timeout=20 -O "${SOURCE[$i]}" "${SRCURL[$i]}" || true
+ if [ $? -ne 0 -o ! -s "${SOURCE[$i]}" ]; then
+ echo "Downloading '`basename ${SOURCE[$i]}`' failed.. aborting the build."
+ mv -f "${SOURCE[$i]}" "${SOURCE[$i]}".FAIL
+ exit 1
+ fi
+ else
+ echo "File '`basename ${SOURCE[$i]}`' not available.. aborting the build."
exit 1
fi
- else
- echo "File '`basename ${SOURCE[$i]}`' not available.. aborting the build."
- exit 1
fi
fi
done
@@ -343,12 +373,15 @@ cd $TMP/tmp-$PRGNAM
if [ "$P1" != "--oldbuild" ]; then
echo "Extracting the source archive(s) for $PRGNAM..."
for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do
- if `file ${SOURCE[$i]} | grep -q ": bzip2"`; then
- tar -xjvf ${SOURCE[$i]}
- elif `file ${SOURCE[$i]} | grep -q ": gzip"`; then
- tar -xzvf ${SOURCE[$i]}
- elif `file ${SOURCE[$i]} | grep -iq ": zip"`; then
- unzip ${SOURCE[$i]}
+ # Only download patented code if we are allowing it:
+ if [ "${USE_PATENTS}" == "YES" -o "${SRCPAT[$i]}" != "YES" ]; then
+ if `file ${SOURCE[$i]} | grep -q ": bzip2"`; then
+ tar -xjvf ${SOURCE[$i]}
+ elif `file ${SOURCE[$i]} | grep -q ": gzip"`; then
+ tar -xzvf ${SOURCE[$i]}
+ elif `file ${SOURCE[$i]} | grep -iq ": zip"`; then
+ unzip ${SOURCE[$i]}
+ fi
fi
done
chown -R root:root *
@@ -456,30 +489,37 @@ if [ -d ffmpeg-export-* ]; then
mv ffmpeg-export-* ffmpeg-${FFMPEG}
fi
cd ffmpeg-${FFMPEG}/libavcodec
-# for --enable-amr
-mkdir -p amr_float
-unzip ../../${AMR_FLOAT}_ANSI_C_source_code.zip -d amr_float
-# for --enable-amr_wb # --enable-amr_if2
-mkdir -p amrwb_float
-unzip ../../${AMRWB_FLOAT}_ANSI-C_source_code.zip -d amrwb_float
+# Only use patented code if we are allowing it:
+if [ "${USE_PATENTS}" == "YES" -o "${SRCPAT[$i]}" != "YES" ]; then
+ # for --enable-amr
+ mkdir -p amr_float
+ unzip ../../${AMR_FLOAT}_ANSI_C_source_code.zip -d amr_float
-sed 's|-pedantic-errors|-DMMS_IO|g' amrwb_float/makefile.gcc > amrwb_float/makefile
-sed 's|-pedantic-errors|-DMMS_IO|g' amr_float/makefile.gcc > amr_float/makefile
+ # for --enable-amr_wb # --enable-amr_if2
+ mkdir -p amrwb_float
+ unzip ../../${AMRWB_FLOAT}_ANSI-C_source_code.zip -d amrwb_float
+
+ sed 's|-pedantic-errors|-DMMS_IO|g' amrwb_float/makefile.gcc > amrwb_float/makefile
+ sed 's|-pedantic-errors|-DMMS_IO|g' amr_float/makefile.gcc > amr_float/makefile
+
+ USE_PATENTED="--enable-libmp3lame --enable-amr_nb --enable-amr_wb"
+else
+ USE_PATENTED=" "
+fi
cd $TMP/tmp-$PRGNAM/ffmpeg-${FFMPEG}
CFLAGS="$SLKCFLAGS -fPIC" \
CXXFLAGS="$SLKCFLAGS -fPIC" \
LDFLAGS="$SLKLDFLAGS" \
./configure --prefix=/usr \
- --enable-libmp3lame \
+ ${USE_PATENTED} \
--enable-libogg \
- --enable-libvorbis \
+ --enable-libvorbis \
--enable-libtheora \
--enable-libfaac \
--enable-xvid \
- --enable-amr_nb --enable-amr_wb \
- --enable-gpl \
+ --enable-gpl \
--enable-pp \
--enable-pthreads \
--disable-debug \
@@ -489,8 +529,9 @@ LDFLAGS="$SLKLDFLAGS" \
--extra-cflags="-I`pwd`/../vlcdeps/usr/include" \
--extra-ldflags="-L`pwd`/../vlcdeps/usr/lib" \
2>&1 | tee $OUTPUT/configure-${PRGNAM}_ffmpeg.log
- # Does not work with gcc4: --enable-amr_nb-fixed --enable-amr_if2 --enable-amr_wb \
- # (errors in VLC linking) --enable-swscaler \
+ # Does not work with gcc4:
+ # --enable-amr_nb-fixed --enable-amr_if2 --enable-amr_wb \
+ # Errors in VLC linking: --enable-swscaler \
make 2>&1 | tee $OUTPUT/make-${PRGNAM}_ffmpeg.log
cd $OLDDIR
}
@@ -1107,6 +1148,13 @@ else
echo "+++ NOT building mozilla plugin - this needs the Seamonkey package! +++"
fi
+# Only use patented code if we are allowing it:
+if [ "${USE_PATENTS}" == "YES" -o "${SRCPAT[$i]}" != "YES" ]; then
+ DO_FFMPEG_MP3LAME="--with-ffmpeg-mp3lame"
+else
+ DO_FFMPEG_MP3LAME=" "
+fi
+
sh bootstrap
CFLAGS="$SLKCFLAGS -I`pwd`/../vlcdeps/usr/include" \
@@ -1171,7 +1219,7 @@ PKG_CONFIG_PATH="`pwd`/../vlcdeps/usr/lib/pkgconfig" \
--enable-live555 \
--with-live555-tree=$TMP/tmp-$PRGNAM/live \
--enable-ffmpeg \
- --with-ffmpeg-mp3lame \
+ ${DO_FFMPEG_MP3LAME} \
--with-ffmpeg-theora \
--with-ffmpeg-vorbis \
--with-ffmpeg-faac \
@@ -1340,7 +1388,10 @@ make_dvdnav || exit 1
#make_dvdcss
make_dvdread || exit 1
# Needed before ffmpeg:
-make_lame || exit 1
+# Only use patented code if we are allowing it:
+if [ "${USE_PATENTS}" == "YES" -o "${SRCPAT[$i]}" != "YES" ]; then
+ make_lame || exit 1
+fi
make_xvid || exit 1
make_faac || exit 1
@@ -1377,3 +1428,4 @@ make_vlc || exit 1
# Pack all this stuff into a Slackware package (this routine also will execute
# the '--cleanup' functionality if requested):
build_slackpkg
+