Files
LibreELEC.tv/packages/addons/browser/chromium/package.mk
Sascha Kuehndel (InuSasha) 8827a540aa buildsystem: add BUILD_FLAG support
- replace strip_lto/strip_gold (only allowed to disable)
- add flag for PIC feature
- add flag to stop build parallel
- add support for hardening option (initial copy from debian 9)

All build parameters, are added in setup_toolchain.
`PKG_[FLAG]_[HOST/TARGET]_ENABLED` variable is introduced for checking the flag (yes/no) in the package.mk

Thanks to @MilhouseVH, for support and fixing
2018-03-07 18:35:01 +01:00

166 lines
6.6 KiB
Makefile

################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
PKG_NAME="chromium"
PKG_VERSION="63.0.3239.108"
PKG_SHA256="47d80798194da78bdd519b7ce012425b13cf89d6eb287e22a34342a245c31a2b"
PKG_REV="108"
PKG_ARCH="x86_64"
PKG_LICENSE="Mixed"
PKG_SITE="http://www.chromium.org/Home"
PKG_URL="https://commondatastorage.googleapis.com/chromium-browser-official/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS_HOST="toolchain ninja:host Python2:host"
PKG_DEPENDS_TARGET="chromium:host node:host pciutils dbus libXcomposite libXcursor libXtst alsa-lib bzip2 yasm nss libXScrnSaver libexif libpng atk gtk+ libva-vdpau-driver unclutter xdotool"
PKG_SECTION="browser"
PKG_SHORTDESC="Chromium Browser: the open-source web browser from Google"
PKG_LONGDESC="Chromium Browser ($PKG_VERSION): the open-source web browser from Google"
PKG_TOOLCHAIN="manual"
PKG_BUILD_FLAGS="-lto"
PKG_IS_ADDON="yes"
PKG_ADDON_NAME="Chromium"
PKG_ADDON_TYPE="xbmc.python.script"
PKG_ADDON_PROVIDES="executable"
post_patch() {
cd $(get_build_dir chromium)
# Use Python 2
find . -name '*.py' -exec sed -i -r "s|/usr/bin/python$|$TOOLCHAIN/bin/python|g" {} +
# set correct widevine
sed -i -e 's/@WIDEVINE_VERSION@/Pinkie Pie/' ./third_party/widevine/cdm/stub/widevine_cdm_version.h
}
make_host() {
./tools/gn/bootstrap/bootstrap.py --no-rebuild --no-clean --verbose
}
make_target() {
export LDFLAGS="$LDFLAGS -ludev"
export LD=$CXX
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
# Note: These are for OpenELEC use ONLY. For your own distribution, please
# get your own set of keys.
local _google_api_key=AIzaSyAQ6L9vt9cnN4nM0weaa6Y38K4eyPvtKgI
local _google_default_client_id=740889307901-4bkm4e0udppnp1lradko85qsbnmkfq3b.apps.googleusercontent.com
local _google_default_client_secret=9TJlhL661hvShQub4cWhANXa
local _flags=(
"host_toolchain=\"//build/toolchain/linux:x64_host\""
'is_clang=false'
'clang_use_chrome_plugins=false'
'symbol_level=0'
'is_debug=false'
'fatal_linker_warnings=false'
'treat_warnings_as_errors=false'
'fieldtrial_testing_like_official_build=true'
'remove_webcore_debug_symbols=true'
'ffmpeg_branding="Chrome"'
'proprietary_codecs=true'
'link_pulseaudio=true'
'linux_use_bundled_binutils=false'
'use_allocator="none"'
'use_cups=false'
'use_custom_libcxx=false'
'use_gconf=false'
'use_gnome_keyring=false'
'use_gold=false'
'use_gtk3=false'
'use_kerberos=false'
'use_pulseaudio=false'
'use_sysroot=true'
'use_vaapi=true'
'use_v8_context_snapshot=false'
'enable_vulkan=false'
"target_sysroot=\"${SYSROOT_PREFIX}\""
'exclude_unwind_tables=true'
'enable_hangout_services_extension=true'
'enable_widevine=true'
'enable_nacl=false'
'enable_nacl_nonsfi=false'
'enable_swiftshader=false'
'enable_vulkan=false'
"google_api_key=\"${_google_api_key}\""
"google_default_client_id=\"${_google_default_client_id}\""
"google_default_client_secret=\"${_google_default_client_secret}\""
)
./third_party/libaddressinput/chromium/tools/update-strings.py
./out/Release/gn gen out/Release --args="${_flags[*]}" --script-executable=$TOOLCHAIN/bin/python
mkdir -p $PKG_BUILD/third_party/node/linux/node-linux-x64/bin
ln -fs $TOOLCHAIN/bin/node $PKG_BUILD/third_party/node/linux/node-linux-x64/bin/node
ninja -j${CONCURRENCY_MAKE_LEVEL} -C out/Release chrome chrome_sandbox widevinecdmadapter
}
addon() {
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin
cp -P $PKG_BUILD/out/Release/chrome $ADDON_BUILD/$PKG_ADDON_ID/bin/chromium.bin
cp -P $PKG_BUILD/out/Release/chrome_sandbox $ADDON_BUILD/$PKG_ADDON_ID/bin/chrome-sandbox
cp -P $PKG_BUILD/out/Release/{*.pak,*.dat,*.bin,libwidevinecdmadapter.so} $ADDON_BUILD/$PKG_ADDON_ID/bin
cp -PR $PKG_BUILD/out/Release/locales $ADDON_BUILD/$PKG_ADDON_ID/bin/
cp -PR $PKG_BUILD/out/Release/gen/content/content_resources.pak $ADDON_BUILD/$PKG_ADDON_ID/bin/
# config
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/config
cp -P $PKG_DIR/config/* $ADDON_BUILD/$PKG_ADDON_ID/config
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/lib
# pango
cp -PL $(get_build_dir pango)/.install_pkg/usr/lib/libpangocairo-1.0.so.0 $ADDON_BUILD/$PKG_ADDON_ID/lib
cp -PL $(get_build_dir pango)/.install_pkg/usr/lib/libpango-1.0.so.0 $ADDON_BUILD/$PKG_ADDON_ID/lib
cp -PL $(get_build_dir pango)/.install_pkg/usr/lib/libpangoft2-1.0.so.0 $ADDON_BUILD/$PKG_ADDON_ID/lib
# cairo
cp -PL $(get_build_dir cairo)/.install_pkg/usr/lib/libcairo.so.2 $ADDON_BUILD/$PKG_ADDON_ID/lib
# gtk
cp -PL $(get_build_dir gtk+)/.install_pkg/usr/lib/libgdk-x11-2.0.so.0 $ADDON_BUILD/$PKG_ADDON_ID/lib
cp -PL $(get_build_dir gtk+)/.install_pkg/usr/lib/libgtk-x11-2.0.so.0 $ADDON_BUILD/$PKG_ADDON_ID/lib
# harfbuzz
cp -PL $(get_build_dir harfbuzz)/.install_pkg/usr/lib/libharfbuzz.so* $ADDON_BUILD/$PKG_ADDON_ID/lib
cp -PL $(get_build_dir harfbuzz)/.install_pkg/usr/lib/libharfbuzz-icu.so* $ADDON_BUILD/$PKG_ADDON_ID/lib
# gdk-pixbuf
cp -PL $(get_build_dir gdk-pixbuf)/.install_pkg/usr/lib/libgdk_pixbuf-2.0.so.0 $ADDON_BUILD/$PKG_ADDON_ID/lib
# pixbuf loaders
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/gdk-pixbuf-modules
cp -PL $(get_build_dir gdk-pixbuf)/.install_pkg/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/* $ADDON_BUILD/$PKG_ADDON_ID/gdk-pixbuf-modules
# libexif
cp -PL $(get_build_dir libexif)/.install_pkg/usr/lib/* $ADDON_BUILD/$PKG_ADDON_ID/lib
# libva-vdpau-driver
cp -PL $(get_build_dir libva-vdpau-driver)/.install_pkg/usr/lib/dri/*.so $ADDON_BUILD/$PKG_ADDON_ID/lib
# unclutter
cp -P $(get_build_dir unclutter)/.install_pkg/usr/bin/unclutter $ADDON_BUILD/$PKG_ADDON_ID/bin
# xdotool
cp -P $(get_build_dir xdotool)/xdotool $ADDON_BUILD/$PKG_ADDON_ID/bin
}