summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a5ed8e57356203192af860654b92cb6640a06b48 (plain)
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
# Maintainer: Mark Collins <tera_1225 [aaht] hotmail ðot com>
pkgname=minuimus
pkgver="4.1"
pkgrel=3
pkgdesc="file optimiser: makes files smaller without compromising content"
arch=(x86_64)
url="https://birds-are-nice.me/software/minuimus.html"
license=('GPL')
depends=(
  'advancecomp' # AUR
  'brotli'
  'glibc'
  'gif2apng' # AUR
  'gif2png'
  'gifsicle'
  'imagemagick'
  'jpegoptim'
  'libjpeg'
  'libwebp'
  'mupdf-tools'
  'optipng'
  'p7zip'
  'perl'
  'poppler'
  'qpdf'
  'unrar'
  'libwebp'
  'zip'
  'zlib'
)
optdeps=(
  'jbigkit'
  'leanify'        # AUR
  'png22pnm'       # AUR
  'pngout'         # AUR
  'pdfsizeopt-git' # AUR
)
source=("${pkgname}_${pkgver}.zip::${url//.html/.zip}"
        'minuimus_leanify_keep_icc.patch'
        'fix_missing_pdfsizeopt_which.patch')
sha256sums=('9c1e2f1fd4a56d231e582f9fd6ba5f53dfc1165728638530e960bd1e562c1855'
            '8e4428e32dd1910726174573dd2fd7e25c328af0e5b4cc756b5dd8d4bc6445cf'
            '80d6140dafe63e71e2df4704cd931692a42bf368543f539c6264ee832534bc10')

prepare() {
  cd "$srcdir"
  echo "Fixing minuimus.pl for imagemagick binary identify-im6 => identify and convert-im6 => convert"
  sed -i -e 's/convert-im6/convert/g' minuimus.pl
  sed -i -e 's/identify-im6/identify/g' minuimus.pl

  echo "Fixing minuimus.pl for leanify spurious option --keep-icc"
  patch minuimus.pl minuimus_leanify_keep_icc.patch

  echo "Fixing minuimus.pl for which pdfsizeopt annoyance"
  patch minuimus.pl fix_missing_pdfsizeopt_which.patch
}

build() {
  cd "$srcdir"
  make all
}

package() {
  cd "$srcdir"
  # The makefile doesn't have any method for setting prefix, so we do the install section here
  mkdir -p "${pkgdir}/usr/bin/"
  cp minuimus_def_helper "${pkgdir}/usr/bin/minuimus_def_helper"
  cp minuimus_woff_helper "${pkgdir}/usr/bin/minuimus_woff_helper"
  cp cab_analyze "${pkgdir}/usr/bin/cab_analyze"
  cp minuimus.pl "${pkgdir}/usr/bin/minuimus.pl"
  ln -s "/usr/bin/minuimus.pl" "${pkgdir}/usr/bin/minuimus"
  cp minuimus_swf_helper "${pkgdir}/usr/bin/minuimus_swf_helper"
}