Advertisement
Guest User

Untitled

a guest
Apr 14th, 2018
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.53 KB | None | 0 0
  1. pkgname=basilisk
  2. pkgver=2018.04.13
  3. pkgrel=2
  4. pkgdesc="Standalone web browser forked from mozilla.org, UXP version"
  5. arch=(x86_64)
  6. license=(MPL GPL LGPL)
  7. url="https://github.com/MoonchildProductions/UXP"
  8. depends=(gtk2 mozilla-common libxt startup-notification mime-types dbus-glib alsa-lib ffmpeg
  9. libvpx libevent nss hunspell sqlite ttf-font icu)
  10. makedepends=(unzip zip diffutils python2 yasm mesa imake gconf libpulse inetutils xorg-server-xvfb
  11. autoconf2.13 rust)
  12. optdepends=('networkmanager: Location detection via available WiFi networks'
  13. 'libnotify: Notification integration'
  14. 'speech-dispatcher: Text-to-Speech')
  15. options=(!emptydirs !makeflags)
  16. com=8a95c03dcd2a7f2c6d64b6ee917f6cb363e9ca60
  17. # there is nothing magic about that commit, it's just the most recent
  18. source=("basil1::git+https://github.com/MoonchildProductions/UXP.git#commit=$com"
  19. https://raw.githubusercontent.com/bn0785ac/basilisk-arch/master/basilisk.desktop https://raw.githubusercontent.com/bn0785ac/basilisk-arch/master/basilisk-symbolic.svg
  20. https://raw.githubusercontent.com/bn0785ac/basilisk-arch/master/0001-Bug-54395-remove-hardcoded-flag-lcrmf.patch
  21. https://raw.githubusercontent.com/bn0785ac/basilisk-arch/master/fix-wifi-scanner.diff
  22. https://raw.githubusercontent.com/bn0785ac/basilisk-arch/master/glibc-2.26-fix.diff
  23. https://raw.githubusercontent.com/bn0785ac/firefox-beta/master/firefox-52-disable-location.services.mozilla.com.patch
  24. modified-install-dir.patch
  25. nss_mozbuild.patch)
  26.  
  27. sha256sums=('SKIP'
  28. '1fdc855349da4e3728b202f411ad1d1c3fdc01e616161603175ab1573df1e6a9'
  29. 'a2474b32b9b2d7e0fb53a4c89715507ad1c194bef77713d798fa39d507def9e9'
  30. 'ebaa84b1e108390cd1042cce7eaad6a7c0053c7b2b4d0b961d4a98732b3c93ac'
  31. '9765bca5d63fb5525bbd0520b7ab1d27cabaed697e2fc7791400abc3fa4f13b8'
  32. 'cd7ff441da66a287f8712e60cdc9e216c30355d521051e2eaae28a66d81915e8'
  33. '8d9afa1f940a9dac689ead40a57990d1491f34a1787b2222f8f5b5e485d54103'
  34. 'de0b642ad734ae0e360177a86d320e78ba1eed04d7144d61b0ef49f750b1e988'
  35. 'eff349e42364e6f46e550b84432d676cbaad587e8d7eee2ca820a2009d146a87')
  36.  
  37.  
  38.  
  39.  
  40. prepare() {
  41. mkdir "$srcdir/path"
  42. ln -s /usr/bin/python2 "$srcdir/path/python"
  43.  
  44. cd basil1
  45.  
  46. msg2 'firefox-52-disable-location.services.mozilla.com.patch'
  47. patch -Np1 -i ../firefox-52-disable-location.services.mozilla.com.patch || return 1
  48.  
  49. msg2 'fix-wifi-scanner.diff'
  50. # https://bugzilla.mozilla.org/show_bug.cgi?id=1314968
  51. patch -Np1 -i ../fix-wifi-scanner.diff || return 1
  52.  
  53. msg2 '0001-Bug-54395-remove-hardcoded-flag-lcrmf.patch'
  54. # https://bugs.archlinux.org/task/54395 // https://bugzilla.mozilla.org/show_bug.cgi?id=1371991
  55. patch -Np1 -i ../0001-Bug-54395-remove-hardcoded-flag-lcrmf.patch || return 1
  56. # note, sed -i 's/\ \-lcrmf//g' old-configure.in would do the same
  57. # but the patch was here anyway so we may as well use it
  58.  
  59. msg2 'also remove -lcrmf reference from nss build, rather crudely'
  60. patch -Np1 -i ../nss_mozbuild.patch || return 1
  61. # I'd have used sed here, but either it barfs on escaping single quotes for no adequately explained reason that some dolt probably regards as a feature, or I'm just too stupid to get it to work and the dolt is me
  62.  
  63. msg2 'modified-install-dir.patch'
  64. patch -Np1 -i ../modified-install-dir.patch || return 1
  65. # this was in other Firefox installations, and it's still needed
  66.  
  67. # note that I've enabled some optimizations your CPU might not like
  68. # also, we will not be drinking the GTK3 koolaid at this time
  69. # also also, enabling branding/distribution failed for some reason
  70. cat >.mozconfig <<END
  71. ac_add_options --enable-application=browser
  72.  
  73. ac_add_options --prefix=/usr
  74. ac_add_options --enable-release
  75. ac_add_options --enable-gold
  76. ac_add_options --enable-pie
  77. ac_add_options --enable-optimize="-O2 -msse -msse2 -msse3 -mmmx -mfpmath=sse"
  78. ac_add_options --enable-default-toolkit=cairo-gtk2
  79.  
  80. export MOZ_TELEMETRY_REPORTING=0
  81.  
  82. #ac_add_options --enable-official-branding
  83. #ac_add_options --enable-update-channel=release
  84. #ac_add_options --with-distribution-id=org.archlinux
  85. export MOZ_DATA_REPORTING=0
  86. export MOZILLA_OFFICIAL=0
  87. export MOZ_TELEMETRY_REPORTING=0
  88. export MOZ_ADDON_SIGNING=1
  89. export MOZ_REQUIRE_SIGNING=0
  90.  
  91. # Features
  92. ac_add_options --enable-startup-notification
  93. ac_add_options --enable-crashreporter
  94. ac_add_options --enable-alsa
  95. ac_add_options --disable-updater
  96.  
  97. ac_add_options --with-system-nspr
  98. ac_add_options --with-system-nss
  99. ac_add_options --with-system-icu
  100. ac_add_options --with-system-zlib
  101. ac_add_options --with-system-bz2
  102. ac_add_options --enable-system-hunspell
  103. ac_add_options --enable-system-sqlite
  104. ac_add_options --enable-system-ffi
  105. ac_add_options --enable-system-pixman
  106.  
  107. # Features
  108. ac_add_options --enable-startup-notification
  109. ac_add_options --enable-crashreporter
  110. ac_add_options --enable-alsa
  111. ac_add_options --disable-updater
  112.  
  113.  
  114. # Imported from Waterfox
  115. ac_add_options --disable-stylo
  116.  
  117.  
  118. # If you want to have text-to-speech support, comment this line:
  119. ac_add_options --disable-webspeech
  120.  
  121. # If you want to have geolocation support, comment this line:
  122. ac_add_options --disable-necko-wifi
  123.  
  124. # If you have some problems with Skype Web or other web chat, comment this line:
  125. ac_add_options --disable-webrtc
  126.  
  127. # If you want to have gamepad support, comment this line:
  128. ac_add_options --disable-gamepad
  129.  
  130.  
  131. # please put 1.25 times your number of threads
  132.  
  133. mk_add_options MOZ_MAKE_FLAGS="-j10"
  134.  
  135. ac_add_options --disable-debug
  136. ac_add_options --disable-debug-symbols
  137. ac_add_options --disable-parental-controls
  138. ac_add_options --disable-accessibility
  139. ac_add_options --disable-tests
  140.  
  141.  
  142. END
  143. }
  144.  
  145. build() {
  146. cd basil1
  147.  
  148. # _FORTIFY_SOURCE causes configure failures
  149. # again note that these are my own optimizations, ymmv
  150. # and don't trust it blindly because I might be stupid
  151. CPPFLAGS+=" -O2 -msse -msse2 -msse3 -mmmx -mfpmath=sse"
  152. CFLAGS+=" -msse -msse2 -msse3 -mmmx -mfpmath=sse"
  153. CXXFLAGS+=" -msse -msse2 -msse3 -mmmx -mfpmath=sse"
  154.  
  155. # Hardening
  156. # this is already in my makepkg.conf anyway so I'm leaving it out
  157. # LDFLAGS+=" -Wl,-z,now"
  158.  
  159. export PATH="$srcdir/path:$PATH"
  160.  
  161. # Do PGO
  162. #xvfb-run -a -n 95 -s "-extension GLX -screen 0 1280x1024x24" \
  163. # MOZ_PGO=1 ./mach build
  164. # ./mach buildsymbols
  165. # I have no idea what this is but I'm afraid of purging it
  166.  
  167. # Ordinarily, one would use "mach build" but this is a suggested workaround for an Assertion Error, see https://github.com/MoonchildProductions/UXP/issues/110
  168. msg2 'All right, attempting to build now'
  169. DESTDIR="$pkgdir" make -f client.mk build
  170. # ./mach build
  171. }
  172.  
  173. package() {
  174. cd basil1
  175.  
  176. msg2 'Fixing bugs as always lol'
  177. # you and me both, mate
  178. mkdir -p browser/branding
  179. cp -r application/palemoon/branding/unofficial/ browser/branding/official
  180.  
  181. msg2 'Going to try running make install now'
  182. # this "mach" business may just be b0rked, trying analogous workaround
  183. DESTDIR="$pkgdir" make -f client.mk install
  184. # DESTDIR="$pkgdir" ./mach install
  185.  
  186. msg2 'Now installing a bunch of icons'
  187. for i in 16 22 24 32 48 256; do
  188. install -Dm644 browser/branding/official/default$i.png \
  189. "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/basilisk.png"
  190. done
  191. install -Dm644 browser/branding/official/content/icon64.png \
  192. "$pkgdir/usr/share/icons/hicolor/64x64/apps/basilisk.png"
  193. install -Dm644 browser/branding/official/mozicon128.png \
  194. "$pkgdir/usr/share/icons/hicolor/128x128/apps/basilisk.png"
  195. install -Dm644 browser/branding/official/content/about-logo.png \
  196. "$pkgdir/usr/share/icons/hicolor/192x192/apps/basilisk.png"
  197. install -Dm644 browser/branding/official/content/about-logo@2x.png \
  198. "$pkgdir/usr/share/icons/hicolor/384x384/apps/basilisk.png"
  199. install -Dm644 ../basilisk-symbolic.svg \
  200. "$pkgdir/usr/share/icons/hicolor/symbolic/apps/basilisk-symbolic.svg"
  201. install -Dm644 ../basilisk.desktop \
  202. "$pkgdir/usr/share/applications/basilisk.desktop"
  203.  
  204. # Use system-provided dictionaries
  205. # took this from an old Firefox PKGBUILD, not sure if it will work
  206. msg2 'using system-provided dictionaries'
  207. rm -rf "$pkgdir"/usr/lib/basilisk/{dictionaries,hyphenation}
  208. ln -s /usr/share/hunspell "$pkgdir/usr/lib/basilisk/dictionaries"
  209. ln -s /usr/share/hyphen "$pkgdir/usr/lib/basilisk/hyphenation"
  210.  
  211. # Replace duplicate binary with symlink
  212. # https://bugzilla.mozilla.org/show_bug.cgi?id=658850
  213. msg2 'all the weird stuff about duplicates needs to be corrected'
  214. ln -srf "$pkgdir/usr/bin/basilisk" \
  215. "$pkgdir/usr/lib/basilisk/basilisk-bin"
  216.  
  217. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement