CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
nss: added .signature
[ports/opt-arm.git] / chromium / Pkgfile
index 3e2215f0a296b714d4d4babf326dde86bc353eb2..e5c286c2d6fb653684c8ea797b542352ad1b4e05 100644 (file)
@@ -3,21 +3,31 @@
 # Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu
 # Maintainer: Jose V Beneyto, sepen at crux dot nu
 # Packager: Tadeusz Sosnierz, tadzikes gmail com
-# Depends on: dbus-glib gperf gtk libevent libexif libgcrypt mesa3d ninja nodejs nss pciutils speech-dispatcher xorg-libxscrnsaver xorg-libxt xorg-libxtst yasm
+# Depends on: dbus-glib gperf gtk gtk3 libevent libexif libgcrypt ninja nodejs nss pciutils speech-dispatcher xorg-libxscrnsaver xorg-libxt yasm
 
 name=chromium
-version=60.0.3112.78
+version=64.0.3282.119
 release=1
-source=(http://commondatastorage.googleapis.com/$name-browser-official/$name-$version.tar.xz \
-        last-commit-position.patch $name-build-toolchain.patch $name-gn-bootstrap-r2.patch $name.sh $name.desktop
-        0001-Clip-FreeType-glyph-bitmap-to-mask.patch
-        chromium-blink-gcc7.patch
-        chromium-v8-gcc7.patch
-        chromium-gn-bootstrap-r8.patch)
+source=(https://commondatastorage.googleapis.com/$name-browser-official/$name-$version.tar.xz
+  chromium-build-toolchain.patch
+  last-commit-position.patch $name.sh
+  chromium-64.0.3282.119-constexpr-1.patch
+  chromium-exclude_unwind_tables.patch
+  chromium-use-fromUTF8-for-UnicodeString-construction.patch
+  chromium-omnibox-unescape-fragment.patch
+  chromium-skia-harmony.patch
+  chromium-memcpy-r0.patch
+  chromium-clang-r2.patch
+  chromium-cups-r0.patch)
 
 build() {
   cd $name-$version
 
+  if [ -n "$(pkginfo -i | grep '^ccache ')" ]; then
+    # Avoid falling back to preprocessor mode when sources contain time macros
+    export CCACHE_SLOPPINESS=time_macros
+  fi
+
   export CFLAGS="-O2 -pipe -mfloat-abi=hard"
 
   export CFLAGS="$CFLAGS $(pkg-config --cflags nspr) -lpthread"
@@ -34,21 +44,38 @@ build() {
     esac
   done
 
-
   # we don't use git sources
   patch -p1 -i $SRC/last-commit-position.patch
 
-  # https://bugs.chromium.org/p/skia/issues/detail?id=6663
-  patch -p1 -d third_party/skia -i $SRC/0001-Clip-FreeType-glyph-bitmap-to-mask.patch
+  # Corrects error call to non-constexpr function
+  patch -p1 -i $SRC/chromium-64.0.3282.119-constexpr-1.patch
+
+  wget https://chromium.googlesource.com/chromium/src.git/+/$version?format=TEXT -O ../chromium-$version.txt
+  # https://crbug.com/710701
+  local _chrome_build_hash=$(base64 -d ../chromium-$version.txt |
+    grep -Po '^parent \K[0-9a-f]{40}$')
+  if [[ -z $_chrome_build_hash ]]; then
+    error "Unable to find Chrome build hash."
+  return 1
+  fi
+  echo "LASTCHANGE=$_chrome_build_hash-" >build/util/LASTCHANGE
+
+  # https://chromium-review.googlesource.com/c/chromium/src/+/712575
+  patch -p1 -i $SRC/chromium-exclude_unwind_tables.patch
 
-  # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853347
-  patch -p1 -i $SRC/chromium-blink-gcc7.patch
+  # https://crbug.com/772655
+  patch -p1 -i $SRC/chromium-use-fromUTF8-for-UnicodeString-construction.patch
 
-  # https://bugs.chromium.org/p/chromium/issues/detail?id=614289
-  patch -p1 -i $SRC/chromium-v8-gcc7.patch
+  # https://crbug.com/789163
+  patch -p1 -i $SRC/chromium-omnibox-unescape-fragment.patch
+
+  # https://crbug.com/skia/6663#c10
+  patch -p4 -i $SRC/chromium-skia-harmony.patch
 
   # Fixes from Gentoo
-  patch -p1 -i $SRC/chromium-gn-bootstrap-r8.patch
+  patch -p1 -i $SRC/chromium-memcpy-r0.patch
+  patch -p1 -i $SRC/chromium-clang-r2.patch
+  patch -p1 -i $SRC/chromium-cups-r0.patch
 
   mkdir -p third_party/node/linux/node-linux-x64/bin
   ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
@@ -56,9 +83,6 @@ build() {
   # Let's fix the toolchain
   patch -p0 -i $SRC/$name-build-toolchain.patch
 
-  # Gentoo patch
-  patch -p1 -i $SRC/$name-gn-bootstrap-r2.patch
-
   _gn_args=(
     'blink_gc_plugin=false'
     'clang_use_chrome_plugins=false'
@@ -70,6 +94,7 @@ build() {
     'is_clang=false'
     'is_debug=false'
     'linux_use_bundled_binutils=false'
+    'use_custom_libcxx=false'
     'proprietary_codecs=true'
     'remove_webcore_debug_symbols=true'
     'symbol_level=0'
@@ -79,23 +104,16 @@ build() {
     'use_gconf=false'
     'use_gnome_keyring=false'
     'use_gold=false'
+    'use_gtk3=true'
     'use_kerberos=false'
     'use_pulseaudio=false'
     'use_sysroot=false'
-    'use_system_libjpeg=true'
   )
 
-  export TMPDIR="${PKGMK_WORK_DIR}/temp"
-  mkdir -p -m 755 "${TMPDIR}" || die
-
-  python2 tools/gn/bootstrap/bootstrap.py --gn-gen-args="${_gn_args[*]}"
+  /usr/bin/python2 tools/gn/bootstrap/bootstrap.py --gn-gen-args="${_gn_args[*]}"
   out/Release/gn gen out/Release --args="${_gn_args[*]}" --script-executable=/usr/bin/python2
 
-  # Ninja, by default, sets the number of jobs to the number of availalble threads
-#  local JOBS=$(awk 'BEGIN{RS="-j|--jobs="} NR==2 {print $1}' <<< $MAKEFLAGS)
-#  test -n "$JOBS" && export JOBS="-j $JOBS"
-  JOBS="-j 2"
-  ninja $JOBS -C out/Release chrome chrome_sandbox
+  ninja -j ${JOBS-1} -C out/Release chrome chrome_sandbox
  
   install -m 0755 -D out/Release/chrome $PKG/usr/lib/$name/$name
   install -m 4755 -o root -g root -D out/Release/chrome_sandbox $PKG/usr/lib/$name/chrome-sandbox
@@ -103,21 +121,33 @@ build() {
   install -d $PKG/usr/lib/$name/locales
   install -m 0644 out/Release/locales/en-US.pak $PKG/usr/lib/$name/locales
   cp -a out/Release/resources $PKG/usr/lib/$name
-  install -m 0644 -D out/Release/chrome.1 $PKG/usr/share/man/man1/$name.1
+
+  install -m 0644 -D chrome/installer/linux/common/desktop.template $PKG/usr/share/applications/$name.desktop
+  install -m 0644 -D chrome/app/resources/manpage.1.in $PKG/usr/share/man/man1/$name.1
+
+  sed -i \
+    -e "s/@@MENUNAME@@/Chromium/g" \
+    -e "s/@@PACKAGE@@/chromium/g" \
+    -e "s/@@USR_BIN_SYMLINK_NAME@@/chromium/g" \
+    $PKG/usr/share/applications/$name.desktop \
+    $PKG/usr/share/man/man1/$name.1
 
   # fix v8 natives
   cp -a out/Release/{natives,snapshot}_blob.bin $PKG/usr/lib/$name
 
-  for size in 22 24 48 128 256; do
+  for size in 16 32; do
+    install -m 0644 -D chrome/app/theme/default_100_percent/$name/product_logo_${size}.png \
+    $PKG/usr/share/icons/hicolor/${size}x${size}/apps/$name.png
+  done
+
+  for size in 22 24 48 64 128 256; do
     install -m 0644 -D chrome/app/theme/$name/product_logo_${size}.png \
     $PKG/usr/share/icons/hicolor/${size}x${size}/apps/$name.png
   done
 
   # fix icu installation
-  cp -a out/Release/icudtl.dat $PKG/usr/lib/$name
+  install -m 0644 -D out/Release/icudtl.dat $PKG/usr/lib/$name/icudtl.dat
 
-  install -d $PKG/usr/share/pixmaps
-  ln -sf /usr/share/icons/hicolor/48x48/apps/$name.png $PKG/usr/share/pixmaps/$name.png
-  install -m 0644 -D $SRC/$name.desktop $PKG/usr/share/applications/$name.desktop
   install -m 0755 -D $SRC/$name.sh $PKG/usr/bin/$name
+
 }