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
- 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')
- 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)
- md5sums=('SKIP'
- '374877078f924e08afe93b30d0daea09'
- 'ccd3505ed32877a6e7e54fbb4f5040c1'
- '6cd41f6e08eee03c6553603fb0b6ecd7'
- '227eac16d1e737bed42742840b950d41'
- '308eb2e0c509e12ecf33165ced9eef0d'
- 'e9944fe09afc8495a2fbf70db810a219'
- '17856a060d1fc003447cb7a3f414be7d'
- 'f2325d8de3d217471f029e8b59a712e3'
- '811f5de21b882cdb49618de549e017ca'
- 'c6cf982d5ebece0b9cd64f065acd384a')
- # don't compress the package - we're just going to uncompress during install in a moment
- #PKGEXT='.pkg.tar' # Is it really necessary ?
- 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 build/
- mkdir build/sandbox
- mkdir build/downloads
- fi
- msg2 "Exporting resources..."
- export UTILIKIT_CONFIG_TYPE=archlinux
- 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
- # Do not remove icudtl.dat file
- #sed -i 's/third_party\/icu\/common\/icudtl.dat//g' "$srcdir/cleaning_list"
- 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
- # https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion
- touch chrome/test/data/webui/i18n_process_css_test.html
- # 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..."
- python3 "$srcdir/${pkgname}"/resources/packaging/debian/standard/scripts/unbundle
- }
- build() {
- 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
- python3 "$srcdir/${pkgname}"/utilikit/archive_packager.py --files-cfg chrome/tools/build/linux/FILES.cfg --archive-root-dir "${pkgname}_${pkgver}-${pkgrel}" --output-file "$srcdir/${pkgname}/build/${pkgname}_${pkgver}-${pkgrel}_linux_defaultcpu.tar.xz" --archive-format tar_xz --build-output-dir out/Release --target-cpu auto
- }
- package() {
- cd "$srcdir"
- rm -rf "${pkgname}_${pkgver}-${pkgrel}" &> /dev/null
- msg "Extracting built tarball to properly package..."
- if [ -f "${pkgname}/build/${pkgname}_${pkgver}-${pkgrel}_linux_defaultcpu.tar.xz" ]; then
- mv "${pkgname}/build/${pkgname}_${pkgver}-${pkgrel}_linux_defaultcpu.tar.xz" "$srcdir"
- fi
- tar xf "${pkgname}_${pkgver}-${pkgrel}_linux_defaultcpu.tar.xz"
- msg2 "Creating directory structure..."
- install -d "$pkgdir/opt/"
- install -d "$pkgdir/usr/bin/"
- install -d "$pkgdir/usr/share/applications/"
- install -d "$pkgdir/usr/share/man/"
- install -d "$pkgdir/usr/share/man/man1/"
- install -d "$pkgdir/usr/share/licenses/${pkgname}/"
- msg2 "Moving contents..."
- # Main script
- install -m755 "${pkgname}.sh" "$pkgdir/usr/bin/${pkgname}"
- # Desktop
- install -m644 "${pkgname}.desktop" "$pkgdir/usr/share/applications/"
- # Icons
- for i in 16 22 24 32 48 64 128 256; do
- install -Dm644 "${pkgname}_${i}.png" "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/${pkgname}.png"
- done
- # Man page
- install -Dm644 "${pkgname}_${pkgver}-${pkgrel}/chrome.1" "$pkgdir/usr/share/man/man1/${pkgname}.1"
- # License
- install -m644 "${pkgname}/LICENSE" "$pkgdir/usr/share/licenses/${pkgname}/"
- msg2 "Installing main directory..."
- mv "${pkgname}_${pkgver}-${pkgrel}" "$pkgdir/opt/${pkgname}"
- # thanks seo.disparate
- msg2 "Ensuring packaged files are owned by root..."
- chown -R root:root "$pkgdir"
- msg2 "Fixing chromium-sandbox name and permissions..."
- mv "$pkgdir/opt/$pkgname/chrome_sandbox" "$pkgdir/opt/$pkgname/chrome-sandbox"
- chmod 4755 "$pkgdir/opt/$pkgname/chrome-sandbox"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement