PKGBUILD 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. # Maintainer (arch): Levente Polyak <anthraxx[at]archlinux[dot]org>
  2. # Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
  3. # Contributor: Ionut Biru <ibiru@archlinux.org>
  4. # Contributor: Alexander Baldeck <alexander@archlinux.org>
  5. # Contributor: Dale Blount <dale@archlinux.org>
  6. # Contributor: Anders Bostrom <anders.bostrom@home.se>
  7. # Maintainer: Andreas Grapentin <andreas@grapentin.org>
  8. # Contributor: André Silva <emulatorman@hyperbola.info>
  9. # Contributor: Márcio Silva <coadde@hyperbola.info>
  10. # Contributor: Luke R. <g4jc@openmailbox.org>
  11. # Contributor: Isaac David <isacdaavid@isacdaavid.info>
  12. # Contributor: bill-auger <bill-auger@programmer.net>
  13. # parabola changes and rationale:
  14. # - rebranded to icedove
  15. # - added makedepends for branding: quilt mozilla-searchplugins imagemagick
  16. # - disabled tests, they break in an environment without network access.
  17. # - disabled geo-location
  18. _pkgname=thunderbird
  19. pkgname=icedove
  20. epoch=1
  21. pkgver=78.9.1
  22. pkgrel=1
  23. pkgrel+=.parabola1
  24. _brandingver=78.9
  25. _brandingrel=1
  26. pkgdesc='Standalone mail and news reader based on Mozilla Thunderbird'
  27. url=https://wiki.parabola.nu/${pkgname}
  28. arch=(x86_64)
  29. arch+=(i686 armv7h)
  30. license=(MPL GPL LGPL)
  31. depends=(
  32. glibc gtk3 libgdk-3.so mime-types dbus libdbus-1.so dbus-glib alsa-lib nss
  33. hunspell sqlite ttf-font libvpx libvpx.so zlib bzip2 botan libwebp libevent
  34. libjpeg-turbo libffi nspr gcc-libs libx11 libxrender libxfixes libxext
  35. libxcomposite libxdamage pango libpango-1.0.so cairo gdk-pixbuf2 icu
  36. libicui18n.so libicuuc.so freetype2 libfreetype.so fontconfig
  37. libfontconfig.so glib2 libglib-2.0.so pixman libpixman-1.so gnupg
  38. )
  39. optdepends=(
  40. 'libotr: OTR support for active one-to-one chats'
  41. )
  42. makedepends=(
  43. unzip zip diffutils python python-setuptools yasm nasm mesa imake libpulse
  44. inetutils xorg-server-xvfb autoconf2.13 rust clang llvm gtk2 cbindgen nodejs
  45. gawk perl findutils libotr
  46. )
  47. #makedepends[15]='llvm10' # FIXME: DEBUG: | rustup: error while loading shared libraries: libLLVM-10.so: cannot open shared object file: No such file or directory
  48. # # ERROR: Command `rustup which rustc` failed with exit status 127.
  49. makedepends+=(quilt imagemagick)
  50. replaces=(${_pkgname})
  51. options=(!emptydirs !makeflags)
  52. source=(https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/$pkgver/source/thunderbird-$pkgver.source.tar.xz{,.asc}
  53. $pkgname.desktop
  54. vendor-prefs.js
  55. distribution.ini
  56. mozconfig.cfg
  57. configure-fix-passing-system-bzip2-ldflags.patch
  58. thunderbird-78.5-rust-1.48.patch)
  59. source+=(https://repo.parabola.nu/other/icedove/${pkgname}_$_brandingver-$_brandingrel.branding.tar.xz{,.sig})
  60. source_armv7h=(arm-wasm-vfp.patch)
  61. sha512sums=('fa27a327ce10a0c16877ac02338aace257f60f69af40d12ae5bb2055f6536db9ba45995765ac0eaa1aea2fa2b353ac9dc6eb06fcdf6cb4ae6fafcd65fe5970c6'
  62. 'SKIP'
  63. 'a3c9815491d9bed0440c60f35867a5b8a2a1343521f288035fcc46e651a11b926c75a9eca2d262b43d510a7a7119709b53637f1b00ddbbee8e5b0a4b33d7b8fd'
  64. 'e21d30a8b79724eda3488ac2bf9dfeb0c7f6bf39e59c37f17574b529d33043765eb54408a55fcbf6f3afa7a58ca99124992d443cdff23ac5c9bdbff33c75f60f'
  65. '31d46f91d9612d30d8553a19d0d309d743467e58b568a4aeea3caf6bd805ba00656561c84a1511c59bce1cf24ba323bfad2cd26a19985f1bf7dfb6d282642972'
  66. '1eba1593ff0a9642d89e6d3e03388b1aef00437b2f6c1f0d81d250d9845b80e057c246eaeb31d8d22001abd65556a9603d1db597baf864481a5bfb7000886b29'
  67. 'e3ed2708b8354015cb3d2c81048d1ce4932d1effbe2b40efa7cf9b45c1b923b9fd708645e2f8aa0136a485a3f7ce6b396b85721aaf535a4a764fd5005fb7e222'
  68. 'bbb8b0e7b9c67372eb22e1d6b6b5758fe504ded84c40a076d4a064374a1bf34ac12d5b514b328ac9ca984d976b9e0fbde81e68a66bec915c997d6be0c0917584')
  69. sha512sums_armv7h=('c25883c4860e511a99d9fbfba5b824145c0862729101721605725f609ca2a41848b741dd100eff390f57031dc5f14af3ea30133de30f75cb20197c420ae20972')
  70. sha512sums+=('78fee952c9bc826a0a7ec262d442150177bf887349641279dafae803b9832a0dd9b8d0722cc084459077a5310eb4f6de6a8d7ffaff6741afe1359f292a373f34'
  71. 'SKIP')
  72. validpgpkeys=(14F26682D0916CDD81E37B6D61B7B526D98F0353) # Mozilla Software Releases <release@mozilla.com>
  73. validpgpkeys+=(BFA8008A8265677063B11BF47171986E4B745536 # Andreas Grapentin
  74. 3954A7AB837D0EA9CFA9798925DB7D9B5A8D4B40) # bill-auger
  75. prepare() {
  76. cd $_pkgname-$pkgver
  77. echo "${noextract[@]}"
  78. local src
  79. for src in "${source[@]}"; do
  80. src="${src%%::*}"
  81. src="${src##*/}"
  82. [[ $src = *.patch ]] || continue
  83. [[ $src = arm-wasm-vfp.patch ]] && continue # defer parabola patches
  84. echo "Applying patch $src..."
  85. patch -Np1 < "../$src"
  86. done
  87. cp ../mozconfig.cfg .mozconfig
  88. sed "s|@PWD@|${PWD@Q}|g" -i .mozconfig
  89. case "${CARCH}" in
  90. armv*)
  91. patch -Np1 -i "${srcdir}"/arm-wasm-vfp.patch
  92. sed -i '/--enable-linker=gold/d' .mozconfig
  93. sed -i '/--enable-hardening/d' .mozconfig
  94. sed -i '/--enable-optimize/d' .mozconfig
  95. export MOZ_DEBUG_FLAGS=" "
  96. export CFLAGS+=" -g0"
  97. export CXXFLAGS+=" -g0"
  98. export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
  99. export RUSTFLAGS="-Cdebuginfo=0"
  100. cat >> .mozconfig <<END
  101. ac_add_options --disable-webrtc
  102. ac_add_options --disable-elf-hack
  103. ac_add_options --enable-optimize="-g0 -O2"
  104. END
  105. ;;
  106. i686)
  107. sed -i 's/--enable-linker=gold/--enable-linker=bfd/' .mozconfig
  108. LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
  109. export LDFLAGS
  110. ;;
  111. esac
  112. # perform re-branding
  113. local branding_indir="${srcdir}"/${pkgname}-${_brandingver}
  114. local branding_outdir=comm/mail/branding/${pkgname}
  115. rm -rf -- ${branding_outdir}
  116. cp -aT -- "${branding_indir}"/${pkgname}-branding ${branding_outdir}
  117. export QUILT_PATCHES="${branding_indir}"/patches
  118. export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
  119. export QUILT_DIFF_ARGS='--no-timestamps'
  120. quilt push -av
  121. # generate icons
  122. for i in 16 22 24 32; do
  123. rsvg-convert -w ${i} -h ${i} "${branding_indir}"/app-icons/${pkgname}_small.svg \
  124. -o "${branding_outdir}/default${i}.png"
  125. done
  126. for i in 48 64 128 256; do
  127. rsvg-convert -w ${i} -h ${i} "${branding_indir}"/app-icons/${pkgname}_big.svg \
  128. -o "${branding_outdir}/default${i}.png"
  129. done
  130. cp "${branding_indir}"/logo/icedove_icon.svg ${branding_outdir}/
  131. cp -av "${branding_indir}"/preview.png comm/mail/themes/linux/mail/preview.png
  132. # Patch search-engines config
  133. local search_engines_sed_cmd='s|https://duckduckgo.com/|https://html.duckduckgo.com/html/|'
  134. local engines_cfg_dir=comm/mail/components/search/extensions
  135. sed -i "${search_engines_sed_cmd}" ${engines_cfg_dir}/ddg/manifest.json
  136. # Delete unused search engine configs
  137. find ${engines_cfg_dir} -mindepth 1 -maxdepth 1 \
  138. -not -name ddg \
  139. -not -name wikipedia \
  140. -exec rm -rf {} \;
  141. # Patch and remove anything that's left
  142. sed -i '\|Phishing Protection|d
  143. \|UrlClassifier|d
  144. \|URLClassifier|d
  145. \|url-classifier|d
  146. ' comm/mail/installer/package-manifest.in
  147. # TODO: this could be moved into the branding package - it already processes all-thunderbird.js
  148. sed -i '\|extensions[.]getAddons[.]get[.]url| s|https://services[.]addons[.]mozilla[.]org.\+["][)][;]|https://directory.fsf.org/wiki/Icedove");|g;
  149. \|extensions[.]getAddons[.]search[.]browseURL| s|https://addons[.]mozilla[.]org.\+["][)][;]|https://directory.fsf.org/wiki/Icedove");|g;
  150. \|extensions[.]getAddons[.]search[.]url| s|https://services[.]addons[.]mozilla[.]org.\+["][)][;]|https://directory.fsf.org/wiki/Icedove");|g;
  151. \|extensions[.]webservice[.]discoverURL| s|https://services[.]addons[.]mozilla[.]org.\+["][)][;]|https://directory.fsf.org/wiki/Icedove");|g;
  152. ' comm/mail/app/profile/all-thunderbird.js
  153. }
  154. build() {
  155. cd $_pkgname-$pkgver
  156. if [[ -n "${SOURCE_DATE_EPOCH}" ]]; then
  157. export MOZ_BUILD_DATE=$(date --date "@${SOURCE_DATE_EPOCH}" "+%Y%m%d%H%M%S")
  158. fi
  159. # clang-{9,10,11} -> error: unknown argument: '-fvar-tracking-assignments'
  160. CFLAGS="${CFLAGS/-fvar-tracking-assignments/}"
  161. CXXFLAGS="${CXXFLAGS/-fvar-tracking-assignments/}"
  162. case "${CARCH}" in
  163. armv*)
  164. export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
  165. sed -i "s/\(cargo_rustc_flags += -C lto\)/#\1/" config/rules.mk
  166. sed -i "s/debug_info = '2'/debug_info = '1'/" build/moz.configure/toolchain.configure
  167. export MOZ_MAKE_FLAGS=-j1
  168. ;;
  169. i686)
  170. sed -i "s/\(cargo_rustc_flags += -C lto\)/#\1/" config/rules.mk
  171. sed -i "s/debug_info = '2'/debug_info = '1'/" build/moz.configure/toolchain.configure
  172. export MOZ_MAKE_FLAGS=-j1
  173. ;;
  174. esac
  175. ./mach configure
  176. ./mach build
  177. ./mach buildsymbols
  178. }
  179. package() {
  180. optdepends=('libcanberra: sound support')
  181. cd $_pkgname-$pkgver
  182. DESTDIR="$pkgdir" ./mach install
  183. install -Dm 644 ../vendor-prefs.js -t "$pkgdir/usr/lib/$pkgname/defaults/pref"
  184. install -Dm 644 ../distribution.ini -t "$pkgdir/usr/lib/$pkgname/distribution"
  185. install -Dm 644 ../$pkgname.desktop -t "$pkgdir/usr/share/applications"
  186. for i in 16 22 24 32 48 64 128 256; do
  187. install -Dm644 comm/mail/branding/$pkgname/default${i}.png \
  188. "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png"
  189. done
  190. install -Dm644 comm/mail/branding/$pkgname/${pkgname}_icon.svg \
  191. "$pkgdir/usr/share/icons/hicolor/symbolic/apps/$pkgname-symbolic.svg"
  192. # Use system-provided dictionaries
  193. ln -Ts /usr/share/hunspell "$pkgdir/usr/lib/$pkgname/dictionaries"
  194. ln -Ts /usr/share/hyphen "$pkgdir/usr/lib/$pkgname/hyphenation"
  195. # Install a wrapper to avoid confusion about binary path
  196. install -Dm755 /dev/stdin "$pkgdir/usr/bin/$pkgname" <<END
  197. #!/bin/sh
  198. exec /usr/lib/$pkgname/$pkgname "\$@"
  199. END
  200. # Replace duplicate binary with wrapper
  201. # https://bugzilla.mozilla.org/show_bug.cgi?id=658850
  202. ln -srf "$pkgdir/usr/bin/$pkgname" \
  203. "$pkgdir/usr/lib/$pkgname/$pkgname-bin"
  204. }