Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
803
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.26 KB | None | 0 0
  1. # Maintainer: Matt Parnell/ilikenwf <parwok@gmail.com>
  2. # based on chromium-snapshot-bin by det
  3. # Contributors: Ner0, alexwizard, thotypous, jdhore, xduugu, randypenguin, bdheeman, AlK
  4.  
  5. #########################
  6. ## -- Build options -- ##
  7. #########################
  8.  
  9. _domains_substitute=1
  10. _enable_webrtc=1 # see notes on inox 57.0.2987.133 release https://github.com/gcarq/inox-patchset/releases/tag/57.0.2987.133
  11. _enable_vaapi=0 # Patch for VAAPI HW acceleration
  12.  
  13. # Possible replacements are listed in build/linux/unbundle/replace_gn_files.py
  14. # Keys are the names in the above script; values are the dependencies in Arch
  15. declare -rgA _system_libs=(
  16. [ffmpeg]=ffmpeg
  17. [flac]=flac
  18. [harfbuzz-ng]=harfbuzz-icu
  19. [icu]=icu
  20. [libevent]=libevent # Get segfaults and other problems https://bugs.gentoo.org/593458
  21. [libjpeg]=libjpeg
  22. [libpng]=libpng
  23. [libvpx]=libvpx
  24. [libwebp]=libwebp
  25. #[libxml]=libxml2 # https://bugs.archlinux.org/task/29939
  26. [libxslt]=libxslt
  27. [re2]=re2
  28. [snappy]=snappy
  29. [yasm]=
  30. [zlib]=minizip
  31. )
  32.  
  33. pkgname=ungoogled-chromium
  34. pkgver=57.0.2987.133
  35. pkgrel=1
  36. pkgdesc="Modifications to Google Chromium for removing Google integration and enhancing privacy, control, and transparency"
  37. arch=('x86_64')
  38. url="https://github.com/Eloston/ungoogled-chromium"
  39. license=('BSD')
  40. depends=('gtk2' 'nss' 'alsa-lib' 'xdg-utils' 'bzip2' 'libevent' 'libxss' 'icu'
  41. 'libexif' 'libgcrypt' 'ttf-font' 'systemd' 'dbus' 'flac' 'snappy'
  42. 'pciutils' 'libpulse' 'harfbuzz' 'libsecret'
  43. 'perl' 'perl-file-basedir' 'desktop-file-utils' 'hicolor-icon-theme'
  44. 'gconf' 're2' 'minizip')
  45. optdepends=('kdialog: needed for file dialogs in KDE'
  46. 'gnome-keyring: for storing passwords in GNOME keyring'
  47. 'kwalletmanager: for storing passwords in KWallet'
  48. 'pepper-flash: for Pepper Flash plugin [AUR]')
  49. makedepends=('python3' 'python2' 'gperf' 'yasm' 'mesa' 'ninja' 'git' 'quilt' 'clang' 'harfbuzz-icu' 'ffmpeg')
  50. provides=('chromium')
  51. install=${pkgname}.install
  52. source=("git://github.com/Eloston/ungoogled-chromium#branch=develop"
  53. "${pkgname}.sh"
  54. "${pkgname}.desktop"
  55. "${pkgname}"_{16,22,24,32,48,64,128,256}.png
  56. # Misc Patches
  57. "enable_vaapi_on_linux_${pkgver}.diff::https://raw.githubusercontent.com/saiarcot895/chromium-ubuntu-build/f1f75b30353b1085ff8fd5c53f870740b19d2ad6/debian/patches/enable_vaapi_on_linux.diff"
  58. "specify-max-resolution_${pkgver}.patch::https://raw.githubusercontent.com/saiarcot895/chromium-ubuntu-build/17a9e43741d5827969f7ad5f1483b69bec95e86e/debian/patches/specify-max-resolution.patch"
  59. )
  60. md5sums=('SKIP'
  61. '374877078f924e08afe93b30d0daea09'
  62. 'ccd3505ed32877a6e7e54fbb4f5040c1'
  63. '6cd41f6e08eee03c6553603fb0b6ecd7'
  64. '227eac16d1e737bed42742840b950d41'
  65. '308eb2e0c509e12ecf33165ced9eef0d'
  66. 'e9944fe09afc8495a2fbf70db810a219'
  67. '17856a060d1fc003447cb7a3f414be7d'
  68. 'f2325d8de3d217471f029e8b59a712e3'
  69. '811f5de21b882cdb49618de549e017ca'
  70. 'c6cf982d5ebece0b9cd64f065acd384a'
  71. '6382782cf4dd06ff10015652cb5aefbb'
  72. '40dc34a99c9a2bc0c23a481a3468f8c9')
  73.  
  74. pkgver() {
  75. cd "$srcdir/${pkgname}"
  76.  
  77. echo $(grep -oPm1 '([0-9]+\.?)+' resources/version.ini)
  78. pkgrel=$(grep -oP '\=\ [0-9]$' resources/version.ini|sed -e 's/\=\ //g')
  79. }
  80.  
  81. prepare(){
  82. # Set Python2 path.
  83. mkdir -p python-path
  84. ln -sf /usr/bin/python2 "${srcdir}/python-path/python"
  85. export PATH="${srcdir}/python-path:$PATH"
  86.  
  87. cd "$srcdir/${pkgname}"
  88.  
  89. if [ ! -d "build" ]; then
  90. mkdir -p build/sandbox
  91. mkdir build/downloads
  92. fi
  93.  
  94. msg2 "Exporting resources..."
  95. export UTILIKIT_CONFIG_TYPE=archlinux
  96. export UTILIKIT_RESOURCES="$srcdir/${pkgname}/resources"
  97. export UTILIKIT_DOWNLOADS_DIR="$srcdir/${pkgname}/build/downloads"
  98. export UTILIKIT_SANDBOX_DIR="$srcdir/${pkgname}/build/sandbox"
  99.  
  100. if [ "${_domains_substitute}" = "1" ]; then
  101. python3 utilikit/export_resources.py --domain-substitute-patches "$srcdir" archlinux
  102. elif [ "${_domains_substitute}" = "0" ]; then
  103. python3 utilikit/export_resources.py "$srcdir" archlinux
  104. fi
  105.  
  106. # Enable webrtc?.
  107. if [ "${_enable_webrtc}" = "1" ]; then
  108. sed -i '/enable_webrtc=false/c\enable_webrtc=true' "${srcdir}/gn_flags"
  109. fi
  110.  
  111. msg2 "Preparing sources..."
  112. python3 utilikit/prepare_sources.py --source-cleaning-list "$srcdir/cleaning_list"
  113.  
  114. # Domains substitute?.
  115. if [ "${_domains_substitute}" = "1" ]; then
  116. msg2 "Substituting domains..."
  117. python3 utilikit/substitute_domains.py
  118. fi
  119.  
  120. msg2 "Applying patches..."
  121. if [ ! -d "build/sandbox/patches" ]; then
  122. ln -s "$srcdir"/patches build/sandbox/patches
  123. ln -s "$srcdir"/patch_order build/sandbox/patches/series
  124. fi
  125.  
  126. cd build/sandbox
  127. quilt push -a
  128.  
  129. # Misc Patches:
  130. if [ "${_enable_vaapi}" = 1 ]; then
  131. patch -p1 -i "${srcdir}/enable_vaapi_on_linux_${pkgver}.diff"
  132. patch -p1 -i "${srcdir}/specify-max-resolution_${pkgver}.patch"
  133. fi
  134.  
  135. # Make it possible to remove third_party/adobe
  136. echo > "flapper_version.h"
  137.  
  138. msg2 "Make sure use Python2"
  139. find . -name '*.py' -exec sed -r 's|/usr/bin/python$|&2|g' -i {} +
  140. find . -name '*.py' -exec sed -r 's|/usr/bin/env python$|&2|g' -i {} +
  141.  
  142. msg2 "Changing bundle libraries to system ones..."
  143.  
  144. # Remove bundled libraries for which we will use the system copies; this
  145. # *should* do what the remove_bundled_libraries.py script does, with the
  146. # added benefit of not having to list all the remaining libraries
  147. local _lib
  148. for _lib in ${!_system_libs[@]} ${_system_libs[libjpeg]+libjpeg_turbo}; do
  149. find -type f -path "*third_party/$_lib/*" \
  150. \! -path "*third_party/$_lib/chromium/*" \
  151. \! -path "*third_party/$_lib/google/*" \
  152. \! -path "*base/third_party/icu/*" \
  153. \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
  154. -delete
  155. done
  156.  
  157. python2 build/linux/unbundle/replace_gn_files.py \
  158. --system-libraries "${!_system_libs[@]}"
  159.  
  160. python2 third_party/libaddressinput/chromium/tools/update-strings.py
  161. }
  162.  
  163. build() {
  164. local _flags=""
  165. readarray _flags < "${srcdir}/gn_flags"
  166.  
  167. cd "$srcdir/${pkgname}"/build/sandbox
  168.  
  169. python2 tools/gn/bootstrap/bootstrap.py --gn-gen-args "${_flags[*]}"
  170.  
  171. out/Release/gn gen out/Release --args="${_flags[*]}" --script-executable=/usr/bin/python2
  172.  
  173. ninja -C out/Release chrome chrome_sandbox chromedriver widevinecdmadapter
  174. }
  175.  
  176. package() {
  177. cd "$srcdir/${pkgname}"/build/sandbox
  178.  
  179. install -Dm755 "$srcdir/${pkgname}.sh" "$pkgdir/usr/bin/${pkgname}"
  180.  
  181. install -D out/Release/chrome "$pkgdir/opt/${pkgname}/chrome"
  182. install -Dm644 out/Release/chrome.1 "$pkgdir/usr/share/man/man1/${pkgname}.1"
  183. install -Dm644 "$srcdir/${pkgname}.desktop" \
  184. "$pkgdir/usr/share/applications/${pkgname}.desktop"
  185.  
  186. install -Dm4755 out/Release/chrome_sandbox \
  187. "$pkgdir/opt/${pkgname}/chrome-sandbox"
  188.  
  189. cp -a out/Release/{*.pak,*.bin,chromedriver,libwidevinecdmadapter.so} \
  190. out/Release/locales \
  191. out/Release/gen/content/content_resources.pak \
  192. "$pkgdir/opt/${pkgname}/"
  193.  
  194. ln -s "/opt/${pkgname}/chromedriver" "$pkgdir/usr/bin/chromedriver"
  195.  
  196. # Icons
  197. for i in 16 22 24 32 48 64 128 256; do
  198. install -Dm644 "${srcdir}/${pkgname}_${i}.png" "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/${pkgname}.png"
  199. done
  200.  
  201. install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  202. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement