audio/grip: Added (GTK+ CD player/ripper; replaces grip2)

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2021-12-13 14:24:08 -05:00 committed by Willy Sudiarto Raharjo
parent f1afd7a0e5
commit 2338b8ba19
No known key found for this signature in database
GPG key ID: 3F617144D7238786
6 changed files with 186 additions and 0 deletions

9
audio/grip/README Normal file
View file

@ -0,0 +1,9 @@
grip2 (graphical CD player and ripper)
Grip is a gtk-based cd-player and cd-ripper. It has the ripping
capabilities of cdparanoia builtin, but can also use external rippers
(such as cdda2wav).
Optional runtime dependency: yelp. If this is installed, grip's Help
will be displayed with it. Otherwise, the Help will be displayed in
your default web browser.

9
audio/grip/doinst.sh Normal file
View file

@ -0,0 +1,9 @@
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

125
audio/grip/grip.SlackBuild Normal file
View file

@ -0,0 +1,125 @@
#!/bin/bash
# Slackware build script for grip
# Written by B. Watson (yalhcru@gmail.com)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20211213 bkw: This replaces the ancient grip2 build. We didn't have
# grip 3.x builds because they had too many gnome dependencies; the
# 4.x series dropped those and is a pure GTK+ application. Except for
# its Help option, which requires yelp. To avoid a dependency on yelp,
# I convert the docs to HTML and patch grip to open a browser.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=grip
VERSION=${VERSION:-4.2.3}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
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"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
# The icons aren't quite correctly sized, e.g. the 64x64 one is really 64x67.
for i in pixmaps/*/apps/$PRGNAM.png; do
size="$( echo $i | cut -d/ -f2 )"
convert -crop $size+0+1 $i $i.new.png
mv $i.new.png $i
done
# Patch makes grip open the help table of contents in a browser, if
# yelp is not installed. Have to convert the help to HTML, see below.
patch -p1 < $CWD/help_fallback_html.diff
mkdir build
cd build
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
meson .. \
--buildtype=release \
--infodir=/usr/info \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--localstatedir=/var \
--mandir=/usr/man \
--prefix=/usr \
--sysconfdir=/etc \
-Dstrip=true
"${NINJA:=ninja}" -v
DESTDIR=$PKG $NINJA -v install
cd ..
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC/html
# Generate HTML documentation, so we don't need yelp.
# 2 choices here: docbook2html or xmlto. I go with xmlto because
# docbook2html (a) doesn't handle UTF-8 input, and (b) wants to
# do network access to download the DTD.
# The documentation is short enough that there's no point having
# separate HTML pages for each section. html-nochunks gives us
# one HTML file with all the content.
cd doc/C
xmlto --stringparam chunker.output.encoding=UTF-8 html-nochunks grip.xml
# While we're at it, make the smilie images easier to see on modern hi-res
# screens (I have to squint).
for i in smile*.png; do
convert \
-resize 36x36 \
-extent 40x40 \
-background '#808080' \
-gravity center \
$i $i.new.png
mv $i.new.png $i
done
cp -a *.html *.png $PKGDOC/html
cd -
# NEWS is 0-byte placeholder in 4.2.3.
cp -a AUTHORS COPYING* CREDITS ChangeLog README TODO $PKGDOC
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$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

10
audio/grip/grip.info Normal file
View file

@ -0,0 +1,10 @@
PRGNAM="grip"
VERSION="4.2.3"
HOMEPAGE="https://sourceforge.net/projects/grip/"
DOWNLOAD="https://downloads.sourceforge.net/project/grip/4.2.3/grip-4.2.3.tar.gz"
MD5SUM="a36db042543ffced71965d6737f464e4"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="B. Watson"
EMAIL="yalhcru@gmail.com"

View file

@ -0,0 +1,14 @@
diff -Naur grip-4.2.3/src/grip.c grip-4.2.3.patched/src/grip.c
--- grip-4.2.3/src/grip.c 2021-07-07 13:53:25.000000000 -0400
+++ grip-4.2.3.patched/src/grip.c 2021-12-13 14:10:40.912094097 -0500
@@ -370,6 +370,10 @@
screen = gtk_widget_get_screen (widget);
gtk_show_uri(screen, "ghelp:grip", gtk_get_current_event_time(), &error);
+ if(error != NULL) {
+ error = NULL;
+ gtk_show_uri(screen, "file:///usr/doc/grip-" VERSION "/html/grip.html", gtk_get_current_event_time(), &error);
+ }
if (error != NULL) {
GtkWidget *d;

19
audio/grip/slack-desc Normal file
View file

@ -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 ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
grip: grip (graphical CD player and ripper)
grip:
grip: Grip is a gtk-based cd-player and cd-ripper. It has the ripping
grip: capabilities of cdparanoia builtin, but can also use external rippers
grip: (such as cdda2wav).
grip:
grip:
grip:
grip:
grip:
grip: