Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Maintainer: Matt Parnell/ilikenwf <parwok@gmail.com>
- # based on chromium-snapshot-bin by det
- # Contributors: Ner0, alexwizard, thotypous, jdhore, xduugu, randypenguin, bdheeman, AlK
- #########################
- ## -- Build options -- ##
- #########################
- _domains_substitute=1
- _enable_webrtc=1 # see notes on inox 57.0.2987.133 release https://github.com/gcarq/inox-patchset/releases/tag/57.0.2987.133
- _enable_vaapi=0 # Patch for VAAPI HW acceleration
- # Possible replacements are listed in build/linux/unbundle/replace_gn_files.py
- # Keys are the names in the above script; values are the dependencies in Arch
- declare -rgA _system_libs=(
- [ffmpeg]=ffmpeg
- [flac]=flac
- [harfbuzz-ng]=harfbuzz-icu
- [icu]=icu
- [libevent]=libevent # Get segfaults and other problems https://bugs.gentoo.org/593458
- [libjpeg]=libjpeg
- [libpng]=libpng
- [libvpx]=libvpx
- [libwebp]=libwebp
- #[libxml]=libxml2 # https://bugs.archlinux.org/task/29939
- [libxslt]=libxslt
- [re2]=re2
- [snappy]=snappy
- [yasm]=
- [zlib]=minizip
- )
- pkgname=ungoogled-chromium
- pkgver=57.0.2987.133
- pkgrel=1
- pkgdesc="Modifications to Google Chromium for removing Google integration and enhancing privacy, control, and transparency"
- arch=('x86_64')
- url="https://github.com/Eloston/ungoogled-chromium"
- license=('BSD')
- depends=('gtk2' 'nss' 'alsa-lib' 'xdg-utils' 'bzip2' 'libevent' 'libxss' 'icu'
- 'libexif' 'libgcrypt' 'ttf-font' 'systemd' 'dbus' 'flac' 'snappy'
- 'pciutils' 'libpulse' 'harfbuzz' 'libsecret'
- 'perl' 'perl-file-basedir' 'desktop-file-utils' 'hicolor-icon-theme'
- 'gconf' 're2' 'minizip')
- optdepends=('kdialog: needed for file dialogs in KDE'
- 'gnome-keyring: for storing passwords in GNOME keyring'
- 'kwalletmanager: for storing passwords in KWallet'
- 'pepper-flash: for Pepper Flash plugin [AUR]')
- makedepends=('python3' 'python2' 'gperf' 'yasm' 'mesa' 'ninja' 'git' 'quilt' 'clang' 'harfbuzz-icu' 'ffmpeg')
- provides=('chromium')
- install=${pkgname}.install
- source=("git://github.com/Eloston/ungoogled-chromium#branch=develop"
- "${pkgname}.sh"
- "${pkgname}.desktop"
- "${pkgname}"_{16,22,24,32,48,64,128,256}.png
- # Misc Patches
- "enable_vaapi_on_linux_${pkgver}.diff::https://raw.githubusercontent.com/saiarcot895/chromium-ubuntu-build/f1f75b30353b1085ff8fd5c53f870740b19d2ad6/debian/patches/enable_vaapi_on_linux.diff"
- "specify-max-resolution_${pkgver}.patch::https://raw.githubusercontent.com/saiarcot895/chromium-ubuntu-build/17a9e43741d5827969f7ad5f1483b69bec95e86e/debian/patches/specify-max-resolution.patch"
- )
- md5sums=('SKIP'
- '374877078f924e08afe93b30d0daea09'
- 'ccd3505ed32877a6e7e54fbb4f5040c1'
- '6cd41f6e08eee03c6553603fb0b6ecd7'
- '227eac16d1e737bed42742840b950d41'
- '308eb2e0c509e12ecf33165ced9eef0d'
- 'e9944fe09afc8495a2fbf70db810a219'
- '17856a060d1fc003447cb7a3f414be7d'
- 'f2325d8de3d217471f029e8b59a712e3'
- '811f5de21b882cdb49618de549e017ca'
- 'c6cf982d5ebece0b9cd64f065acd384a'
- '6382782cf4dd06ff10015652cb5aefbb'
- '40dc34a99c9a2bc0c23a481a3468f8c9')
- pkgver() {
- cd "$srcdir/${pkgname}"
- echo $(grep -oPm1 '([0-9]+\.?)+' resources/version.ini)
- pkgrel=$(grep -oP '\=\ [0-9]$' resources/version.ini|sed -e 's/\=\ //g')
- }
- prepare(){
- # Set Python2 path.
- mkdir -p python-path
- ln -sf /usr/bin/python2 "${srcdir}/python-path/python"
- export PATH="${srcdir}/python-path:$PATH"
- cd "$srcdir/${pkgname}"
- if [ ! -d "build" ]; then
- mkdir -p build/sandbox
- mkdir build/downloads
- fi
- msg2 "Exporting resources..."
- export UTILIKIT_CONFIG_TYPE=archlinux
- export UTILIKIT_RESOURCES="$srcdir/${pkgname}/resources"
- export UTILIKIT_DOWNLOADS_DIR="$srcdir/${pkgname}/build/downloads"
- export UTILIKIT_SANDBOX_DIR="$srcdir/${pkgname}/build/sandbox"
- if [ "${_domains_substitute}" = "1" ]; then
- python3 utilikit/export_resources.py --domain-substitute-patches "$srcdir" archlinux
- elif [ "${_domains_substitute}" = "0" ]; then
- python3 utilikit/export_resources.py "$srcdir" archlinux
- fi
- # Enable webrtc?.
- if [ "${_enable_webrtc}" = "1" ]; then
- sed -i '/enable_webrtc=false/c\enable_webrtc=true' "${srcdir}/gn_flags"
- fi
- msg2 "Preparing sources..."
- python3 utilikit/prepare_sources.py --source-cleaning-list "$srcdir/cleaning_list"
- # Domains substitute?.
- if [ "${_domains_substitute}" = "1" ]; then
- msg2 "Substituting domains..."
- python3 utilikit/substitute_domains.py
- fi
- msg2 "Applying patches..."
- if [ ! -d "build/sandbox/patches" ]; then
- ln -s "$srcdir"/patches build/sandbox/patches
- ln -s "$srcdir"/patch_order build/sandbox/patches/series
- fi
- cd build/sandbox
- quilt push -a
- # Misc Patches:
- if [ "${_enable_vaapi}" = 1 ]; then
- patch -p1 -i "${srcdir}/enable_vaapi_on_linux_${pkgver}.diff"
- patch -p1 -i "${srcdir}/specify-max-resolution_${pkgver}.patch"
- fi
- # Make it possible to remove third_party/adobe
- echo > "flapper_version.h"
- msg2 "Make sure use Python2"
- find . -name '*.py' -exec sed -r 's|/usr/bin/python$|&2|g' -i {} +
- find . -name '*.py' -exec sed -r 's|/usr/bin/env python$|&2|g' -i {} +
- msg2 "Changing bundle libraries to system ones..."
- # Remove bundled libraries for which we will use the system copies; this
- # *should* do what the remove_bundled_libraries.py script does, with the
- # added benefit of not having to list all the remaining libraries
- local _lib
- for _lib in ${!_system_libs[@]} ${_system_libs[libjpeg]+libjpeg_turbo}; do
- find -type f -path "*third_party/$_lib/*" \
- \! -path "*third_party/$_lib/chromium/*" \
- \! -path "*third_party/$_lib/google/*" \
- \! -path "*base/third_party/icu/*" \
- \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
- -delete
- done
- python2 build/linux/unbundle/replace_gn_files.py \
- --system-libraries "${!_system_libs[@]}"
- python2 third_party/libaddressinput/chromium/tools/update-strings.py
- }
- build() {
- local _flags=""
- readarray _flags < "${srcdir}/gn_flags"
- cd "$srcdir/${pkgname}"/build/sandbox
- python2 tools/gn/bootstrap/bootstrap.py --gn-gen-args "${_flags[*]}"
- out/Release/gn gen out/Release --args="${_flags[*]}" --script-executable=/usr/bin/python2
- ninja -C out/Release chrome chrome_sandbox chromedriver widevinecdmadapter
- }
- package() {
- cd "$srcdir/${pkgname}"/build/sandbox
- install -Dm755 "$srcdir/${pkgname}.sh" "$pkgdir/usr/bin/${pkgname}"
- install -D out/Release/chrome "$pkgdir/opt/${pkgname}/chrome"
- install -Dm644 out/Release/chrome.1 "$pkgdir/usr/share/man/man1/${pkgname}.1"
- install -Dm644 "$srcdir/${pkgname}.desktop" \
- "$pkgdir/usr/share/applications/${pkgname}.desktop"
- install -Dm4755 out/Release/chrome_sandbox \
- "$pkgdir/opt/${pkgname}/chrome-sandbox"
- cp -a out/Release/{*.pak,*.bin,chromedriver,libwidevinecdmadapter.so} \
- out/Release/locales \
- out/Release/gen/content/content_resources.pak \
- "$pkgdir/opt/${pkgname}/"
- ln -s "/opt/${pkgname}/chromedriver" "$pkgdir/usr/bin/chromedriver"
- # Icons
- for i in 16 22 24 32 48 64 128 256; do
- install -Dm644 "${srcdir}/${pkgname}_${i}.png" "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/${pkgname}.png"
- done
- install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement