diff options
author | B. Watson <yalhcru@gmail.com> | 2014-09-08 22:33:56 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2014-09-08 22:33:56 +0700 |
commit | 69d77d1d6fb0f443d9c0509db707b7449423e3b1 (patch) | |
tree | 692e1624b8cb0c21eaee4789bcca930c79587d77 /games/sms_sdl/sms_sdl.SlackBuild | |
parent | cb9b3896f0cf73def6d51114473387926b504c46 (diff) |
games/sms_sdl: Fix bad patch and desktop integration.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/sms_sdl/sms_sdl.SlackBuild')
-rw-r--r-- | games/sms_sdl/sms_sdl.SlackBuild | 63 |
1 files changed, 23 insertions, 40 deletions
diff --git a/games/sms_sdl/sms_sdl.SlackBuild b/games/sms_sdl/sms_sdl.SlackBuild index 2b9dcbef557bd..304124bd875e5 100644 --- a/games/sms_sdl/sms_sdl.SlackBuild +++ b/games/sms_sdl/sms_sdl.SlackBuild @@ -1,11 +1,22 @@ #!/bin/sh # Slackware build script for sms_sdl + # Written by B. Watson (yalhcru@gmail.com) +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# 20140907 bkw: +# - use gzipped patches to avoid \r being stripped by SBo git +# - update man page, convert to pod, move to section 6 +# - install exe in /usr/games instead of /usr/bin +# - use the mime type x-sms-rom, predefined by freedesktop.org, instead +# of including our own custom mime types. Since Slackware already has +# this mime type, get rid of the option to disable mime. + PRGNAM=sms_sdl VERSION=${VERSION:-0.9.4a_r7.1} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -23,10 +34,6 @@ OUTPUT=${OUTPUT:-/tmp} SRCVER=$(echo $VERSION | sed 's/_/-/') -# If $MIME_TYPES is set to `yes' it will include MIME types for KDE and -# automagically associate *.sms and *.gg files with sms_sdl. -MIME_TYPES=${MIME_TYPES:-"yes"} - if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" @@ -58,22 +65,22 @@ find -L . \ # Sorry for all the patches, upstream has been unmaintained since 2001 or so. -# Support OPTFLAGS in build process -patch -p1 --verbose < $CWD/patches/cflags_and_libz.diff +# Support OPTFLAGS in build process, enabled zipped rom support +zcat $CWD/patches/cflags_and_libz.diff.gz | patch -p1 # Thanks to Ellington Santos (necropresto) for this patch that makes # the --fm and --japan options actually work: -patch -p1 --verbose < $CWD/patches/japan_and_fm.diff +zcat $CWD/patches/japan_and_fm.diff.gz | patch -p1 # x86_64 needs this patch to disable x86 asm + fix the int32, uint32 typedefs # (but x86 doesn't need this!) if [ "$ARCH" = "x86_64" ]; then - patch -p1 --verbose < $CWD/patches/x86_64.diff + zcat $CWD/patches/x86_64.diff.gz | patch -p1 fi # Allow the ROM filename to appear anywhere on the command line, and # avoid segfaulting on filenames that don't contain a dot. -patch -p1 --verbose < $CWD/patches/fix_option_parsing.diff +zcat $CWD/patches/fix_option_parsing.diff.gz | patch -p1 cd sdl @@ -83,8 +90,8 @@ sed -i '/^LIBS/s,$, -lm,' Makefile make OPTFLAGS="$SLKCFLAGS" # There's no 'make install', plus we have this wrapper script... -mkdir -p $PKG/usr/bin $PKG/usr/libexec -install -m0755 $CWD/$PRGNAM.sh $PKG/usr/bin/$PRGNAM +mkdir -p $PKG/usr/games $PKG/usr/libexec +install -m0755 $CWD/$PRGNAM.sh $PKG/usr/games/$PRGNAM install -s -m0755 $PRGNAM $PKG/usr/libexec/$PRGNAM mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION @@ -94,11 +101,11 @@ cat $CWD/sample_config > $PKG/usr/doc/$PRGNAM-$VERSION/sample_config # man page is part of this SlackBuild. If you're packaging for # some other distribution, feel free to snag it. -mkdir -p $PKG/usr/man/man1 -sed "s/@VERSION@/$VERSION/g" < $CWD/$PRGNAM.1 | gzip -9c > $PKG/usr/man/man1/$PRGNAM.1.gz +mkdir -p $PKG/usr/man/man6 +sed "s/\<VERSION\>/$VERSION/g" < $CWD/$PRGNAM.6 | \ + gzip -9c > $PKG/usr/man/man6/$PRGNAM.6.gz -# Desktop integration stuff: Icon and .desktop file always present, -# regardless of $MIME_TYPES +# icon by finite (see REAME), desktop written for this build. mkdir -p $PKG/usr/share/applications $PKG/usr/share/pixmaps cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png @@ -107,29 +114,5 @@ mkdir -p $PKG/install cat $CWD/doinst.sh > $PKG/install/doinst.sh cat $CWD/slack-desc > $PKG/install/slack-desc -# MIME type and icon stuff updated for KDE 4. -# For KDE4, we need the freedesktop XML file that defines the MIME types, -# the icon(s) in /usr/share/icons/hicolor/<size>/mimetypes, -# the MimeType= line in the app's .desktop file, -# and the gtk-update-icon-cache lines in doinst.sh -if [ "$MIME_TYPES" = "yes" ]; then - mimedir=$PKG/usr/share/mime/packages/ - icondir=$PKG/usr/share/icons/hicolor/128x128/mimetypes - desktop_types="MimeType=" - - mkdir -p $mimedir $icondir - cat $CWD/mime/$PRGNAM.xml > $mimedir/$PRGNAM.xml - - cd $icondir - for type in $( cat $CWD/mime/mime_types ); do - icon=$( echo $type | sed 's,/,-,g' ).png - ln -s ../../../../pixmaps/$PRGNAM.png $icon - desktop_types="$desktop_types$type;" - done - - cat $CWD/mime/doinst.mime >> $PKG/install/doinst.sh - echo "$desktop_types" >> $PKG/usr/share/applications/$PRGNAM.desktop -fi - cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} |