PKGBUILD 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. # Maintainer (arch:firefox): Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
  2. # Contributor: Ionut Biru <ibiru@archlinux.org>
  3. # Contributor: Jakub Schmidtke <sjakub@gmail.com>
  4. # Contributor: Henry Jensen <hjensen@connochaetos.org>
  5. # Maintainer: Andreas Grapentin <andreas@grapentin.org>
  6. # Maintainer: Luke Shumaker <lukeshu@parabola.nu>
  7. # Contributor: André Silva <emulatorman@hyperbola.info>
  8. # Contributor: Márcio Silva <coadde@hyperbola.info>
  9. # Contributor: fauno <fauno@kiwwwi.com.ar>
  10. # Contributor: vando <facundo@esdebian.org>
  11. # Contributor: Figue <ffigue at gmail>
  12. # Contributor: evr <evanroman at gmail>
  13. # Contributor: Muhammad 'MJ' Jassim <UnbreakableMJ@gmail.com>
  14. pkgname=icecat
  15. _pkgver=60.3.0-gnu1
  16. pkgver=${_pkgver//-/_}
  17. pkgrel=1.testing1
  18. pkgdesc="GNU IceCat - a libre standalone web browser based on Mozilla Firefox."
  19. arch=(x86_64 i686 armv7h)
  20. license=(MPL GPL LGPL)
  21. url="http://www.gnu.org/software/gnuzilla/"
  22. depends=(gtk3 gtk2 mozilla-common libxt startup-notification mime-types dbus-glib ffmpeg
  23. nss hunspell-en_US sqlite ttf-font libpulse libvpx icu)
  24. makedepends=(unzip zip diffutils python2 yasm mesa imake gconf inetutils xorg-server-xvfb
  25. autoconf2.13 rust clang llvm jack mozilla-searchplugins)
  26. optdepends=('networkmanager: Location detection via available WiFi networks'
  27. 'libnotify: Notification integration'
  28. 'pulseaudio: Audio support'
  29. 'speech-dispatcher: Text-to-Speech')
  30. options=(!emptydirs !makeflags !strip)
  31. source=(http://ftp.gnu.org/gnu/gnuzilla/${_pkgver%-*}/$pkgname-$_pkgver.tar.bz2{,.sig}
  32. $pkgname.desktop
  33. gnu_headshadow.png
  34. libre.patch)
  35. sha256sums=('6145327092b4b195a4f63d0e86f4857eeba5607ffeb69b6f3bceb36e89a19645'
  36. 'SKIP'
  37. '2f9d117c1524312fb45f3e953cb0de02c525fd385a9b2b6d47308c8aaab0aedd'
  38. '93e3001ce152e1d142619e215a9ef07dd429943b99d21726c25da9ceb31e31cd'
  39. 'd32f97e812c536efd9bdc7043efd6f9472a1edd9f814b453805c7c10ffea25a6')
  40. validpgpkeys=('A57369A8BABC2542B5A0368C3C76EED7D7E04784') # Ruben Rodriguez
  41. prepare() {
  42. cd "$srcdir/$pkgname-${pkgver%_*}"
  43. # Patch to move files directly to /usr/lib/icecat. No more symlinks.
  44. sed -e 's;$(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION);$(libdir)/$(MOZ_APP_NAME);g' -i config/baseconfig.mk
  45. sed -e 's;$(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION);$(libdir)/$(MOZ_APP_NAME)-devel;g' -i config/baseconfig.mk
  46. cat >.mozconfig <<END
  47. ac_add_options --enable-application=browser
  48. ac_add_options --prefix=/usr
  49. ac_add_options --enable-release
  50. ac_add_options --enable-linker=gold
  51. ac_add_options --enable-hardening
  52. ac_add_options --enable-optimize
  53. ac_add_options --enable-rust-simd
  54. # Branding
  55. ac_add_options --enable-official-branding
  56. ac_add_options --with-distribution-id=org.gnu
  57. # System libraries
  58. ac_add_options --with-system-zlib
  59. ac_add_options --with-system-bz2
  60. ac_add_options --with-system-icu
  61. ac_add_options --with-system-jpeg
  62. ac_add_options --with-system-libvpx
  63. ac_add_options --with-system-nspr
  64. ac_add_options --with-system-nss
  65. ac_add_options --enable-system-sqlite
  66. ac_add_options --enable-system-ffi
  67. # Features
  68. ac_add_options --enable-alsa
  69. ac_add_options --enable-startup-notification
  70. ac_add_options --disable-crashreporter
  71. ac_add_options --disable-updater
  72. ac_add_options --disable-debug-symbols
  73. ac_add_options --disable-tests
  74. ac_add_options --disable-eme
  75. ac_add_options --disable-gconf
  76. ac_add_options --with-app-basename=icecat
  77. ac_add_options --with-app-name=icecat
  78. ac_add_options --enable-update-channel=release
  79. END
  80. if [[ "$CARCH" == arm* ]]; then
  81. sed -i \
  82. -e '/enable-gold/s/^/#/' \
  83. -e '/enable-pie/s/^/#/' \
  84. -e '/enable-optimize/d' \
  85. .mozconfig
  86. cat >> .mozconfig << END
  87. ac_add_options --disable-webrtc
  88. ac_add_options --disable-elf-hack
  89. ac_add_options --enable-optimize="-g -O2 -fno-schedule-insns"
  90. END
  91. fi
  92. # Put gnu_headshadow.png in the source code
  93. # install -m644 "$srcdir/gnu_headshadow.png" \
  94. # browser/base/content/abouthome
  95. # Patch and remove anything that's left
  96. # patch -Np1 -i "$srcdir/libre.patch"
  97. # rm -v browser/base/content/abouthome/snippet*.png || true
  98. # sed -i '\|abouthome/snippet|d
  99. # ' browser/base/jar.mn
  100. # Load our searchplugins
  101. # rm -rf -- browser/locales/searchplugins
  102. # cp -aT -- /usr/lib/mozilla/searchplugins browser/locales/searchplugins
  103. }
  104. build() {
  105. cd "$srcdir/$pkgname-${pkgver%_*}"
  106. ./mach build
  107. ./mach buildsymbols
  108. }
  109. package() {
  110. local _icu_ver
  111. _icu_ver=$(pacman -S --print-format='%v' icu)
  112. depends+=("icu>=${_icu_ver}" "icu<$((${_icu_ver%%.*} + 1))")
  113. cd "$srcdir/$pkgname-${pkgver%_*}"
  114. DESTDIR="$pkgdir" ./mach install
  115. _vendorjs="$pkgdir/usr/lib/$pkgname/browser/defaults/preferences/vendor.js"
  116. install -Dm644 /dev/stdin "$_vendorjs" <<END
  117. // Use LANG environment variable to choose locale
  118. pref("intl.locale.requested", "");
  119. // Use system-provided dictionaries
  120. pref("spellchecker.dictionary_path", "/usr/share/hunspell");
  121. // Disable default browser checking.
  122. pref("browser.shell.checkDefaultBrowser", false);
  123. // Don't disable our bundled extensions in the application directory
  124. pref("extensions.autoDisableScopes", 11);
  125. pref("extensions.shownSelectionUI", true);
  126. // Disable "alt" as a shortcut key to open full menu bar. Conflicts with "alt" as a modifier
  127. pref("ui.key.menuAccessKeyFocuses", false);
  128. // Make sure that Firefox Social stuff are empty
  129. pref("social.whitelist", "");
  130. pref("social.directories", "");
  131. // Disable the GeoLocation API for content
  132. pref("geo.enabled", false);
  133. // Make sure that the request URL of the GeoLocation backend is empty
  134. pref("geo.wifi.uri", "");
  135. // Disable the least secure encryption protocols
  136. pref("security.ssl3.ecdhe_ecdsa_rc4_128_sha", false);
  137. pref("security.ssl3.ecdhe_rsa_rc4_128_sha", false);
  138. pref("security.ssl3.rsa_rc4_128_md5", false);
  139. pref("security.ssl3.rsa_rc4_128_sha", false);
  140. END
  141. _distini="$pkgdir/usr/lib/$pkgname/distribution/distribution.ini"
  142. install -Dm644 /dev/stdin "$_distini" <<END
  143. [Global]
  144. id=parabola
  145. version=1.0
  146. about=Icecat for Parabola GNU/Linux-libre
  147. [Preferences]
  148. app.distributor=parabola
  149. app.distributor.channel=$pkgname
  150. app.partner.parabola=parabola
  151. END
  152. install -m755 -d ${pkgdir}/usr/share/applications
  153. install -m755 -d ${pkgdir}/usr/share/pixmaps
  154. for i in 16 22 24 32 48 256; do
  155. install -Dm644 "browser/branding/official/default$i.png" \
  156. "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png"
  157. done
  158. install -Dm644 "browser/branding/official/content/icon64.png" \
  159. "$pkgdir/usr/share/icons/hicolor/64x64/apps/$pkgname.png"
  160. install -Dm644 "browser/branding/official/mozicon128.png" \
  161. "$pkgdir/usr/share/icons/hicolor/128x128/apps/$pkgname.png"
  162. install -Dm644 "browser/branding/official/content/about-logo.png" \
  163. "$pkgdir/usr/share/icons/hicolor/192x192/apps/$pkgname.png"
  164. install -Dm644 "browser/branding/official/content/about-logo@2x.png" \
  165. "$pkgdir/usr/share/icons/hicolor/384x384/apps/$pkgname.png"
  166. install -Dm644 ../$pkgname.desktop \
  167. "$pkgdir/usr/share/applications/$pkgname.desktop"
  168. # Install a wrapper to avoid confusion about binary path
  169. install -Dm755 /dev/stdin "$pkgdir/usr/bin/$pkgname" <<END
  170. #!/bin/sh
  171. exec /usr/lib/$pkgname/$pkgname "\$@"
  172. END
  173. # Replace duplicate binary with wrapper
  174. # https://bugzilla.mozilla.org/show_bug.cgi?id=658850
  175. ln -srf "$pkgdir/usr/bin/$pkgname" \
  176. "$pkgdir/usr/lib/$pkgname/$pkgname-bin"
  177. }