mirror of
https://github.com/KeithDHedger/LFSPkgBuilds.git
synced 2025-07-28 23:22:42 +00:00
173 lines
6.2 KiB
Bash
Executable File
173 lines
6.2 KiB
Bash
Executable File
#!/bin/bash -e
|
|
|
|
. /usr/share/LFSPkg/LFSFunctions
|
|
|
|
DEPENDS="libgcrypt-1.6.3 libexif-0.6.21 git-2.11.1 pulseaudio-10.0 bzip2-1.0.6 flac-1.3.1 harfbuzz-1.4.2 icu-58.2 libevent-2.1.8 openjpeg-1.5.2 libpng-1.6.28 nspr-4.13.1 openssl-1.0.2 xdg-utils-1.1.1 yasm-1.3.0 krb5-1.15 desktop-file-utils-0.23 File-BaseDir-0.07 usbutils-008 ninja-1.7.2 gtk3-3.22.8"
|
|
|
|
if ! lfspkg -B "$DEPENDS";then
|
|
exit 100
|
|
fi
|
|
|
|
PKGNAME="chromium"
|
|
TARNAME="$PKGNAME"
|
|
VERSION="56.0.2924.87"
|
|
BUILD=${BUILD:-1}
|
|
SECTION="DESKTOP"
|
|
SUFFIX="LFSPKG"
|
|
TARBALL="${TARNAME}-${VERSION}.tar.xz"
|
|
|
|
GOOGLE_API_KEY="AIzaSyBhWJ-j5RXyt5911BMuVen-WuS10mvOnrY"
|
|
GOOGLE_DEFAULT_CLIENT_ID="952820686433-mbp5sv9scfj78siq96jlvrem47qgvbi3.apps.googleusercontent.com"
|
|
GOOGLE_DEFAULT_CLIENT_SECRET="XU4b-j0Ssy-XkTvSVmiFMvNY"
|
|
|
|
scriptLog "${PKGNAME}-${VERSION}"
|
|
gettar "https://commondatastorage.googleapis.com/chromium-browser-official/${TARBALL}" $SECTION
|
|
gettar "https://github.com/foutrelis/chromium-launcher/archive/v3.tar.gz" $SECTION "chromium-launcher-3.tar.gz"
|
|
#gettar "http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_58.0.3029.96-1_amd64.deb" $SECTION
|
|
|
|
PKG="${OUTPUT}/${PKGNAME}"
|
|
DOWHAT=${1:-"build"}
|
|
rm -rf "$PKG" || true
|
|
mkdir -p "$PKG"
|
|
|
|
pushd $COMPILEAT 2>/dev/null||true
|
|
|
|
tar -xvf "${SOURCEARCHIVES}/${SECTION}/${TARBALL}"
|
|
pushd "${TARNAME}-${VERSION}"
|
|
sed 's/#include <sys/mman.h>/&nn#if defined(MADV_FREE)n#undef MADV_FREEn#endifn/' -i third_party/WebKit/Source/wtf/allocator/PageAllocator.cpp
|
|
sed "s/^config("compiler") {/&ncflags_cc = [ "-fno-delete-null-pointer-checks" ]/" -i build/config/linux/BUILD.gn
|
|
sed "s/WIDEVINE_CDM_AVAILABLE/&nn#define WIDEVINE_CDM_VERSION_STRING "Pinkie Pie"/" -i third_party/widevine/cdm/stub/widevine_cdm_version.h
|
|
|
|
for LIB in flac harfbuzz-ng libwebp libxslt yasm
|
|
do
|
|
find -type f -path "*third_party/$LIB/*" ! -path "*third_party/$LIB/chromium/*" ! -path "*third_party/$LIB/google/*" ! -regex '.*.(gn|gni|isolate|py)' -delete
|
|
done
|
|
|
|
python build/linux/unbundle/replace_gn_files.py --system-libraries flac harfbuzz-ng libwebp libxslt yasm
|
|
|
|
GN_CONFIG=("google_api_key="$GOOGLE_API_KEY""
|
|
"google_default_client_id="$GOOGLE_DEFAULT_CLIENT_ID""
|
|
"google_default_client_secret="$GOOGLE_DEFAULT_CLIENT_SECRET""
|
|
'clang_use_chrome_plugins=false'
|
|
'enable_hangout_services_extension=true'
|
|
'enable_nacl=false'
|
|
'enable_nacl_nonsfi=false'
|
|
'enable_widevine=true'
|
|
'fatal_linker_warnings=false'
|
|
'ffmpeg_branding="Chrome"'
|
|
'fieldtrial_testing_like_official_build=true'
|
|
'is_debug=false'
|
|
'is_clang=false'
|
|
'link_pulseaudio=true'
|
|
'linux_use_bundled_binutils=false'
|
|
'proprietary_codecs=true'
|
|
'remove_webcore_debug_symbols=true'
|
|
'symbol_level=0'
|
|
'treat_warnings_as_errors=false'
|
|
'use_allocator="none"'
|
|
'use_cups=true'
|
|
'use_gconf=false'
|
|
'use_gnome_keyring=false'
|
|
'use_gold=false'
|
|
'use_gtk3=false'
|
|
'use_kerberos=true'
|
|
'use_pulseaudio=true'
|
|
'use_sysroot=false')
|
|
|
|
python tools/gn/bootstrap/bootstrap.py --gn-gen-args "${GN_CONFIG[*]}"
|
|
out/Release/gn gen out/Release --args="${GN_CONFIG[*]}"
|
|
|
|
ninja -C out/Release chrome chrome_sandbox chromedriver widevinecdmadapter
|
|
|
|
install -vDm755 out/Release/chrome $PKG/usr/lib${LIBDIRSUFFIX}/chromium/chromium
|
|
install -vDm4755 out/Release/chrome_sandbox $PKG/usr/lib${LIBDIRSUFFIX}/chromium/chrome-sandbox
|
|
install -vDm755 out/Release/chromedriver $PKG/usr/lib${LIBDIRSUFFIX}/chromium/chromedriver
|
|
|
|
mkdir -vp $PKG/usr/bin||true
|
|
ln -svf /usr/lib${LIBDIRSUFFIX}/chromium/chromium $PKG/usr/bin
|
|
ln -svf /usr/lib${LIBDIRSUFFIX}/chromium/chromedriver $PKG/usr/bin
|
|
|
|
install -vm755 out/Release/libwidevinecdmadapter.so $PKG/usr/lib${LIBDIRSUFFIX}/chromium
|
|
install -vDm644 out/Release/icudtl.dat $PKG/usr/lib${LIBDIRSUFFIX}/chromium
|
|
install -vDm644 out/Release/gen/content/content_resources.pak $PKG/usr/lib${LIBDIRSUFFIX}/chromium
|
|
install -vm644 out/Release/{*.pak,*.bin} $PKG/usr/lib${LIBDIRSUFFIX}/chromium
|
|
|
|
cp -av out/Release/locales $PKG/usr/lib${LIBDIRSUFFIX}/chromium
|
|
chown -Rv root:root $PKG/usr/lib${LIBDIRSUFFIX}/chromium/locales
|
|
|
|
install -vDm644 out/Release/chrome.1 $PKG/usr/share/man/man1/chromium.1
|
|
|
|
for size in 16 32
|
|
do
|
|
install -vDm644 "chrome/app/theme/default_100_percent/chromium/product_logo_$size.png" "$PKG/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
|
|
done
|
|
|
|
for size in 22 24 48 64 128 256
|
|
do
|
|
install -vDm644 "chrome/app/theme/chromium/product_logo_$size.png" "$PKG/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
|
|
done
|
|
|
|
mkdir -vp $PKG/usr/share/applications||true
|
|
cat > $PKG/usr/share/applications/chromium.desktop << "EOF"
|
|
[Desktop Entry]
|
|
Encoding=UTF-8
|
|
Name=Chromium Web Browser
|
|
Comment=Access the Internet
|
|
GenericName=Web Browser
|
|
Exec=chromium --disable-gpu %u
|
|
Terminal=false
|
|
Type=Application
|
|
Icon=chromium
|
|
Categories=GTK;Network;WebBrowser;
|
|
MimeType=application/xhtml+xml;text/xml;application/xhtml+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
|
|
EOF
|
|
|
|
tar -xf ${SOURCEARCHIVES}/${SECTION}/chromium-launcher-3.tar.gz
|
|
cd chromium-launcher-3
|
|
make PREFIX=/usr
|
|
rm -f $PKG/usr/bin/chromium
|
|
make PREFIX=/usr install-strip DESTDIR=$PKG||exit 1
|
|
#cd ..
|
|
|
|
#mkdir temp||true
|
|
#cd temp
|
|
# case $(uname -m) in
|
|
# x86_64) ar -x ${SOURCEARCHIVES}/${SECTION}/google-chrome-stable_58.0.3029.96-1_amd64.deb
|
|
# ;;
|
|
# x86) ar -x ${SOURCEARCHIVES}/${SECTION}/google-chrome-stable_48.0.2564.116-1_i386.deb
|
|
# ;;
|
|
# esac
|
|
#
|
|
# tar -xf data.tar.xz
|
|
# mkdir -vp $PKG/usr/lib${LIBDIRSUFFIX}/chromium/popd
|
|
# install -vm755 ../out/Release/libwidevinecdmadapter.so $PKG/usr/lib${LIBDIRSUFFIX}/chromium
|
|
# install -vm755 opt/google/chrome/libwidevinecdm.so $PKG/usr/lib${LIBDIRSUFFIX}/chromium/popd
|
|
popd
|
|
|
|
checketc $PKG
|
|
packageclean "$PKG"
|
|
|
|
pushd "$PKG"
|
|
/usr/bin/lfspkg -n "$PKGNAME" -p "$VERSION" -d $SECTION -b $BUILD -s $SUFFIX -m
|
|
popd
|
|
|
|
case $DOWHAT in
|
|
up*)
|
|
lfspkg "^${PKGNAME}-[0-9][0-9]*" "${OUTPUT}/${SECTION}/${PKGNAME}-${VERSION}-${BUILD}_${SECTION}_${SUFFIX}.tar.gz" -u
|
|
;;
|
|
"install")
|
|
lfspkg "${OUTPUT}/${SECTION}/${PKGNAME}-${VERSION}-${BUILD}_${SECTION}_${SUFFIX}.tar.gz" -i
|
|
;;
|
|
"build")
|
|
echo "Just built"
|
|
;;
|
|
*)
|
|
echo "*** Unknown command ***"
|
|
exit 1
|
|
esac
|
|
|
|
echo "Removing source folder, please wait ..."
|
|
rm -r "$PKG" "${TARNAME}-${VERSION}"
|
|
popd 2>/dev/null||true
|
|
|