summaryrefslogtreecommitdiff
path: root/chromium/Pkgfile
blob: c6f7f1b2886a10db51fc821969858bcbd0399966 (plain)
    1 # Description: Open source version of Google Chrome web browser.
    2 # URL: http://chromium.org/
    3 # Maintainer: CRUX System Team, core-ports at crux dot nu
    4 # Depends on: dbus-glib gperf gtk gtk3 libevent libexif libgcrypt ninja nodejs nss pciutils speech-dispatcher xorg-libxscrnsaver xorg-libxt yasm
    5 
    6 name=chromium
    7 version=64.0.3282.140
    8 release=1
    9 source=(https://commondatastorage.googleapis.com/$name-browser-official/$name-$version.tar.xz
   10 	last-commit-position.patch $name.sh
   11 	chromium-64.0.3282.119-constexpr-1.patch
   12 	chromium-use-fromUTF8-for-UnicodeString-construction.patch
   13 	chromium-omnibox-unescape-fragment.patch
   14 	chromium-skia-harmony.patch
   15 	chromium-memcpy-r0.patch
   16 	chromium-clang-r2.patch
   17 	chromium-cups-r0.patch)
   18 
   19 build() {
   20 	cd $name-$version
   21 
   22 	if [ -n "$(pkginfo -i | grep '^ccache ')" ]; then
   23 		# Avoid falling back to preprocessor mode when sources contain time macros
   24 		export CCACHE_SLOPPINESS=time_macros
   25 	fi
   26 
   27 	export CFLAGS="$CFLAGS $(pkg-config --cflags nspr)"
   28 	export LDFLAGS="$LDFLAGS $(pkg-config --libs nspr)"
   29 
   30 	# we don't use git sources
   31 	patch -p1 -i $SRC/last-commit-position.patch
   32 
   33 	# Corrects error call to non-constexpr function
   34 	patch -p1 -i $SRC/chromium-64.0.3282.119-constexpr-1.patch
   35 
   36 	wget https://chromium.googlesource.com/chromium/src.git/+/$version?format=TEXT -O ../chromium-$version.txt
   37 	# https://crbug.com/710701
   38 	local _chrome_build_hash=$(base64 -d ../chromium-$version.txt |
   39 		grep -Po '^parent \K[0-9a-f]{40}$')
   40 	if [[ -z $_chrome_build_hash ]]; then
   41 		error "Unable to find Chrome build hash."
   42 		return 1
   43 	fi
   44 	echo "LASTCHANGE=$_chrome_build_hash-" >build/util/LASTCHANGE
   45 
   46 	# https://chromium-review.googlesource.com/c/chromium/src/+/712575
   47 	# _flags+=('exclude_unwind_tables=true')
   48 	CFLAGS+='   -fno-unwind-tables -fno-asynchronous-unwind-tables'
   49 	CXXFLAGS+=' -fno-unwind-tables -fno-asynchronous-unwind-tables'
   50 	CPPFLAGS+=' -DNO_UNWIND_TABLES'
   51 
   52 	# https://crbug.com/772655
   53 	patch -p1 -i $SRC/chromium-use-fromUTF8-for-UnicodeString-construction.patch
   54 
   55 	# https://crbug.com/789163
   56 	patch -p1 -i $SRC/chromium-omnibox-unescape-fragment.patch
   57 
   58 	# https://crbug.com/skia/6663#c10
   59 	patch -p4 -i $SRC/chromium-skia-harmony.patch
   60 
   61 	# Fixes from Gentoo
   62 	patch -p1 -i $SRC/chromium-memcpy-r0.patch
   63 	patch -p1 -i $SRC/chromium-clang-r2.patch
   64 	patch -p1 -i $SRC/chromium-cups-r0.patch
   65 
   66 	mkdir -p third_party/node/linux/node-linux-x64/bin
   67 	ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
   68 
   69 	local LIB
   70 	for LIB in libjpeg libjpeg_turbo yasm; do
   71 		find -type f -path "*third_party/$LIB/*" \
   72 			\! -path "*third_party/$LIB/chromium/*" \
   73 			\! -path "*third_party/$LIB/google/*" \
   74 			\! -path './base/third_party/icu/*' \
   75 			\! -path './third_party/yasm/run_yasm.py' \
   76                         \! -regex '.*\.\(gn\|gni\|isolate\)' \
   77 			\! -path './third_party/freetype/src/src/psnames/pstables.h' \
   78 			-delete
   79 	done
   80 
   81 	/usr/bin/python2 build/linux/unbundle/replace_gn_files.py \
   82 		--system-libraries libjpeg libxml libevent yasm
   83 
   84 	/usr/bin/python2 third_party/libaddressinput/chromium/tools/update-strings.py
   85 
   86 	_gn_args=(
   87 		'blink_gc_plugin=false'
   88 		'clang_use_chrome_plugins=false'
   89 		'enable_hangout_services_extension=true'
   90 		'enable_nacl=false'
   91 		'enable_swiftshader=false'
   92 		'fatal_linker_warnings=false'
   93 		'ffmpeg_branding="Chrome"'
   94 		'is_clang=false'
   95 		'is_debug=false'
   96 		'linux_use_bundled_binutils=false'
   97 		'use_custom_libcxx=false'
   98 		'proprietary_codecs=true'
   99 		'remove_webcore_debug_symbols=true'
  100 		'symbol_level=0'
  101 		'treat_warnings_as_errors=false'
  102 		'use_allocator="none"'
  103 		'use_cups=false'
  104 		'use_gconf=false'
  105 		'use_gnome_keyring=false'
  106 		'use_gold=false'
  107 		'use_kerberos=false'
  108 		'use_pulseaudio=false'
  109 		'use_sysroot=false'
  110 	)
  111 
  112 	/usr/bin/python2 tools/gn/bootstrap/bootstrap.py --gn-gen-args="${_gn_args[*]}"
  113 	out/Release/gn gen out/Release --args="${_gn_args[*]}" --script-executable=/usr/bin/python2
  114 
  115 	ninja -j ${JOBS-1} -C out/Release chrome chrome_sandbox
  116 
  117 	install -m 0755 -D out/Release/chrome $PKG/usr/lib/$name/$name
  118 	install -m 4755 -o root -g root -D out/Release/chrome_sandbox $PKG/usr/lib/$name/chrome-sandbox
  119 	install -m 0644 -D out/Release/*.pak $PKG/usr/lib/$name
  120 	install -d $PKG/usr/lib/$name/locales
  121 	install -m 0644 out/Release/locales/en-US.pak $PKG/usr/lib/$name/locales
  122 	cp -a out/Release/resources $PKG/usr/lib/$name
  123 
  124 	install -m 0644 -D chrome/installer/linux/common/desktop.template $PKG/usr/share/applications/$name.desktop
  125 	install -m 0644 -D chrome/app/resources/manpage.1.in $PKG/usr/share/man/man1/$name.1
  126 
  127 	sed -i \
  128 		-e "s/@@MENUNAME@@/Chromium/g" \
  129 		-e "s/@@PACKAGE@@/chromium/g" \
  130 		-e "s/@@USR_BIN_SYMLINK_NAME@@/chromium/g" \
  131 		$PKG/usr/share/applications/$name.desktop \
  132 		$PKG/usr/share/man/man1/$name.1
  133 
  134 	# fix v8 natives
  135 	cp -a out/Release/{natives,snapshot}_blob.bin $PKG/usr/lib/$name
  136 
  137 	for size in 16 32; do
  138 		install -m 0644 -D chrome/app/theme/default_100_percent/$name/product_logo_${size}.png \
  139 		$PKG/usr/share/icons/hicolor/${size}x${size}/apps/$name.png
  140 	done
  141 
  142 	for size in 22 24 48 64 128 256; do
  143 		install -m 0644 -D chrome/app/theme/$name/product_logo_${size}.png \
  144 		$PKG/usr/share/icons/hicolor/${size}x${size}/apps/$name.png
  145 	done
  146 
  147 	# fix icu installation
  148 	install -m 0644 -D out/Release/icudtl.dat $PKG/usr/lib/$name/icudtl.dat
  149 
  150 	install -m 0755 -D $SRC/$name.sh $PKG/usr/bin/$name
  151 }

Generated by cgit