summaryrefslogtreecommitdiffstats
path: root/desktop/gnome-icon-theme/gnome-icon-theme.SlackBuild
blob: 9006651a6998726a902c50cdde61f281b69a4feb (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/bash

# Slackware build script for gnome-icon-theme

# Originally written by Petar Petrov.
# Modified and now maintained by B. Watson <urchlay@slackware.uk>.

# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.

# 20240821 bkw: BUILD=2
# - ARCH=noarch.
# - extract tarballs to a top-level dir, for easier cleanup.
# - factor repeated code into functions (makes the script shorter).
# - --disable-nls, to avoid creating 103 empty LC_MESSAGES/ dirs
#   in /usr/share/locale. There's nothing to translate here.
#   Oddly, configure complains:
#     configure: WARNING: unrecognized options: --disable-nls
#   ...but it actually works anyway (no /usr/share/locale installed).
# - funky doinst.sh creation and link removal. speed the build
#   up 2.26x (was 2m20s, now 1m2s, on my test box).
# - add 'install_sh=/bin/install' to make command, which further
#   cuts the time from 1m2s to 33s (4.24x as fast as the original).
#   No idea why configure checks for the install command, then doesn't
#   use it instead of the shipped (and much slower) install-sh script.

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=gnome-icon-theme
VERSION=${VERSION:-3.12.0}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
ARCH=noarch

EXTRAS=$PRGNAM-extras
SYMBOL=$PRGNAM-symbolic

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}

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP

# 20240820 bkw: put everything in a top-level dir.
rm -rf $PRGNAM-build
mkdir -p $PRGNAM-build
cd $PRGNAM-build
TOPDIR=$( pwd )

# 20240821 bkw: --disable-dependency-tracking doesn't speed it up at all.
build() {
  cd $TOPDIR
  tar xvf $CWD/$1-$VERSION.tar.xz
  cd $1-$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 {} \+

  [ "$2" != "" ] && patch -p1 < $2

  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --enable-icon-mapping \
    --disable-nls \
    --localstatedir=/var/lib

  make all install DESTDIR=$PKG install_sh=/bin/install
}

build $PRGNAM
build $EXTRAS
build $SYMBOL $CWD/fix_gits_configure.patch

# As in the original SlackBuild, we don't want icon caches:
find $PKG/usr/share/icons -type f -name "icon-theme.cache" -exec rm -f {} \+

cd $TOPDIR

PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
install_doc() {
  mkdir -p $PKGDOC/$2
  cp -a $1-$VERSION/{AUTHORS,COPYING,NEWS,README} $PKGDOC/$2
}

install_doc $PRGNAM
install_doc $EXTRAS extras
install_doc $SYMBOL symbolic

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

# makepkg's "find symlinks and create doinst.sh" phase is painfully slow,
# especially when there are thousands of symlinks (this package has 3846
# of them).
# This perl script does the same job, *many* times faster. Like, less
# than 0.1 sec, compared to makepkg taking over a minute.
perl $CWD/findsymlinks.pl >> $PKG/install/doinst.sh

/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE