summaryrefslogtreecommitdiff
path: root/libre-testing/icecat/PKGBUILD
blob: 463ff67a97a52a19f03aa59a9278b78e9bd43e66 (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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# Maintainer (Arch:firefox): Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor (Arch:firefox): Ionut Biru <ibiru@archlinux.org>
# Contributor (Arch:firefox): Jakub Schmidtke <sjakub@gmail.com>

# Contributor (ConnochaetOS:iceweasel): Henry Jensen <hjensen@connochaetos.org>

# Maintainer: Andreas Grapentin <andreas@grapentin.org>
# Maintainer: Luke Shumaker <lukeshu@parabola.nu>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Contributor: Márcio Silva <coadde@hyperbola.info>
# Contributor: fauno <fauno@kiwwwi.com.ar>
# Contributor: vando <facundo@esdebian.org>
# Contributor: Figue <ffigue at gmail>
# Contributor: evr <evanroman at gmail>
# Contributor: Muhammad 'MJ' Jassim <UnbreakableMJ@gmail.com>

pkgname=icecat
_pkgver=60.3.0-gnu1
pkgver=${_pkgver//-/_}
pkgrel=1.testing1
pkgdesc="GNU IceCat - a libre standalone web browser based on Mozilla Firefox."
arch=(x86_64 i686 armv7h)
license=(MPL GPL LGPL)
url="http://www.gnu.org/software/gnuzilla/"
depends=(gtk3 gtk2 mozilla-common libxt startup-notification mime-types dbus-glib ffmpeg
         nss hunspell-en_US sqlite ttf-font libpulse libvpx icu)
makedepends=(unzip zip diffutils python2 yasm mesa imake gconf inetutils xorg-server-xvfb
             autoconf2.13 rust clang llvm jack mozilla-searchplugins)
optdepends=('networkmanager: Location detection via available WiFi networks'
            'libnotify: Notification integration'
            'pulseaudio: Audio support'
            'speech-dispatcher: Text-to-Speech')
options=(!emptydirs !makeflags !strip)
source=(http://ftp.gnu.org/gnu/gnuzilla/${_pkgver%-*}/$pkgname-$_pkgver.tar.bz2{,.sig}
        $pkgname.desktop
        gnu_headshadow.png
        libre.patch)
sha256sums=('6145327092b4b195a4f63d0e86f4857eeba5607ffeb69b6f3bceb36e89a19645'
            'SKIP'
            '2f9d117c1524312fb45f3e953cb0de02c525fd385a9b2b6d47308c8aaab0aedd'
            '93e3001ce152e1d142619e215a9ef07dd429943b99d21726c25da9ceb31e31cd'
            'd32f97e812c536efd9bdc7043efd6f9472a1edd9f814b453805c7c10ffea25a6')
validpgpkeys=('A57369A8BABC2542B5A0368C3C76EED7D7E04784') # Ruben Rodriguez

prepare() {
  cd "$srcdir/$pkgname-${pkgver%_*}"

  # Patch to move files directly to /usr/lib/icecat. No more symlinks.
  sed -e 's;$(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION);$(libdir)/$(MOZ_APP_NAME);g' -i config/baseconfig.mk
  sed -e 's;$(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION);$(libdir)/$(MOZ_APP_NAME)-devel;g' -i config/baseconfig.mk

  cat >.mozconfig <<END
ac_add_options --enable-application=browser

ac_add_options --prefix=/usr
ac_add_options --enable-release
ac_add_options --enable-linker=gold
ac_add_options --enable-hardening
ac_add_options --enable-optimize
ac_add_options --enable-rust-simd

# Branding
ac_add_options --enable-official-branding
ac_add_options --with-distribution-id=org.gnu

# System libraries
ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
ac_add_options --with-system-icu
ac_add_options --with-system-jpeg
ac_add_options --with-system-libvpx
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --enable-system-sqlite
ac_add_options --enable-system-ffi

# Features
ac_add_options --enable-alsa
ac_add_options --enable-startup-notification
ac_add_options --disable-crashreporter
ac_add_options --disable-updater
ac_add_options --disable-debug-symbols
ac_add_options --disable-tests
ac_add_options --disable-eme
ac_add_options --disable-gconf

ac_add_options --with-app-basename=icecat
ac_add_options --with-app-name=icecat
ac_add_options --enable-update-channel=release
END

  if [[ "$CARCH" == arm* ]]; then
    sed -i \
        -e '/enable-gold/s/^/#/' \
        -e '/enable-pie/s/^/#/' \
        -e '/enable-optimize/d' \
      .mozconfig

    cat >> .mozconfig << END
ac_add_options --disable-webrtc
ac_add_options --disable-elf-hack
ac_add_options --enable-optimize="-g -O2 -fno-schedule-insns"
END
  fi

  # Put gnu_headshadow.png in the source code
  # install -m644 "$srcdir/gnu_headshadow.png" \
  #   browser/base/content/abouthome

  # Patch and remove anything that's left
  # patch -Np1 -i "$srcdir/libre.patch"
  # rm -v browser/base/content/abouthome/snippet*.png || true
  # sed -i '\|abouthome/snippet|d
  #        ' browser/base/jar.mn

  # Load our searchplugins
  # rm -rf -- browser/locales/searchplugins
  # cp -aT -- /usr/lib/mozilla/searchplugins browser/locales/searchplugins
}

build() {
  cd "$srcdir/$pkgname-${pkgver%_*}"

  ./mach build
  ./mach buildsymbols
}

package() {
  local _icu_ver
  _icu_ver=$(pacman -S --print-format='%v' icu)
  depends+=("icu>=${_icu_ver}" "icu<$((${_icu_ver%%.*} + 1))")

  cd "$srcdir/$pkgname-${pkgver%_*}"
  DESTDIR="$pkgdir" ./mach install

  _vendorjs="$pkgdir/usr/lib/$pkgname/browser/defaults/preferences/vendor.js"
  install -Dm644 /dev/stdin "$_vendorjs" <<END
// Use LANG environment variable to choose locale
pref("intl.locale.requested", "");

// Use system-provided dictionaries
pref("spellchecker.dictionary_path", "/usr/share/hunspell");

// Disable default browser checking.
pref("browser.shell.checkDefaultBrowser", false);

// Don't disable our bundled extensions in the application directory
pref("extensions.autoDisableScopes", 11);
pref("extensions.shownSelectionUI", true);

// Disable "alt" as a shortcut key to open full menu bar. Conflicts with "alt" as a modifier
pref("ui.key.menuAccessKeyFocuses", false);

// Make sure that Firefox Social stuff are empty
pref("social.whitelist", "");
pref("social.directories", "");

// Disable the GeoLocation API for content
pref("geo.enabled", false);

// Make sure that the request URL of the GeoLocation backend is empty
pref("geo.wifi.uri", "");

// Disable the least secure encryption protocols
pref("security.ssl3.ecdhe_ecdsa_rc4_128_sha", false);
pref("security.ssl3.ecdhe_rsa_rc4_128_sha", false);
pref("security.ssl3.rsa_rc4_128_md5", false);
pref("security.ssl3.rsa_rc4_128_sha", false);
END

  _distini="$pkgdir/usr/lib/$pkgname/distribution/distribution.ini"
  install -Dm644 /dev/stdin "$_distini" <<END
[Global]
id=parabola
version=1.0
about=Icecat for Parabola GNU/Linux-libre

[Preferences]
app.distributor=parabola
app.distributor.channel=$pkgname
app.partner.parabola=parabola
END

  install -m755 -d ${pkgdir}/usr/share/applications
  install -m755 -d ${pkgdir}/usr/share/pixmaps

  for i in 16 22 24 32 48 256; do
    install -Dm644 "browser/branding/official/default$i.png" \
      "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png"
  done
  install -Dm644 "browser/branding/official/content/icon64.png" \
    "$pkgdir/usr/share/icons/hicolor/64x64/apps/$pkgname.png"
  install -Dm644 "browser/branding/official/mozicon128.png" \
    "$pkgdir/usr/share/icons/hicolor/128x128/apps/$pkgname.png"
  install -Dm644 "browser/branding/official/content/about-logo.png" \
    "$pkgdir/usr/share/icons/hicolor/192x192/apps/$pkgname.png"
  install -Dm644 "browser/branding/official/content/about-logo@2x.png" \
    "$pkgdir/usr/share/icons/hicolor/384x384/apps/$pkgname.png"

  install -Dm644 ../$pkgname.desktop \
    "$pkgdir/usr/share/applications/$pkgname.desktop"

  # Install a wrapper to avoid confusion about binary path
  install -Dm755 /dev/stdin "$pkgdir/usr/bin/$pkgname" <<END
#!/bin/sh
exec /usr/lib/$pkgname/$pkgname "\$@"
END

  # Replace duplicate binary with wrapper
  # https://bugzilla.mozilla.org/show_bug.cgi?id=658850
  ln -srf "$pkgdir/usr/bin/$pkgname" \
    "$pkgdir/usr/lib/$pkgname/$pkgname-bin"
}