You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

247 lines
8.0 KiB

#!/bin/sh
# Generated by Alien's SlackBuild Toolkit: http://slackware.com/~alien/AST
# Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2015 Eric Hameleers, Eindhoven, Netherlands
# Copyright 2015-2017 Thorn Inurcide
# Copyright 2015-2017 tde-slackbuilds project on GitHub
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for
# any purpose with or without fee is hereby granted, provided that
# the above copyright notice and this permission notice appear in all
# copies.
#
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
PRGNAM=k3b
PKGNAM=$TDEPFX$PRGNAM
VERSION=$TDEVERSION
BUILD=${BUILD:-1}
TAG=${TAG:-_tde}
source ../../get-source.sh
getsource_fn
# Check for ffmpeg:
pkg-config libavcodec && FFMPEG="ON"
# Check for lame:
ldconfig -p|grep libmp3lame 1>/dev/null && LAME="ON" # [use ldconfig - no .pc file]
# Check for musepack:
[[ $(cat $TMPVARS/PRE_DOWNLOAD) != yes ]] && {
# ### musepack - start
musepack_installed_fn () { ldconfig -p|grep libmpcdec 1>/dev/null ;} # [use ldconfig - no .pc file]
## If it's already installed, go to MUSEPACK="ON"
musepack_installed_fn || {
## otherwise, if the source archive is in 'src' ..
[[ -s $BUILD_TDE_ROOT/src/libmpcdec-1.2.6.tar.bz2 ]] && {
## .. build, package, and install it
(
echo -e "\n building musepack decoder \n"
cd /$TMP_BUILD
rm -rf *libmpcdec*
tar xf $BUILD_TDE_ROOT/src/libmpcdec-1.2.6.tar.bz2
cd libmpcdec-1.2.6/
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
CC=$COMPILER \
CXX=$COMPILER_CXX \
./configure --libdir=\${exec_prefix}/lib${LIBDIRSUFFIX} --disable-static
make
DESTDIR=$TMP_BUILD/package-libmpcdec make install-strip
cd $TMP_BUILD/package-libmpcdec
makepkg -l y -c n $OUTPUT/libmpcdec-1.2.6-$ARCH-$BUILD.txz
installpkg $OUTPUT/libmpcdec-1.2.6-$ARCH-$BUILD.txz
)
musepack_installed_fn || { echo -e " installation of musepack decoder failed \n" ; exit 1 ; }
touch $TMPVARS/k3b-opts-built
}
} && \
MUSEPACK="ON"
# ### musepack - end
}
# Check for musicbrainz:
[[ $(cat $TMPVARS/PRE_DOWNLOAD) != yes ]] && {
# ### musicbrainz - start
musicbrainz_installed_fn () { pkg-config libmusicbrainz ;}
## If it's already installed, go to MUSICBRAINZ="ON"
musicbrainz_installed_fn || {
## otherwise, if the source archive is in 'src' ..
[[ -s $BUILD_TDE_ROOT/src/libmusicbrainz-2.1.5.tar.gz ]] && {
## .. build, package, and install it
(
echo -e "\n building libmusicbrainz \n"
cd /$TMP_BUILD
rm -rf *libmusicbrainz*
tar xf $BUILD_TDE_ROOT/src/libmusicbrainz-2.1.5.tar.gz
cd libmusicbrainz-2.1.5/
## patch for string.h - thanks to SBo - see https://slackbuilds.org/slackbuilds/14.2/libraries/libmusicbrainz/libmusicbrainz-2.1.5-include_stringh.patch
echo $'--- lib/c_wrapper.cpp
+++ lib/c_wrapper.cpp
@@ -23,0 +24 @@
+#include <string.h>
--- lib/comhttpsocket.cpp
+++ lib/comhttpsocket.cpp
@@ -21,0 +22 @@
+#include <string.h>
--- lib/comsocket.cpp
+++ lib/comsocket.cpp
@@ -39,0 +40 @@
+#include <string.h>
--- lib/http.cpp
+++ lib/http.cpp
@@ -26,0 +27 @@
+#include <string.h>
--- lib/sigclient.cpp
+++ lib/sigclient.cpp
@@ -35,0 +36 @@
+#include <string.h>
' | patch -p0
## patch for gcc6 - thanks to Archlinux - see https://bugs.archlinux.org/task/50754?getfile=14619
echo $'--- lib/sigclient.cpp
+++ lib/sigclient.cpp
@@ -42,4 +42,4 @@
-char tooShortTRM[] = { 0xf9, 0x80, 0x9a, 0xb1, 0x2b, 0x0f, 0x4d, 0x78,
- 0x88, 0x62, 0xfb, 0x42, 0x5a, 0xde, 0x8a, 0xb9 };
-char sigserverBusyTRM[] = { 0xc4, 0x57, 0xa4, 0xa8, 0xb3, 0x42, 0x4e, 0xc9,
- 0x8f, 0x13, 0xb6, 0xbd, 0x26, 0xc0, 0xe4, 0x00 };
+char tooShortTRM[] = { (char)0xf9, (char)0x80, (char)0x9a, (char)0xb1, (char)0x2b, (char)0x0f, (char)0x4d, (char)0x78,
+ (char)0x88, (char)0x62, (char)0xfb, (char)0x42, (char)0x5a, (char)0xde, (char)0x8a, (char)0xb9 };
+char sigserverBusyTRM[] = { (char)0xc4, (char)0x57, (char)0xa4, (char)0xa8, (char)0xb3, (char)0x42, (char)0x4e, (char)0xc9,
+ (char)0x8f, (char)0x13, (char)0xb6, (char)0xbd, (char)0x26, (char)0xc0, (char)0xe4, (char)0x00 };
--- lib/signature.cpp
+++ lib/signature.cpp
@@ -48,2 +48,2 @@
-char silenceTRM[] = { 0x7d, 0x15, 0x4f, 0x52, 0xb5, 0x36, 0x4f, 0xae,
- 0xb5, 0x8b, 0x06, 0x66, 0x82, 0x6c, 0x2b, 0xac, 0x00 };
+char silenceTRM[] = { (char)0x7d, (char)0x15, (char)0x4f, (char)0x52, (char)0xb5, (char)0x36, (char)0x4f, (char)0xae,
+ (char)0xb5, (char)0x8b, (char)0x06, (char)0x66, (char)0x82, (char)0x6c, (char)0x2b, (char)0xac, (char)0x00 };
' | patch -p0
## work-around for gcc11+ - see https://gcc.gnu.org/gcc-11/porting_to.html
[[ $(gcc --version) == *1[1-9]* ]] && CXXFLAGS_="-std=gnu++14"
## clang build - C++11 requires a space between literal and identifier
sed -i 's|"VERSION|" VERSION|' lib/comhttpsocket.cpp
sed -i 's|"VERSION|" VERSION|' lib/musicbrainz.cpp
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS ${CXXFLAGS_:-}" \
CC=$COMPILER \
CXX=$COMPILER_CXX \
./configure --libdir=\${exec_prefix}/lib${LIBDIRSUFFIX} --disable-static
make
DESTDIR=$TMP_BUILD/package-libmusicbrainz make install-strip
cd $TMP_BUILD/package-libmusicbrainz
makepkg -l y -c n $OUTPUT/libmusicbrainz-2.1.5-$ARCH-$BUILD.txz
installpkg $OUTPUT/libmusicbrainz-2.1.5-$ARCH-$BUILD.txz
)
musicbrainz_installed_fn || { echo -e " installation of Musicbrainz failed \n" ; exit 1 ; }
touch $TMPVARS/k3b-opts-built
}
} && \
MUSICBRAINZ="ON"
# ### musicbrainz - end
}
[[ -e $TMPVARS/k3b-opts-built ]] && echo -e "\n now building k3b \n" && rm $TMPVARS/k3b-opts-built
untar_fn
mkdir doc/misc
mv FAQ doc/misc/
## build fails with gcc visibility support
sed -i 's|tde_setup_gcc_visibility|#&|' ConfigureChecks.cmake
[[ $TDEVERSION == 14.0.13 ]] && {
patch -p0 << EOF
--- plugins/decoder/libsndfile/CMakeLists.txt
+++ plugins/decoder/libsndfile/CMakeLists.txt
@@ -20,2 +20,3 @@
\${TQT_INCLUDE_DIRS}
+ \${SNDFILE_INCLUDE_DIRS}
)
EOF
}
listdocs_fn
chown_fn
cd_builddir_fn
cmake ${G_NINJA:-} -C $TMPVARS/CMAKE_CACHE ${CMAKE_OPTS:-} \
-DWITH_LIBDVDREAD="ON" \
-DWITH_MUSICBRAINZ=${MUSICBRAINZ:-"OFF"} \
-DWITH_SYSTEM_LIBSAMPLERATE="ON" \
-DWITH_HAL="OFF" \
-DWITH_DEBUG="OFF" \
-DWITH_ALSA="ON" \
-DWITH_ARTS="ON" \
-DWITH_FFMPEG=${FFMPEG:-"OFF"} \
-DWITH_FFMPEG_ALL_CODECS=${FFMPEG:-"OFF"} \
-DWITH_FLAC="ON" \
-DWITH_SNDFILE="ON" \
-DWITH_TAGLIB="ON" \
-DWITH_MAD="ON" \
-DWITH_MUSEPACK=${MUSEPACK:-"OFF"} \
-DWITH_VORBIS="ON" \
-DWITH_LAME=${LAME:-"OFF"} \
-DBUILD_K3BSETUP="ON"
make_fn
installdocs_fn
mangzip_fn
strip_fn
mkdir_install_fn
doinst_sh_fn
PRGNAM=$PKGNAM
echo "
# HOW TO EDIT THIS FILE:
# The 'handy ruler' below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
$PRGNAM: K3b (The CD Creator, TDE $TDEVERSION version)
$PRGNAM:
$PRGNAM: K3b makes writing cds under Linux easy. It has an easy to use
$PRGNAM: interface and supports CD burning (including on-the-fly), copying,
$PRGNAM: erasing, ripping, and more.
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
" > $PKG/install/slack-desc
makepkg_fn