summaryrefslogtreecommitdiff
path: root/chromium/Pkgfile
blob: 95bdd7a159aeb5097a4423b536f5e976d5564d32 (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=63.0.3239.108
    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-exclude_unwind_tables.patch
   12 	chromium-clang-r1.patch
   13 	chromium-webrtc-r0.patch)
   14 
   15 build() {
   16 	cd $name-$version
   17 
   18 	if [ -n "$(pkginfo -i | grep '^ccache ')" ]; then
   19 		# Avoid falling back to preprocessor mode when sources contain time macros
   20 		export CCACHE_SLOPPINESS=time_macros
   21 	fi
   22 
   23 	export CFLAGS="$CFLAGS $(pkg-config --cflags nspr)"
   24 	export LDFLAGS="$LDFLAGS $(pkg-config --libs nspr)"
   25 
   26 	# we don't use git sources
   27 	patch -p1 -i $SRC/last-commit-position.patch
   28 
   29 	# https://chromium-review.googlesource.com/c/chromium/src/+/71257
   30 	patch -p1 -i $SRC/chromium-exclude_unwind_tables.patch
   31 
   32 	# Fixes from Gentoo
   33 	patch -p1 -i $SRC/chromium-clang-r1.patch
   34 	patch -p1 -i $SRC/chromium-webrtc-r0.patch
   35 
   36 	mkdir -p third_party/node/linux/node-linux-x64/bin
   37 	ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
   38 
   39 #  for LIB in ffmpeg flac harfbuzz-ng libjpeg \
   40 #		 libjpeg_turbo libpng libwebp libxslt yasm; do
   41 #		 find -type f -path "*third_party/$LIB/*"		\
   42 #			 \! -path "*third_party/$LIB/chromium/*"	\
   43 #			 \! -path "*third_party/$LIB/google/*"		\
   44 #			 \! -path "*base/third_party/icu/*"				\
   45 #			 \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
   46 #			 -delete
   47 #  done
   48 
   49 #  /usr/bin/python2 build/linux/unbundle/replace_gn_files.py \
   50 #		 --system-libraries ffmpeg flac harfbuzz-ng libjpeg libxml libevent \
   51 #												libpng libwebp libxslt opus yasm freetype
   52 #  /usr/bin/python2 third_party/libaddressinput/chromium/tools/update-strings.py
   53 
   54 	_gn_args=(
   55 		'blink_gc_plugin=false'
   56 		'clang_use_chrome_plugins=false'
   57 		'enable_hangout_services_extension=true'
   58 		'enable_nacl=false'
   59 		'enable_swiftshader=false'
   60 		'fatal_linker_warnings=false'
   61 		'ffmpeg_branding="Chrome"'
   62 		'is_clang=false'
   63 		'is_debug=false'
   64 		'linux_use_bundled_binutils=false'
   65 		'use_custom_libcxx=false'
   66 		'proprietary_codecs=true'
   67 		'remove_webcore_debug_symbols=true'
   68 		'symbol_level=0'
   69 		'treat_warnings_as_errors=false'
   70 		'use_allocator="none"'
   71 		'use_cups=false'
   72 		'use_gconf=false'
   73 		'use_gnome_keyring=false'
   74 		'use_gold=false'
   75 		'use_gtk3=true'
   76 		'use_kerberos=false'
   77 		'use_pulseaudio=false'
   78 		'use_sysroot=false'
   79 	)
   80 
   81 	/usr/bin/python2 tools/gn/bootstrap/bootstrap.py --gn-gen-args="${_gn_args[*]}"
   82 	out/Release/gn gen out/Release --args="${_gn_args[*]}" --script-executable=/usr/bin/python2
   83 
   84 	ninja -j ${JOBS-1} -C out/Release chrome chrome_sandbox
   85 
   86 	install -m 0755 -D out/Release/chrome $PKG/usr/lib/$name/$name
   87 	install -m 4755 -o root -g root -D out/Release/chrome_sandbox $PKG/usr/lib/$name/chrome-sandbox
   88 	install -m 0644 -D out/Release/*.pak $PKG/usr/lib/$name
   89 	install -d $PKG/usr/lib/$name/locales
   90 	install -m 0644 out/Release/locales/en-US.pak $PKG/usr/lib/$name/locales
   91 	cp -a out/Release/resources $PKG/usr/lib/$name
   92 
   93 	install -m 0644 -D chrome/installer/linux/common/desktop.template $PKG/usr/share/applications/$name.desktop
   94 	install -m 0644 -D chrome/app/resources/manpage.1.in $PKG/usr/share/man/man1/$name.1
   95 
   96 	sed -i \
   97 		-e "s/@@MENUNAME@@/Chromium/g" \
   98 		-e "s/@@PACKAGE@@/chromium/g" \
   99 		-e "s/@@USR_BIN_SYMLINK_NAME@@/chromium/g" \
  100 		$PKG/usr/share/applications/$name.desktop \
  101 		$PKG/usr/share/man/man1/$name.1
  102 
  103 	# fix v8 natives
  104 	cp -a out/Release/{natives,snapshot}_blob.bin $PKG/usr/lib/$name
  105 
  106 	for size in 16 32; do
  107 		install -m 0644 -D chrome/app/theme/default_100_percent/$name/product_logo_${size}.png \
  108 		$PKG/usr/share/icons/hicolor/${size}x${size}/apps/$name.png
  109 	done
  110 
  111 	for size in 22 24 48 64 128 256; do
  112 			install -m 0644 -D chrome/app/theme/$name/product_logo_${size}.png \
  113 			$PKG/usr/share/icons/hicolor/${size}x${size}/apps/$name.png
  114 	done
  115 
  116 	# fix icu installation
  117 	install -m 0644 -D out/Release/icudtl.dat $PKG/usr/lib/$name/icudtl.dat
  118 
  119 	install -m 0755 -D $SRC/$name.sh $PKG/usr/bin/$name
  120 }

Generated by cgit