PKGBUILD 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. # Maintainer (arch:thunderbird): 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. # libre:
  15. # - rebranded to icedove
  16. # technical:
  17. # - added i686 and armv7h arches (TODO)
  18. # - added makedepends required for rebranding
  19. # - added rebranding sources
  20. # - use system python packages
  21. # privacy:
  22. # - removed google api keys
  23. # - disabled geo-location
  24. # nonprism:
  25. # - removed nonfree search engines
  26. # - removed support for insecure chat protocols
  27. _pkgbase=thunderbird
  28. pkgbase=icedove
  29. pkgname=(icedove)
  30. epoch=1
  31. pkgver=115.11.0
  32. pkgrel=4
  33. pkgrel+=.parabola1.nonprism1
  34. _brandingver=115
  35. _brandingrel=1
  36. pkgdesc='Standalone mail and news reader from mozilla.org'
  37. pkgdesc+=', without support for unsafe for privacy protocols'
  38. url=https://wiki.parabola.nu/${pkgname}
  39. replaces=(${_pkgbase})
  40. arch=(x86_64)
  41. arch+=(i686 armv7h)
  42. license=('MPL-2.0' 'GPL-2.0-only' 'LGPL-2.1-only')
  43. depends=(
  44. glibc
  45. gtk3 libgdk-3.so libgtk-3.so
  46. mime-types
  47. dbus libdbus-1.so
  48. dbus-glib
  49. alsa-lib
  50. nss
  51. hunspell
  52. sqlite
  53. ttf-font
  54. libvpx libvpx.so
  55. zlib
  56. bzip2 libbz2.so
  57. botan2
  58. libwebp libwebp.so libwebpdemux.so
  59. libevent
  60. libjpeg-turbo
  61. libffi libffi.so
  62. nspr
  63. gcc-libs
  64. libx11
  65. libxrender
  66. libxfixes
  67. libxext
  68. libxcomposite
  69. libxdamage
  70. pango libpango-1.0.so
  71. cairo
  72. gdk-pixbuf2
  73. freetype2 libfreetype.so
  74. fontconfig libfontconfig.so
  75. glib2 libglib-2.0.so
  76. pixman libpixman-1.so
  77. gnupg
  78. json-c
  79. libcanberra
  80. ffmpeg
  81. icu libicui18n.so libicuuc.so
  82. )
  83. makedepends=(
  84. unzip zip diffutils python nasm mesa libpulse libice libsm
  85. rust clang llvm cbindgen nodejs lld
  86. gawk perl findutils libotr wasi-compiler-rt wasi-libc wasi-libc++ wasi-libc++abi
  87. )
  88. makedepends+=(quilt imagemagick)
  89. options=(!emptydirs !makeflags !lto)
  90. source=(https://archive.mozilla.org/pub/thunderbird/releases/$pkgver/source/thunderbird-$pkgver.source.tar.xz{,.asc}
  91. vendor-prefs.js
  92. distribution.ini
  93. mozconfig.cfg
  94. metainfo.patch
  95. $pkgname.desktop
  96. thunderbird-system-icu-74.patch) # https://bugzilla.mozilla.org/show_bug.cgi?id=1862601
  97. source+=(https://repo.parabola.nu/other/icedove/${pkgname}_$_brandingver-$_brandingrel.branding.tar.xz{,.sig})
  98. validpgpkeys=(
  99. 14F26682D0916CDD81E37B6D61B7B526D98F0353 # Mozilla Software Releases <release@mozilla.com>
  100. 4360FE2109C49763186F8E21EBE41E90F6F12F6D # Mozilla Software Releases <release@mozilla.com>
  101. )
  102. validpgpkeys+=(
  103. BFA8008A8265677063B11BF47171986E4B745536 # Andreas Grapentin
  104. 3954A7AB837D0EA9CFA9798925DB7D9B5A8D4B40 # bill-auger
  105. )
  106. prepare() {
  107. # parabola change: installed rust-1.77.2 in the chroot instead of using rustup
  108. # packed_simd no longer builds with 1.78.0
  109. #rustup toolchain update --profile minimal 1.77.2
  110. #rustup default 1.77.2
  111. cd $_pkgbase-$pkgver
  112. echo "${noextract[@]}"
  113. local src
  114. for src in "${source[@]}"; do
  115. src="${src%%::*}"
  116. src="${src##*/}"
  117. [[ $src = *.patch ]] || continue
  118. echo "Applying patch $src..."
  119. patch -Np1 < "../$src"
  120. done
  121. sed -e 's|73114a5c28472e77082ad259113ffafb418ed602c1741f26da3e10278b0bf93e|a88d6cc10ec1322b53a8f4c782b5133135ace0fdfcf03d1624b768788e17be0f|' \
  122. -i third_party/rust/mp4parse/.cargo-checksum.json
  123. # Make icon transparent
  124. sed -i '/^<rect/d' comm/mail/branding/thunderbird/TB-symbolic.svg
  125. cp ../mozconfig.cfg .mozconfig
  126. sed "s|@PWD@|${PWD@Q}|g" -i .mozconfig
  127. ## [CARCH-SPECIFIC CONFIG] ##
  128. case ${CARCH} in
  129. aarch64|armv7h)
  130. # TODO
  131. true
  132. ;;
  133. i686)
  134. # TODO
  135. true
  136. ;;
  137. esac
  138. ## branding ##
  139. local branding_srcdir="${srcdir}"/${pkgname}-${_brandingver}
  140. local branding_destdir="${srcdir}"/${_pkgbase}-${pkgver}/comm/mail/branding/${pkgname}
  141. local blank_svg='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"></svg>' # TODO: branding package
  142. # apply branding
  143. msg "applying parabola branding"
  144. export QUILT_PATCHES="${branding_srcdir}"/patches
  145. export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
  146. export QUILT_DIFF_ARGS='--no-timestamps'
  147. export QUILT_PC="${srcdir}"/.pc
  148. rm -rf -- ${branding_destdir}
  149. cp -aT -- "${branding_srcdir}"/${pkgname}-branding ${branding_destdir}
  150. quilt push -av
  151. # customize distribution.ini
  152. local branding_gui_ver="(${_brandingver}-${_brandingrel} branding)"
  153. sed -i "s|version=.*|version=${branding_gui_ver}|" "${srcdir}"/distribution.ini
  154. # customize .mozconfig
  155. cat >> .mozconfig <<EOF
  156. ac_add_options --disable-crashreporter
  157. ac_add_options --disable-updater
  158. EOF
  159. # stage "appdata" file
  160. cp "${branding_srcdir}"/${pkgname}.appdata.xml ${branding_destdir}/
  161. # generate icons, logos, banners
  162. for i in 16 22 24 32; do
  163. rsvg-convert -w ${i} -h ${i} "${branding_srcdir}"/app-icons/${pkgname}_small.svg \
  164. -o "${branding_destdir}/default${i}.png"
  165. done
  166. for i in 48 64 128 256; do
  167. rsvg-convert -w ${i} -h ${i} "${branding_srcdir}"/app-icons/${pkgname}_big.svg \
  168. -o "${branding_destdir}/default${i}.png"
  169. done
  170. echo "${blank_svg}" > ${branding_destdir}/${pkgname}-symbolic.svg # TODO: branding package
  171. cp "${branding_srcdir}"/preview.png comm/mail/themes/linux/mail/preview.png
  172. ## search-engines ##
  173. pushd comm/mail/components/search/extensions > /dev/null
  174. # Patch search-engines config
  175. sed -i 's|https://duckduckgo.com/|https://html.duckduckgo.com/html/|' ddg/manifest.json
  176. # Delete unused search engine configs
  177. find -mindepth 1 -maxdepth 1 \
  178. -not -name ddg \
  179. -not -name wikipedia \
  180. -exec rm -frv {} \;
  181. popd > /dev/null
  182. ## libre patching ##
  183. sed -i '\|Phishing Protection|d
  184. \|UrlClassifier|d
  185. \|URLClassifier|d
  186. \|url-classifier|d
  187. ' comm/mail/installer/package-manifest.in
  188. sed -i '\|extensions[.]getAddons[.]get[.]url| s|https://services[.]addons[.]mozilla[.]org.\+["][)][;]|https://directory.fsf.org/wiki/Icedove");|g;
  189. \|extensions[.]getAddons[.]search[.]browseURL| s|https://addons[.]mozilla[.]org.\+["][)][;]|https://directory.fsf.org/wiki/Icedove");|g;
  190. \|extensions[.]getAddons[.]search[.]url| s|https://services[.]addons[.]mozilla[.]org.\+["][)][;]|https://directory.fsf.org/wiki/Icedove");|g;
  191. \|extensions[.]webservice[.]discoverURL| s|https://services[.]addons[.]mozilla[.]org.\+["][)][;]|https://directory.fsf.org/wiki/Icedove");|g;
  192. ' comm/mail/app/profile/all-thunderbird.js
  193. sed -i '\|facebook|d
  194. \|gtalk|d
  195. \|odnoklassniki|d
  196. \|skype|d
  197. \|twitter|d
  198. \|yahoo|d
  199. ' comm/chat/moz.build
  200. sed -i '\|facebook[.]js|d
  201. \|facebook[.]manifest|d
  202. \|gtalk[.]js|d
  203. \|gtalk[.]manifest|d
  204. \|odnoklassniki[.]js|d
  205. \|odnoklassniki[.]manifest|d
  206. \|skype[.]js|d
  207. \|skype[.]manifest|d
  208. \|twitter[.]js|d
  209. \|twitter[.]manifest|d
  210. \|yahoo[.]js|d
  211. \|yahoo[.]manifest|d
  212. ' comm/mail/installer/package-manifest.in
  213. rm -rfv comm/chat/protocols/{facebook,gtalk,odnoklassniki,skype,twitter,yahoo}
  214. }
  215. build() {
  216. cd $_pkgbase-$pkgver
  217. if [[ -n "${SOURCE_DATE_EPOCH}" ]]; then
  218. export MOZ_BUILD_DATE=$(date --date "@${SOURCE_DATE_EPOCH}" "+%Y%m%d%H%M%S")
  219. fi
  220. export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system # parabola policy
  221. export MOZBUILD_STATE_PATH="${srcdir}/mozbuild"
  222. # malloc_usable_size is used in various parts of the codebase
  223. CFLAGS="${CFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
  224. CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
  225. ./mach configure
  226. ./mach build
  227. ./mach buildsymbols
  228. }
  229. package_icedove() {
  230. optdepends=(
  231. 'hunspell-en_us: Spell checking, American English'
  232. 'libotr: OTR support for active one-to-one chats'
  233. 'libnotify: Notification integration'
  234. )
  235. cd $_pkgbase-$pkgver
  236. DESTDIR="$pkgdir" ./mach install
  237. install -Dm 644 ../vendor-prefs.js -t "$pkgdir/usr/lib/$pkgname/defaults/pref"
  238. install -Dm 644 ../distribution.ini -t "$pkgdir/usr/lib/$pkgname/distribution"
  239. install -Dm 644 ../$pkgname.desktop -t "$pkgdir/usr/share/applications"
  240. install -Dm 644 comm/mail/branding/${pkgname}/${pkgname}.appdata.xml \
  241. "${pkgdir}/usr/share/metainfo/${pkgname}.appdata.xml"
  242. # NOTE: comm/mail/branding/${pkgname} is $branding_destdir in prepare()
  243. for i in 16 22 24 32 48 64 128 256; do
  244. install -Dm644 comm/mail/branding/${pkgname}/default${i}.png \
  245. "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png"
  246. done
  247. install -Dm644 comm/mail/branding/${pkgname}/${pkgname}-symbolic.svg \
  248. "$pkgdir/usr/share/icons/hicolor/symbolic/apps/$pkgname-symbolic.svg"
  249. # Use system-provided dictionaries
  250. ln -Ts /usr/share/hunspell "$pkgdir/usr/lib/$pkgname/dictionaries"
  251. ln -Ts /usr/share/hyphen "$pkgdir/usr/lib/$pkgname/hyphenation"
  252. # Install a wrapper to avoid confusion about binary path
  253. install -Dm755 /dev/stdin "$pkgdir/usr/bin/$pkgname" <<END
  254. #!/bin/sh
  255. exec /usr/lib/$pkgname/$pkgname "\$@"
  256. END
  257. # Replace duplicate binary with wrapper
  258. # https://bugzilla.mozilla.org/show_bug.cgi?id=658850
  259. ln -srf "$pkgdir/usr/bin/$pkgname" \
  260. "$pkgdir/usr/lib/$pkgname/$pkgname-bin"
  261. }
  262. sha512sums=('002f783cff7f2b50d9a29f20061fe55a1f64487b38a18dcb49217c3d7b99c2852af842decbd0347939aaf4c4c73ae66a8b04527ccd1b6db7f87aab402cb84ca1'
  263. 'SKIP'
  264. 'e21d30a8b79724eda3488ac2bf9dfeb0c7f6bf39e59c37f17574b529d33043765eb54408a55fcbf6f3afa7a58ca99124992d443cdff23ac5c9bdbff33c75f60f'
  265. '81c88dd67b9e21e563e6fdfc332ead8ab210c50ec00a43664be5cd4d75c169d6d3e9d19ca631397b39f6ddd6c4d9a9ca132757a8f8bfcc5c018d1cfdbfce7860'
  266. '27b8dd4edc7ca9e96a2238c16b11b2fdd4982e143fb2a9875dd5c98480cce4182794feb9ef51fee79c6db6fed7a803d3535cf4a135fda2178f0b192c8eee0863'
  267. '7e43b1f25827ddae615ad43fc1e11c6ba439d6c2049477dfe60e00188a70c0a76160c59a97cc01d1fd99c476f261c7cecb57628b5be48874be7cf991c22db290'
  268. 'cc727665dbb4e0adfaf798575c3c8e2be424ae2f92367afeb9fa269c90e6a56f68bfb08d203be0fd5458bd8962e818977dc04cd50feafd2a460a26480f571cf4'
  269. '9897cb0ababc8e1a0001c4e1f70e0b39f5cdb9c08c69e3afd42088dfd001aa1fc6996cd83df0db1fb57ee0a80686c35c8df783108408dbe9191602cddd1e3c65'
  270. '4be9eeff631645cb1b0a3a10b90f4c650d6e9d84a1a053a55d9fa40cd6e8f82084b3a311005db6143aeb8fc9dc6d3bd43fc8b3f38585dcbc6ddcb9f955b77f6f'
  271. 'SKIP')
  272. # vim:set sw=2 et: