PKGBUILD 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. # Maintainer: Figue <ffigue at gmail>
  2. # Contributor (Parabola): fauno <fauno@kiwwwi.com.ar>
  3. # Thank you very much to the older contributors:
  4. # Contributor: evr <evanroman at gmail>
  5. # Contributor: Muhammad 'MJ' Jassim <UnbreakableMJ@gmail.com>
  6. pkgname=icecat
  7. pkgver=78.10.0
  8. pkgrel=2
  9. _commit=b72c22186cf381d7b1f93be550c9da30865d03b4
  10. pkgdesc="GNU version of the Firefox browser."
  11. arch=(x86_64)
  12. url="http://www.gnu.org/software/gnuzilla/"
  13. license=('GPL' 'MPL' 'LGPL')
  14. depends=(gtk3 libxt mime-types dbus-glib ffmpeg nss ttf-font libpulse)
  15. makedepends=(m4 unzip zip diffutils python2-setuptools yasm mesa imake inetutils
  16. xorg-server-xvfb autoconf2.13 rust clang llvm jack gtk2
  17. python nodejs python2-psutil cbindgen nasm wget mercurial git lld perl-file-rename)
  18. optdepends=('networkmanager: Location detection via available WiFi networks'
  19. 'libnotify: Notification integration'
  20. 'pulseaudio: Audio support'
  21. 'speech-dispatcher: Text-to-Speech'
  22. 'hunspell-en_US: Spell checking, American English')
  23. options=(!emptydirs !makeflags !strip)
  24. source=(https://git.savannah.gnu.org/cgit/gnuzilla.git/snapshot/gnuzilla-${_commit}.tar.gz
  25. icecat.desktop icecat-safe.desktop
  26. "0001-Use-remoting-name-for-GDK-application-names.patch::https://raw.githubusercontent.com/archlinux/svntogit-packages/0adcedc05ce67d53268575f8801c8de872206901/firefox/trunk/0001-Use-remoting-name-for-GDK-application-names.patch"
  27. rust_1.48.patch.gz)
  28. sha256sums=('a92affc4da1831db842f4090590e26c4b211975d79894578c6da10430b64c9ce'
  29. 'e00dbf01803cdd36fd9e1c0c018c19bb6f97e43016ea87062e6134bdc172bc7d'
  30. '33dd309eeb99ec730c97ba844bf6ce6c7840f7d27da19c82389cdefee8c20208'
  31. 'e0eaec8ddd24bbebf4956563ebc6d7a56f8dada5835975ee4d320dd3d0c9c442'
  32. 'c7f867ccee684939c9f0a9c30ea69127077bbe43af545a03f09dfbbdc02545a9')
  33. prepare() {
  34. cd gnuzilla-${_commit}
  35. # Uncomment if you have issues with gpg download... WITH PROXY gpg doesn't work!!!!!!
  36. #sed -e 's/^verify_sources$//g' -i makeicecat
  37. mkdir output || rm -rf output/* # Clean output just in case is already an old build there
  38. if [ -f "${SRCDEST}/firefox-${pkgver}esr.source.tar.xz" ] && [ -f "${SRCDEST}/firefox-${pkgver}esr.source.tar.xz.asc" ]; then cp -f "${SRCDEST}"/firefox-${pkgver}esr.source.tar.xz{,.asc} output/ ; fi
  39. # Patches to avoid download sources if you have in your $startdir
  40. sed -e '/rm -rf output/d' -i makeicecat
  41. sed -e 's/wget -N/wget -nv -Nc/g' -i makeicecat
  42. # Other patches
  43. sed '/^finalize_sourceball$/d' -i makeicecat
  44. # If we want to avoid all locales, we can use variable _SPEED=y to build it with only 1 locale. Use variable _LOCALE to define it
  45. if true; then # if [[ $_SPEED =~ [y|Y] ]]; then
  46. msg2 "Building without all locales..."
  47. sed -e 's/DEVEL=0/DEVEL=1/g' -i makeicecat
  48. # Also you can choose your locale using external variable _LOCALE. By default in upstream script this locale is es-ES
  49. [ -z "$_LOCALE" ] || sed -e "s/es-ES/$_LOCALE/g" -i makeicecat && echo "$_LOCALE" > custom-shipped-locales
  50. rm -rf data/files-to-append/l10n/*
  51. fi
  52. # Produce IceCat sources
  53. bash makeicecat
  54. cd output/icecat-${pkgver}
  55. # https://bugzilla.mozilla.org/show_bug.cgi?id=1530052
  56. patch -Np1 -i ../../../0001-Use-remoting-name-for-GDK-application-names.patch
  57. # https://bugzilla.mozilla.org/show_bug.cgi?id=1667736
  58. patch -Np1 -i ../../../rust_1.48.patch
  59. # Patch to move files directly to /usr/lib/icecat. No more symlinks.
  60. sed -e 's;$(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION);$(libdir)/$(MOZ_APP_NAME);g' -i config/baseconfig.mk
  61. sed -e 's;$(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION);$(libdir)/$(MOZ_APP_NAME)-devel;g' -i config/baseconfig.mk
  62. printf '%b' " \e[1;36m->\e[0m\033[1m Starting build...\n"
  63. cat >./mozconfig <<END
  64. ac_add_options --enable-application=browser
  65. ac_add_options --prefix=/usr
  66. ac_add_options --enable-release
  67. ac_add_options --enable-hardening
  68. ac_add_options --enable-optimize
  69. ac_add_options --enable-rust-simd
  70. ac_add_options --enable-linker=lld
  71. ac_add_options --disable-elf-hack
  72. export CC='clang --target=x86_64-unknown-linux-gnu'
  73. export CXX='clang++ --target=x86_64-unknown-linux-gnu'
  74. export AR=llvm-ar
  75. export NM=llvm-nm
  76. export RANLIB=llvm-ranlib
  77. # Branding
  78. ac_add_options --enable-official-branding
  79. ac_add_options --with-distribution-id=nu.parabola
  80. ac_add_options --with-unsigned-addon-scopes=app,system
  81. # System libraries
  82. ac_add_options --with-system-nspr
  83. ac_add_options --with-system-nss
  84. # Features
  85. ac_add_options --enable-alsa
  86. ac_add_options --enable-jack
  87. ac_add_options --disable-crashreporter
  88. ac_add_options --disable-updater
  89. ac_add_options --disable-tests
  90. ac_add_options --disable-eme
  91. ac_add_options --with-app-basename=icecat
  92. ac_add_options --with-app-name=icecat
  93. END
  94. }
  95. build() {
  96. cd gnuzilla-${_commit}/output/icecat-${pkgver}
  97. export MOZ_NOSPAM=1
  98. export MOZBUILD_STATE_PATH="$srcdir/mozbuild"
  99. export MACH_USE_SYSTEM_PYTHON=1
  100. # LTO needs more open files
  101. ulimit -n 4096
  102. # clang-{9,10,11} -> error: unknown argument: '-fvar-tracking-assignments'
  103. CFLAGS="${CFLAGS/-fvar-tracking-assignments/}"
  104. CXXFLAGS="${CXXFLAGS/-fvar-tracking-assignments/}"
  105. # -fno-plt with cross-LTO causes obscure LLVM errors
  106. # LLVM ERROR: Function Import: link error
  107. CFLAGS="${CFLAGS/-fno-plt/}"
  108. CXXFLAGS="${CXXFLAGS/-fno-plt/}"
  109. ./mach build
  110. #./mach buildsymbols
  111. }
  112. package () {
  113. cd gnuzilla-${_commit}/output/icecat-${pkgver}
  114. # Remove cose.manifest and cose.sig cause march install fails
  115. find obj-x86_64-pc-linux-gnu/dist/bin/browser/extensions -name cose.manifest -delete
  116. find obj-x86_64-pc-linux-gnu/dist/bin/browser/extensions -name cose.sig -delete
  117. DESTDIR="$pkgdir" ./mach install
  118. local _vendorjs="$pkgdir/usr/lib/${pkgname}/browser/defaults/preferences/vendor.js"
  119. install -Dvm644 /dev/stdin "$_vendorjs" <<END
  120. // Use LANG environment variable to choose locale
  121. pref("intl.locale.requested", "");
  122. // Disable default browser checking.
  123. pref("browser.shell.checkDefaultBrowser", false);
  124. // Opt all of us into e10s, instead of just 50%
  125. pref("browser.tabs.remote.autostart", true);
  126. END
  127. local distini="$pkgdir/usr/lib/$pkgname/distribution/distribution.ini"
  128. install -Dvm644 /dev/stdin "$distini" <<END
  129. [Global]
  130. id=parabola
  131. version=1.0
  132. about=GNU IceCat for Parabola GNU/Linux-libre
  133. [Preferences]
  134. app.distributor=parabola
  135. app.distributor.channel=$pkgname
  136. app.partner.archlinux=parabola
  137. END
  138. printf '%b' " \e[1;36m->\e[0m\033[1m Finishing...\n"
  139. install -m755 -d ${pkgdir}/usr/share/applications
  140. install -m755 -d ${pkgdir}/usr/share/pixmaps
  141. for i in 16 32 48; do
  142. install -Dm644 browser/branding/official/default${i}.png \
  143. "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/icecat.png"
  144. done
  145. install -Dm644 browser/branding/official/default48.png ${pkgdir}/usr/share/pixmaps/icecat.png
  146. install -Dm644 ${srcdir}/icecat.desktop ${pkgdir}/usr/share/applications/
  147. install -Dm644 ${srcdir}/icecat-safe.desktop ${pkgdir}/usr/share/applications/
  148. }