From 626f1d498eeba9b917db0b5e8fe75a0c5e9ad389 Mon Sep 17 00:00:00 2001 From: Nathaniel Russell Date: Thu, 24 Nov 2022 21:39:02 +0700 Subject: [PATCH] games/gnome-mahjongg: Added (Gnome mahjongg game). Signed-off-by: Willy Sudiarto Raharjo --- games/gnome-mahjongg/README | 2 + games/gnome-mahjongg/doinst.sh | 14 +++ .../gnome-mahjongg/gnome-mahjongg.SlackBuild | 116 ++++++++++++++++++ games/gnome-mahjongg/gnome-mahjongg.info | 10 ++ ...-unused-argument-for-i18n.merge_file.patch | 35 ++++++ games/gnome-mahjongg/slack-desc | 19 +++ 6 files changed, 196 insertions(+) create mode 100644 games/gnome-mahjongg/README create mode 100644 games/gnome-mahjongg/doinst.sh create mode 100644 games/gnome-mahjongg/gnome-mahjongg.SlackBuild create mode 100644 games/gnome-mahjongg/gnome-mahjongg.info create mode 100644 games/gnome-mahjongg/meson-drop-unused-argument-for-i18n.merge_file.patch create mode 100644 games/gnome-mahjongg/slack-desc diff --git a/games/gnome-mahjongg/README b/games/gnome-mahjongg/README new file mode 100644 index 0000000000..a950491091 --- /dev/null +++ b/games/gnome-mahjongg/README @@ -0,0 +1,2 @@ +Mahjongg is a simple pattern recognition game. You score points by +matching identical tiles diff --git a/games/gnome-mahjongg/doinst.sh b/games/gnome-mahjongg/doinst.sh new file mode 100644 index 0000000000..b123c0cd8d --- /dev/null +++ b/games/gnome-mahjongg/doinst.sh @@ -0,0 +1,14 @@ +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +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 +if [ -e usr/share/glib-2.0/schemas ]; then + if [ -x /usr/bin/glib-compile-schemas ]; then + /usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas >/dev/null 2>&1 + fi +fi diff --git a/games/gnome-mahjongg/gnome-mahjongg.SlackBuild b/games/gnome-mahjongg/gnome-mahjongg.SlackBuild new file mode 100644 index 0000000000..d7cbe3bcf4 --- /dev/null +++ b/games/gnome-mahjongg/gnome-mahjongg.SlackBuild @@ -0,0 +1,116 @@ +#!/bin/bash + +# Slackware build script for gnome-mahjongg + +# Copyright 2022 Nathaniel Russell +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS 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 AUTHOR 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. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=gnome-mahjongg +VERSION=${VERSION:-3.38.3} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-txz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.xz +cd $PRGNAM-$VERSION +cat $CWD/meson-drop-unused-argument-for-i18n.merge_file.patch | patch -p1 + +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 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +mkdir build +cd build + CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + meson .. \ + --buildtype=release \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --localstatedir=/var \ + --mandir=/usr/man \ + --prefix=/usr \ + --sysconfdir=/etc \ + -Dstrip=true + ninja + DESTDIR=$PKG ninja install +cd .. + +# Don't ship .la files: +rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la + +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 + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +DOCS="COPYING* NEWS" +cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +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 diff --git a/games/gnome-mahjongg/gnome-mahjongg.info b/games/gnome-mahjongg/gnome-mahjongg.info new file mode 100644 index 0000000000..2170dd8e59 --- /dev/null +++ b/games/gnome-mahjongg/gnome-mahjongg.info @@ -0,0 +1,10 @@ +PRGNAM="gnome-mahjongg" +VERSION="3.38.3" +HOMEPAGE="https://wiki.gnome.org/Apps/Mahjongg" +DOWNLOAD="https://download.gnome.org/sources/gnome-mahjongg/3.38/gnome-mahjongg-3.38.3.tar.xz" +MD5SUM="1f1de4de650ee9e9481692339cb10024" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Nathaniel Russell" +EMAIL="naterussell83@gmail.com" diff --git a/games/gnome-mahjongg/meson-drop-unused-argument-for-i18n.merge_file.patch b/games/gnome-mahjongg/meson-drop-unused-argument-for-i18n.merge_file.patch new file mode 100644 index 0000000000..428dcadf87 --- /dev/null +++ b/games/gnome-mahjongg/meson-drop-unused-argument-for-i18n.merge_file.patch @@ -0,0 +1,35 @@ +From: Jan Beich +Date: Mon, 24 Jan 2022 11:22:48 +0000 +Subject: meson: drop unused argument for i18n.merge_file() + +Ignored in Meson < 0.60.0, deprecated since 0.60.1 and fatal since 0.61.0. + +data/meson.build:24:0: ERROR: Function does not take positional arguments. +data/meson.build:45:0: ERROR: Function does not take positional arguments. + +(cherry picked from commit a2037b0747163601a5d5b57856d037eecf3a4db7) +--- + data/meson.build | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/data/meson.build b/data/meson.build +index 8142127..a1e5c96 100644 +--- a/data/meson.build ++++ b/data/meson.build +@@ -22,7 +22,6 @@ install_data ('smooth.png', install_dir: join_paths (pkgdatadir, 'themes')) + install_data ('edu_kang_xi.png', install_dir: join_paths (pkgdatadir, 'themes')) + + desktop_file = i18n.merge_file ( +- 'desktop-file', + input: 'org.gnome.Mahjongg.desktop.in', + output: 'org.gnome.Mahjongg.desktop', + install: true, +@@ -42,7 +41,7 @@ if desktop_file_validate.found() + ) + endif + +-appdata_file = i18n.merge_file ('appdata-file', ++appdata_file = i18n.merge_file ( + input: 'org.gnome.Mahjongg.appdata.xml.in', + output: 'org.gnome.Mahjongg.appdata.xml', + install: true, diff --git a/games/gnome-mahjongg/slack-desc b/games/gnome-mahjongg/slack-desc new file mode 100644 index 0000000000..4f45f8de34 --- /dev/null +++ b/games/gnome-mahjongg/slack-desc @@ -0,0 +1,19 @@ +# 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------------------------------------------------------| +gnome-mahjongg: gnome-mahjongg (Gnome mahjongg game) +gnome-mahjongg: +gnome-mahjongg: Mahjongg game for gnome desktop. +gnome-mahjongg: +gnome-mahjongg: Mahjongg is a simple pattern recognition game. You score points by +gnome-mahjongg: matching identical tiles +gnome-mahjongg: +gnome-mahjongg: +gnome-mahjongg: +gnome-mahjongg: +gnome-mahjongg: