diff options
author | Jeremy Hansen <jebrhansen+SBo@gmail.com> | 2017-03-27 21:27:49 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-04-01 06:56:57 +0700 |
commit | 452d501c95cd070c8e592a4e227192a09e18fad3 (patch) | |
tree | d76029ec05c70b5e3ec4b665b87b78e22154e6a3 /multimedia/mediainfo/mediainfo.SlackBuild | |
parent | d805898ffc7a5863cfd10b16c535c68b87af88b2 (diff) | |
download | slackbuilds-452d501c95cd070c8e592a4e227192a09e18fad3.tar.gz |
multimedia/mediainfo: New mediainfo-gui option.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'multimedia/mediainfo/mediainfo.SlackBuild')
-rw-r--r-- | multimedia/mediainfo/mediainfo.SlackBuild | 124 |
1 files changed, 92 insertions, 32 deletions
diff --git a/multimedia/mediainfo/mediainfo.SlackBuild b/multimedia/mediainfo/mediainfo.SlackBuild index 9f947b1493..a70a139474 100644 --- a/multimedia/mediainfo/mediainfo.SlackBuild +++ b/multimedia/mediainfo/mediainfo.SlackBuild @@ -2,10 +2,9 @@ # Slackware build script for mediainfo -# Copyright 2017 Jeremy Hansen <jebrhansen+SBo -at- gmail.com> -# Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org - # Copyright 2010-2012 Binh Nguyen <binhvng@gmail.com> +# Copyright 2012-2017 Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org +# Copyright 2017 Jeremy Hansen <jebrhansen+SBo -at- gmail.com> # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -27,10 +26,26 @@ PRGNAM=mediainfo VERSION=${VERSION:-0.7.93} -SRCNAM=MediaInfo_CLI_${VERSION}_GNU_FromSource -BUILD=${BUILD:-1} +SRCNAM=MediaInfo +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} +# CLI is built by default, GUI is optional +CLI=${CLI:-yes} +GUI=${GUI:-no} + +# Clear the document variables to make sure it works +CLIDOC="" +GUIDOC="" + +# Let's make sure that at least one of the interfaces will be built +if [ "${CLI}" != "yes" ] && [ "${GUI}" != "yes" ]; then + echo -e "\n\n\t=========================================================\n" + echo -e "\tYou must choose either the CLI or GUI (or both) to be built." + echo -e "\n\t=========================================================\n\n" + exit 1 +fi + if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; @@ -63,9 +78,9 @@ set -eu rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -rm -rf MediaInfo -tar xvf $CWD/${SRCNAM}.tar.xz -cd MediaInfo_CLI_GNU_FromSource +rm -rf ${SRCNAM}-${VERSION} +tar xvf $CWD/${SRCNAM}-${VERSION}.tar.gz +cd $SRCNAM-${VERSION} chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -73,42 +88,87 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -# We do not want builtin libmediainfo -if [ -d $TMP/MediaInfoLib ]; then - rm -rf $TMP/MediaInfoLib +# Patch to force using system libzen and error out if not present +patch -p1 < $CWD/remove-internal-libzen-support.patch + +# Make compiling the CLI version optional +if [ "$CLI" == "yes" ]; then + + cd Project/GNU/CLI + ./autogen.sh + + CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + + ./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --infodir=/usr/info \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --localedir=/usr/share/locale \ + --disable-static \ + --enable-shared \ + --build=$ARCH-slackware-linux + + make + make install DESTDIR=$PKG + cd - + + CLIDOC=History_CLI.txt fi -cd MediaInfo/Project/GNU/CLI - -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -./configure \ - --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --mandir=/usr/man \ - --infodir=/usr/info \ - --docdir=/usr/doc/$PRGNAM-$VERSION \ - --localedir=/usr/share/locale \ - --disable-static \ - --enable-shared \ - --build=$ARCH-slackware-linux - -make -make install DESTDIR=$PKG -cd - +# Make compiling the GUI optional -- requires wxWidgets/wxPython +if [ "$GUI" == "yes" ]; then + + # Error out if missing WxWidgets/wxPython rather than try downloading and compiling it + cd Project/GNU/GUI + sed -i 's|WxWidgets not yet compiled, try to compile|wxPython not found. Please install first.|' configure.ac + sed -i 's|WxBuiltInCompile$|with_wxwidgets="no"|g' configure.ac + + ./autogen.sh + + ./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --infodir=/usr/info \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --localedir=/usr/share/locale \ + --disable-static \ + --enable-shared \ + --build=$ARCH-slackware-linux + + make + make install DESTDIR=$PKG + cd - + + # We need an icon file + install -D -m 0644 Source/Resource/Image/MediaInfo.png \ + $PKG/usr/share/pixmaps/mediainfo.png + + # Manually install the .desktop file + install -D -m 0644 Project/GNU/GUI/mediainfo-gui.desktop \ + $PKG/usr/share/applications/mediainfo-gui.desktop + + GUIDOC=History_GUI.txt +fi find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a MediaInfo/History_CLI.txt MediaInfo/License.html MediaInfo/LICENSE $PKG/usr/doc/$PRGNAM-$VERSION +cp -a ${CLIDOC} ${GUIDOC} License.html LICENSE README.md $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild chmod 0644 $PKG/usr/doc/$PRGNAM-$VERSION/* mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} |