PKGBUILD 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. # Maintainer (arch): Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
  2. # Contributor: Ionut Biru <ibiru@archlinux.org>
  3. # Contributor: Jakub Schmidtke <sjakub@gmail.com>
  4. # Maintainer (aur): Figue <ffigue at gmail>
  5. # Contributor: fauno <fauno@kiwwwi.com.ar>
  6. # Contributor: evr <evanroman at gmail>
  7. # Contributor: Muhammad 'MJ' Jassim <UnbreakableMJ@gmail.com>
  8. # Contributor: vando <facundo@esdebian.org>
  9. # Contributor: André Silva <emulatorman@hyperbola.info>
  10. # Contributor: Henry Jensen <hjensen@connochaetos.org>
  11. # Contributor: Luke Shumaker <lukeshu@parabola.nu>
  12. # Contributor: Márcio Silva <coadde@hyperbola.info>
  13. # Maintainer: Andreas Grapentin <andreas@grapentin.org>
  14. # Contributor: bill-auger <bill-auger@programmer.net>
  15. # Contributor: grizzlyuser <grizzlyuser@protonmail.com>
  16. # NOTE: icecat (60.7 < V <= 78.9) are not upstream releases
  17. # upstream releases would normally have '-gnu' appended to $_upstream_ver
  18. # this build is based on gnuzilla VCS developement sources
  19. # rev: 8b54aee6bd0c39f043bbba7a654870e032a910bc
  20. # NOTE: this PKGBUILD is a temporary WIP
  21. # it is based on the AUR PKGBUILD, which also runs makeicecat at build-time
  22. # makeicecat requires an active internet connection though, so that code was removed
  23. # this was introduced hastily, because 'icu' had changed,
  24. # and the 78.9.0 parabola PKGBUILD had "sandbox violation" problems at the time
  25. # eventually, the original parabola PKGBUILD should be restored/merged with this recipe
  26. # per rev: 04c332d29f362070a883baa3eab40df4a6f701d3
  27. # TODO: this PKGBUILD has several issues:
  28. # - it is adapted only for x86_64
  29. # - it has branding issues eg: missing "topsites", serach-engines, previous parabola patching
  30. # - it has two switchable implememtations (per '_make_srcball' - both work);
  31. # but preparing the upstream source-ball requires network access,
  32. # and the source-ball is only necessary becuase gnuzilla has not published one for v78
  33. pkgname=icecat
  34. _upstream_ver=78.9.0-pre # -gnu
  35. _mozilla_ver=${_upstream_ver%-*}
  36. pkgver=${_upstream_ver//-/_}
  37. pkgrel=1
  38. _commit=8b54aee6bd0c39f043bbba7a654870e032a910bc
  39. pkgdesc="The GNU web browser, based on Mozilla Firefox ESR"
  40. arch=(x86_64)
  41. url="http://www.gnu.org/software/gnuzilla/"
  42. license=('GPL' 'MPL' 'LGPL')
  43. depends=(gtk3 libxt mime-types dbus-glib ffmpeg nss ttf-font libpulse)
  44. makedepends=(m4 unzip zip diffutils python2-setuptools yasm mesa imake inetutils
  45. xorg-server-xvfb autoconf2.13 rust clang llvm jack gtk2
  46. python nodejs python2-psutil cbindgen nasm lld perl-file-rename)
  47. optdepends=('networkmanager: Location detection via available WiFi networks'
  48. 'libnotify: Notification integration'
  49. 'pulseaudio: Audio support'
  50. 'speech-dispatcher: Text-to-Speech'
  51. 'hunspell-en_US: Spell checking, American English')
  52. options=(!emptydirs !makeflags !strip)
  53. source=(https://repo.parabola.nu/other/${pkgname}/${pkgname}-${_upstream_ver}.tar.bz2{,.sig}
  54. icecat.desktop icecat-safe.desktop
  55. 0001-Use-remoting-name-for-GDK-application-names.patch
  56. rust_1.48.patch.gz)
  57. sha256sums=('6f777cbea1066ba10db64967d55b9204e14bbea9a7836c4bf7e7a1e642f97716'
  58. 'SKIP'
  59. 'e00dbf01803cdd36fd9e1c0c018c19bb6f97e43016ea87062e6134bdc172bc7d'
  60. '33dd309eeb99ec730c97ba844bf6ce6c7840f7d27da19c82389cdefee8c20208'
  61. 'e0eaec8ddd24bbebf4956563ebc6d7a56f8dada5835975ee4d320dd3d0c9c442'
  62. 'c7f867ccee684939c9f0a9c30ea69127077bbe43af545a03f09dfbbdc02545a9')
  63. validpgpkeys=('3954A7AB837D0EA9CFA9798925DB7D9B5A8D4B40') # bill-auger
  64. prepare() {
  65. cd "${srcdir}"/$pkgname-${_mozilla_ver}/
  66. # https://bugzilla.mozilla.org/show_bug.cgi?id=1530052
  67. patch -Np1 -i "${srcdir}"/0001-Use-remoting-name-for-GDK-application-names.patch
  68. # https://bugzilla.mozilla.org/show_bug.cgi?id=1667736
  69. patch -Np1 -i "${srcdir}"/rust_1.48.patch
  70. # Patch to move files directly to /usr/lib/icecat. No more symlinks.
  71. sed -e 's;$(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION);$(libdir)/$(MOZ_APP_NAME);g' -i config/baseconfig.mk
  72. sed -e 's;$(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION);$(libdir)/$(MOZ_APP_NAME)-devel;g' -i config/baseconfig.mk
  73. printf '%b' " \e[1;36m->\e[0m\033[1m Starting build...\n"
  74. cat >./mozconfig <<END
  75. ac_add_options --enable-application=browser
  76. ac_add_options --prefix=/usr
  77. ac_add_options --enable-release
  78. ac_add_options --enable-hardening
  79. ac_add_options --enable-optimize
  80. ac_add_options --enable-rust-simd
  81. ac_add_options --enable-linker=lld
  82. ac_add_options --disable-elf-hack
  83. export CC='clang --target=x86_64-unknown-linux-gnu'
  84. export CXX='clang++ --target=x86_64-unknown-linux-gnu'
  85. export AR=llvm-ar
  86. export NM=llvm-nm
  87. export RANLIB=llvm-ranlib
  88. # Branding
  89. ac_add_options --enable-official-branding
  90. ac_add_options --with-distribution-id=nu.parabola
  91. ac_add_options --with-unsigned-addon-scopes=app,system
  92. # System libraries
  93. ac_add_options --with-system-nspr
  94. ac_add_options --with-system-nss
  95. # Features
  96. ac_add_options --enable-alsa
  97. ac_add_options --enable-jack
  98. ac_add_options --disable-crashreporter
  99. ac_add_options --disable-updater
  100. ac_add_options --disable-tests
  101. ac_add_options --disable-eme
  102. ac_add_options --with-app-basename=icecat
  103. ac_add_options --with-app-name=icecat
  104. END
  105. }
  106. build() {
  107. cd "${srcdir}"/$pkgname-${_mozilla_ver}/
  108. export MOZ_NOSPAM=1
  109. export MOZBUILD_STATE_PATH="$srcdir/mozbuild"
  110. export MACH_USE_SYSTEM_PYTHON=1
  111. # LTO needs more open files
  112. ulimit -n 4096
  113. # clang-{9,10,11} -> error: unknown argument: '-fvar-tracking-assignments'
  114. CFLAGS="${CFLAGS/-fvar-tracking-assignments/}"
  115. CXXFLAGS="${CXXFLAGS/-fvar-tracking-assignments/}"
  116. # -fno-plt with cross-LTO causes obscure LLVM errors
  117. # LLVM ERROR: Function Import: link error
  118. CFLAGS="${CFLAGS/-fno-plt/}"
  119. CXXFLAGS="${CXXFLAGS/-fno-plt/}"
  120. ./mach build
  121. #./mach buildsymbols
  122. }
  123. package () {
  124. cd "${srcdir}"/$pkgname-${_mozilla_ver}/
  125. # Remove cose.manifest and cose.sig cause march install fails
  126. find obj-x86_64-pc-linux-gnu/dist/bin/browser/extensions -name cose.manifest -delete
  127. find obj-x86_64-pc-linux-gnu/dist/bin/browser/extensions -name cose.sig -delete
  128. DESTDIR="$pkgdir" ./mach install
  129. local _vendorjs="$pkgdir/usr/lib/${pkgname}/browser/defaults/preferences/vendor.js"
  130. install -Dvm644 /dev/stdin "$_vendorjs" <<END
  131. // Use LANG environment variable to choose locale
  132. pref("intl.locale.requested", "");
  133. // Disable default browser checking.
  134. pref("browser.shell.checkDefaultBrowser", false);
  135. // Opt all of us into e10s, instead of just 50%
  136. pref("browser.tabs.remote.autostart", true);
  137. END
  138. local distini="$pkgdir/usr/lib/$pkgname/distribution/distribution.ini"
  139. install -Dvm644 /dev/stdin "$distini" <<END
  140. [Global]
  141. id=parabola
  142. version=1.0
  143. about=Icecat for Parabola GNU/Linux-libre
  144. [Preferences]
  145. app.distributor=parabola
  146. app.distributor.channel=$pkgname
  147. app.partner.parabola=parabola
  148. END
  149. printf '%b' " \e[1;36m->\e[0m\033[1m Finishing...\n"
  150. install -m755 -d ${pkgdir}/usr/share/applications
  151. install -m755 -d ${pkgdir}/usr/share/pixmaps
  152. for i in 16 32 48; do
  153. install -Dm644 browser/branding/official/default${i}.png \
  154. "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/icecat.png"
  155. done
  156. install -Dm644 browser/branding/official/default48.png ${pkgdir}/usr/share/pixmaps/icecat.png
  157. install -Dm644 ${srcdir}/icecat.desktop ${pkgdir}/usr/share/applications/
  158. install -Dm644 ${srcdir}/icecat-safe.desktop ${pkgdir}/usr/share/applications/
  159. }