summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author B. Watson2021-12-15 22:09:18 +0100
committer Willy Sudiarto Raharjo2021-12-27 10:20:25 +0100
commit3db8192ffe0b1e67b06e102de459251f30c09c07 (patch)
tree16d875b73c7bb96839d66c05d08fe9acc28b64f0
parent0788bf4363a15ecf8585638be5dd9c1719d7c543 (diff)
downloadslackbuilds-3db8192ffe0b1e67b06e102de459251f30c09c07.tar.gz
games/zsnes: Fix -current build, new-style icons.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--games/zsnes/doinst.sh5
-rw-r--r--games/zsnes/zsnes.SlackBuild35
2 files changed, 26 insertions, 14 deletions
diff --git a/games/zsnes/doinst.sh b/games/zsnes/doinst.sh
index 392c12adb9..5934a15ab1 100644
--- a/games/zsnes/doinst.sh
+++ b/games/zsnes/doinst.sh
@@ -2,3 +2,8 @@ if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications
fi
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+ if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
+ fi
+fi
diff --git a/games/zsnes/zsnes.SlackBuild b/games/zsnes/zsnes.SlackBuild
index 1f4fc9f8e5..0aaabd3fff 100644
--- a/games/zsnes/zsnes.SlackBuild
+++ b/games/zsnes/zsnes.SlackBuild
@@ -23,6 +23,13 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20211215 bkw: BUILD=5
+# - fix -current 32-bit build.
+# - new-style icons.
+# - TODO: statified binary needs updating. Except statifier seems not
+# to work on -current. Sigh.
+# - TODO: investigate fork: https://github.com/xyproto/zsnes
+
# 20180123 bkw: Finally, 64-bit support! Sort-of. Using a dirty hack.
# Also, move binary to /usr/games and man page to section 6.
@@ -30,7 +37,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=zsnes
VERSION=${VERSION:-1.51b}
-BUILD=${BUILD:-4}
+BUILD=${BUILD:-5}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -45,9 +52,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
-# the name of the created package would be, and then exit. This information
-# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -81,11 +85,8 @@ mv $PRGNAM-$VERSION/src/* $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
chown -R root:root .
-find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
- -exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
- -exec chmod 644 {} \;
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
if [ "$ARCH" = "x86_64" ]; then
# Can't compile, so use a statified binary. This was prepared
@@ -113,8 +114,7 @@ else
# https://projects.archlinux.org/svntogit/community.git/plain/trunk/zsnes-1.51-libpng15.patch?h=packages/zsnes
patch -p1 < $CWD/zsnes-1.51-libpng15.patch
- CFLAGS="$SLKCFLAGS" \
- CXXFLAGS="$SLKCFLAGS" \
+ CFLAGS="$SLKCFLAGS -fcommon -std=c++11" \
force_arch="$ARCH" \
./configure \
--prefix=/usr \
@@ -122,8 +122,7 @@ else
--disable-cpucheck \
--disable-debugger
- CFLAGS="$SLKCFLAGS" \
- CXXFLAGS="$SLKCFLAGS" \
+ CFLAGS="$SLKCFLAGS -fcommon -std=c++11" \
force_arch="$ARCH" \
make
make install DESTDIR=$PKG
@@ -140,7 +139,15 @@ rm -rf $PKG/usr/man/man1
# Add a .desktop file and icon for good menu integration
mkdir -p $PKG/usr/share/applications $PKG/usr/share/pixmaps
install -m 0644 $CWD/zsnes.desktop $PKG/usr/share/applications/zsnes.desktop
-install -m 0644 $CWD/zsnes.png $PKG/usr/share/pixmaps/zsnes.png
+
+for px in 16 32 48 64; do
+ size=${px}x${px}
+ dir=$PKG/usr/share/icons/hicolor/$size/apps
+ mkdir -p $dir
+ convert -resize $size $CWD/$PRGNAM.png $dir/$PRGNAM.png
+done
+
+ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a docs/* $PKG/usr/doc/$PRGNAM-$VERSION