mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-08 15:13:56 -05:00
* Refactor and update webkit2gtk_4_1 Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add arm patch. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust env options Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add x86_64 build. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust build settings. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust arm build options. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * lint Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust arm build. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * lint Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust g++ in build. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add cache_build plumbing. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add NESTED_CI detection plumbing to see if we are running in a container on GitHub Actions. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust download options for cached builds. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust timed kill to kill cmake. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust triggering of cache_build. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Cleanup output. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update cached build hash verification. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Rubyize #{build_cachefile}.sha256 write. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust documentation of cache_build trigger. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Also kill all ruby processes after finishing cache_build. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Make cached build download info more useful. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add --regenerate-filelist option. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Fix downloader. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Try newer git commit. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * remove arm patch. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust hash checking for build downloads. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add message for checksum calculation since that can take a while. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add cached build restart code block. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add max build time to build workflow. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * fixup buildsystems Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Set workflow max build time to 5.5 hours. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Indicate architectures for build in build workflow title. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust cached build uploading. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust workflow naming. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust installs after build. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust cached build logic. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * webkit => 2.50.1 Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust zstd options. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Move CREW_CACHE_DIR to /tmp in GitHub Action containers. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust build cache location. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * revert crew const variable changes. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust CREW_KERNEL_VERSION for CI usage. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Exclude @pkg.no_source_build? packages from cached builds. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Always create CREW_CACHE_DIR. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Clean up remnant @extract_dir folders from download command. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust permissions in workflow. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Sync up workflows. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * lint Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add x86_64 binaries Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Cleanup workflows. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Do not use build cache if package binary exists. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * webkit: Package File Update Run on linux/amd64 container. * webkit: Package File Update Run on linux/arm/v7 container. --------- Signed-off-by: Satadru Pramanik <satadru@gmail.com> Co-authored-by: satmandu <satmandu@users.noreply.github.com>
152 lines
5.2 KiB
Ruby
152 lines
5.2 KiB
Ruby
require 'buildsystems/cmake'
|
|
|
|
class Webkit2gtk_4_1 < CMake
|
|
description 'Web content engine for GTK'
|
|
homepage 'https://webkitgtk.org'
|
|
version '2.50.1'
|
|
license 'LGPL-2+ and BSD-2'
|
|
compatibility 'aarch64 armv7l x86_64'
|
|
source_url 'https://github.com/WebKit/WebKit.git'
|
|
git_hashtag "webkitgtk-#{version}"
|
|
# From the webkitglib/2.50 branch.
|
|
# git_hashtag '84fb745f2dec1b1f6417ee6059e76a60f6a4f96b'
|
|
# source_url "https://webkitgtk.org/releases/webkitgtk-#{version.split('-').first}.tar.xz"
|
|
# source_sha256 'e564b8099f9a3ae32409539b290bbd2ad084e99b6d22d4aac5e51e4554df8bc2'
|
|
binary_compression 'tar.zst'
|
|
|
|
binary_sha256({
|
|
aarch64: 'ca91b3dab02d6204eaadab28efbffa85dff186eb02ca7acef28bfc838cc385e6',
|
|
armv7l: 'ca91b3dab02d6204eaadab28efbffa85dff186eb02ca7acef28bfc838cc385e6',
|
|
x86_64: '5665205aa7b768e4234fee8800b19f8ec52736009b4f136d6af30d9e75394395'
|
|
})
|
|
|
|
depends_on 'at_spi2_core' # R
|
|
depends_on 'cairo' # R
|
|
depends_on 'dav1d' => :build
|
|
depends_on 'enchant' # R
|
|
depends_on 'expat' # R
|
|
depends_on 'fontconfig'
|
|
depends_on 'freetype' # R
|
|
depends_on 'gcc_lib' # R
|
|
depends_on 'gdk_pixbuf' # R
|
|
depends_on 'glib' # R
|
|
depends_on 'glibc' # R
|
|
depends_on 'gobject_introspection' => :build
|
|
depends_on 'gstreamer' # R
|
|
depends_on 'gtk3' # R
|
|
depends_on 'gtk_doc' => :build
|
|
depends_on 'harfbuzz' # R
|
|
depends_on 'hyphen' # R
|
|
depends_on 'icu4c' # R
|
|
depends_on 'lcms' # R
|
|
depends_on 'libavif' # R
|
|
depends_on 'libbacktrace' # R
|
|
depends_on 'libdrm' # R
|
|
depends_on 'libepoxy' # R
|
|
depends_on 'libgcrypt' # R
|
|
depends_on 'libgpg_error' # R
|
|
depends_on 'libjpeg_turbo' # R
|
|
depends_on 'libjxl' # R
|
|
depends_on 'libnotify'
|
|
depends_on 'libpng' # R
|
|
depends_on 'libsecret' # R
|
|
depends_on 'libsoup' # R
|
|
depends_on 'libtasn1' # R
|
|
depends_on 'libwebp' # R
|
|
depends_on 'libx11' # R
|
|
depends_on 'libxml2' # R
|
|
depends_on 'libxslt' # R
|
|
depends_on 'mesa' # R
|
|
depends_on 'pango' # R
|
|
depends_on 'py3_gi_docgen' => :build
|
|
depends_on 'py3_smartypants' => :build
|
|
depends_on 'sqlite' # R
|
|
depends_on 'sysprof' => :build
|
|
depends_on 'unifdef' => :build
|
|
depends_on 'valgrind' => :build
|
|
depends_on 'vulkan_icd_loader'
|
|
depends_on 'wayland' # R
|
|
depends_on 'woff2' # R
|
|
depends_on 'zlib' # R
|
|
|
|
cache_build
|
|
no_env_options
|
|
no_lto
|
|
|
|
def self.patch
|
|
system "sed -i 's,/usr/bin,/usr/local/bin,g' Source/JavaScriptCore/inspector/scripts/codegen/preprocess.pl"
|
|
end
|
|
|
|
pre_cmake_options "CC=#{CREW_PREFIX}/bin/gcc CXX=#{CREW_PREFIX}/bin/g++"
|
|
cmake_options "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
|
|
-DENABLE_BUBBLEWRAP_SANDBOX=OFF \
|
|
-DENABLE_DOCUMENTATION=OFF \
|
|
-DENABLE_GAMEPAD=OFF \
|
|
-DENABLE_JOURNALD_LOG=OFF \
|
|
-DENABLE_MINIBROWSER=ON \
|
|
-DENABLE_SPEECH_SYNTHESIS=OFF \
|
|
-DPORT=GTK \
|
|
-DPYTHON_EXECUTABLE=`which python` \
|
|
-DUSER_AGENT_BRANDING='Chromebrew' \
|
|
-DUSE_GTK4=OFF \
|
|
-DUSE_JPEGXL=ON \
|
|
-DUSE_SOUP2=OFF"
|
|
cmake_pre_cache_build_extras do
|
|
# This only works in the container.
|
|
system "sudo ln -sf #{CREW_PREFIX}/bin/gcc /usr/bin/gcc" if CREW_IN_CONTAINER
|
|
system "sudo ln -sf #{CREW_PREFIX}/bin/g++ /usr/bin/g++" if CREW_IN_CONTAINER
|
|
if ARCH == 'armv7l'
|
|
@arch_flags = '-mfloat-abi=hard -mtls-dialect=gnu -mthumb -mfpu=vfpv3-d16 -mlibarch=armv7-a+fp -march=armv7-a+fp'
|
|
@new_gcc = <<~NEW_GCCEOF
|
|
#!/bin/bash
|
|
gcc #{@arch_flags} $@
|
|
NEW_GCCEOF
|
|
@new_gpp = <<~NEW_GPPEOF
|
|
#!/bin/bash
|
|
# See https://wiki.debian.org/ReduceBuildMemoryOverhead
|
|
g++ #{@arch_flags} --param ggc-min-expand=10 $@
|
|
# g++ #{@arch_flags} $@
|
|
NEW_GPPEOF
|
|
FileUtils.mkdir_p 'bin'
|
|
File.write('bin/gcc', @new_gcc)
|
|
FileUtils.chmod 0o755, 'bin/gcc'
|
|
File.write('bin/g++', @new_gpp)
|
|
FileUtils.chmod 0o755, 'bin/g++'
|
|
end
|
|
end
|
|
|
|
if ARCH == 'armv7l'
|
|
def self.build
|
|
# This builds webkit2gtk4_1 (which uses gtk3, but not libsoup2)
|
|
@workdir = Dir.pwd
|
|
# Bubblewrap sandbox breaks on epiphany with
|
|
# bwrap: Can't make symlink at /var/run: File exists
|
|
# LDFLAGS from debian: -Wl,--no-keep-memory
|
|
unless File.file?('build.ninja')
|
|
@arch_linker_flags = ARCH == 'x86_64' ? '' : '-Wl,--no-keep-memory'
|
|
system "CC='#{@workdir}/bin/gcc' CXX='#{@workdir}/bin/g++' CREW_LINKER_FLAGS='#{@arch_linker_flags}' \
|
|
cmake -B builddir -G Ninja \
|
|
#{CREW_CMAKE_OPTIONS.sub('-pipe', '-pipe -Wno-error').gsub('-flto=auto', '').sub('-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=TRUE', '')} \
|
|
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
|
|
-DENABLE_BUBBLEWRAP_SANDBOX=OFF \
|
|
-DENABLE_DOCUMENTATION=OFF \
|
|
-DENABLE_GAMEPAD=OFF \
|
|
-DENABLE_JOURNALD_LOG=OFF \
|
|
-DENABLE_MINIBROWSER=ON \
|
|
-DENABLE_SPEECH_SYNTHESIS=OFF \
|
|
-DPORT=GTK \
|
|
-DPYTHON_EXECUTABLE=`which python` \
|
|
-DUSER_AGENT_BRANDING='Chromebrew' \
|
|
-DUSE_GTK4=OFF \
|
|
-DUSE_JPEGXL=ON \
|
|
-DUSE_SOUP2=OFF"
|
|
end
|
|
Kernel.system "#{CREW_NINJA} -C builddir -j #{CREW_NPROC}"
|
|
end
|
|
end
|
|
|
|
cmake_install_extras do
|
|
FileUtils.mv "#{CREW_DEST_PREFIX}/bin/WebKitWebDriver", "#{CREW_DEST_PREFIX}/bin/WebKitWebDriver_4.1"
|
|
end
|
|
end
|