# Ladybird Web Browser RPM SPEC file # # Target distributions: RHEL 10, Rocky Linux 10, Fedora 44 # SPDX-License-Identifier: BSD-3-Clause # Maintainer: Dejan Lekic ############################################################################# # Distribution compatibility information ############################################################################# # This spec is designed for: # - RHEL 10 / Rocky Linux 10 (using GCC 14.x) # - Fedora 44 (using GCC 14.x) # # All these distributions ship with GCC 14.x which requires our C++20 concepts patch. # The BuildRequires will naturally prevent building on older distributions. ############################################################################# # Global settings ############################################################################# # Disable automatic debug package generation (we handle this ourselves) %global debug_package %{nil} # Disable LTO - causes issues with liblagom-main.a containing main() %global _lto_cflags %{nil} # Ladybird uses its own RPATH handling for bundled libraries %undefine _cmake_skip_rpath # Prevent stripping of binaries (preserves debug info for crash reports) %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!.*brp-strip.*!!g') # Filter out auto-detected dependencies on bundled vcpkg libraries # These are installed to a private directory and should not be system requirements %global __requires_exclude ^lib(cpptrace|skia|simdjson|simdutf|sqlite3|libEGL_angle|libGLESv2_angle|icudata|icui18n|icuuc|tommath|avcodec|avformat|avutil|swresample|avif|brotlicommon|brotlidec|brotlienc|curl|crypto|ssl|dav1d|expat|fontconfig|freetype|harfbuzz|jpeg|jxl|jxl_cms|jxl_threads|png16|webp|webpdecoder|webpdemux|webpmux|woff2common|woff2dec|xml2|z|zstd|SDL3|openh264|opus|ogg|vorbis|vpx|tiff|lcms2|highway|nghttp2|nghttp3|ngtcp2)\\.so # Filter out auto-generated provides for bundled vcpkg libraries %global __provides_exclude ^lib(cpptrace|skia|simdjson|simdutf|sqlite3|libEGL_angle|libGLESv2_angle|icudata|icui18n|icuuc|tommath|avcodec|avformat|avutil|swresample|avif|brotlicommon|brotlidec|brotlienc|curl|crypto|ssl|dav1d|expat|fontconfig|freetype|harfbuzz|jpeg|jxl|jxl_cms|jxl_threads|png16|webp|webpdecoder|webpdemux|webpmux|woff2common|woff2dec|xml2|z|zstd|SDL3|openh264|opus|ogg|vorbis|vpx|tiff|lcms2|highway|nghttp2|nghttp3|ngtcp2)\\.so # Private library directory for bundled dependencies %global ladybird_libdir %{_libdir}/%{name} %global ladybird_libexecdir %{_libexecdir}/%{name} # Relative paths for CMake (avoid double-prefix issues) %global ladybird_libdir_rel lib64/%{name} %global ladybird_libexecdir_rel libexec/%{name} ############################################################################# # Version information ############################################################################# %global git_commit 1c20baf3f3e84c98a242d77bd4f119cf5c1ee6ab %global git_date 20260523 %global upstream_version 0.1.0 ############################################################################# # Build conditionals ############################################################################# %bcond qt 1 %bcond tests 0 %bcond debug 0 ############################################################################# # Package metadata ############################################################################# Name: ladybird Version: %{upstream_version} Release: 0.%{git_date}git%(c=%{git_commit}; echo ${c:0:10})%{?dist} Summary: A truly independent web browser using a novel engine based on web standards License: BSD-2-Clause URL: https://ladybird.org Source0: https://github.com/LadybirdBrowser/ladybird/archive/%{git_commit}.tar.gz#/%{name}-%{git_commit}.tar.gz # Patch for GCC 14.x C++20 concepts bug (circular constraint evaluation) # Required for all target distributions (RHEL 10, Rocky 10, Fedora 44) Patch0: ladybird-gcc14-concepts-fix.patch # 64-bit architectures only ExclusiveArch: x86_64 aarch64 ############################################################################# # Build requirements - Common to all target distributions ############################################################################# # Build tools BuildRequires: cmake >= 3.30 BuildRequires: ninja-build BuildRequires: gcc-c++ >= 14 BuildRequires: rust >= 1.75 BuildRequires: cargo >= 1.75 BuildRequires: git-core BuildRequires: ccache BuildRequires: pkgconfig BuildRequires: make # Python for code generation BuildRequires: python3 >= 3.9 BuildRequires: python3-devel # Autotools for vcpkg dependencies BuildRequires: autoconf >= 2.71 BuildRequires: autoconf-archive BuildRequires: automake BuildRequires: libtool # Additional build tools BuildRequires: nasm BuildRequires: patchelf BuildRequires: curl BuildRequires: tar BuildRequires: unzip BuildRequires: zip BuildRequires: bison BuildRequires: flex BuildRequires: gperf # Perl modules for dependency builds BuildRequires: perl-interpreter BuildRequires: perl-generators BuildRequires: perl(FindBin) BuildRequires: perl(IPC::Cmd) BuildRequires: perl(lib) BuildRequires: perl(Time::Piece) BuildRequires: perl(File::Copy) # Graphics libraries BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(egl) BuildRequires: pkgconfig(gbm) BuildRequires: mesa-libGL-devel BuildRequires: mesa-libEGL-devel BuildRequires: libglvnd-devel BuildRequires: vulkan-headers BuildRequires: vulkan-loader-devel # Audio BuildRequires: pkgconfig(libpulse) # Wayland (X11 support dropped - Wayland only) BuildRequires: pkgconfig(wayland-client) BuildRequires: pkgconfig(wayland-protocols) BuildRequires: pkgconfig(wayland-cursor) BuildRequires: pkgconfig(wayland-egl) BuildRequires: pkgconfig(xkbcommon) %if %{with qt} # Qt6 UI (all target distributions have Qt6 >= 6.4) BuildRequires: qt6-qtbase-devel >= 6.4 BuildRequires: qt6-qttools-devel BuildRequires: qt6-qtwayland-devel %endif # System libraries needed during build BuildRequires: zlib-ng-compat-static BuildRequires: openssl-devel # Desktop integration tools BuildRequires: desktop-file-utils BuildRequires: libappstream-glib # Fonts for rendering BuildRequires: liberation-sans-fonts ############################################################################# # Runtime requirements ############################################################################# Requires: liberation-sans-fonts Requires: google-noto-emoji-fonts Requires: hicolor-icon-theme # Wayland compositor required (no X11 support) Requires: wayland # Optional but recommended Recommends: pulseaudio-libs Recommends: pipewire-pulseaudio Recommends: mesa-dri-drivers Recommends: mesa-vulkan-drivers Recommends: dbus ############################################################################# # Bundled dependencies (vcpkg-managed) ############################################################################# Provides: bundled(skia) = 144 Provides: bundled(angle) = chromium_7258 Provides: bundled(ffmpeg) = 7.1.1 Provides: bundled(dav1d) = 1.5.1 Provides: bundled(libavif) = 1.3.0 Provides: bundled(libjxl) = 0.11.1 Provides: bundled(icu) = 78.1 Provides: bundled(harfbuzz) = 10.2.0 Provides: bundled(woff2) = 1.0.2 Provides: bundled(curl) = 8.16.0 Provides: bundled(openssl) = 3.5.3 Provides: bundled(nghttp2) = 1.68.0 Provides: bundled(libpng) = 1.6.50 Provides: bundled(libjpeg-turbo) = 3.1.1 Provides: bundled(libwebp) = 1.6.0 Provides: bundled(libtiff) Provides: bundled(simdjson) = 4.2.4 Provides: bundled(simdutf) = 7.4.0 Provides: bundled(sqlite) = 3.50.4 Provides: bundled(libxml2) = 2.13.8 Provides: bundled(fast-float) = 8.1.0 Provides: bundled(fontconfig) = 2.15.0 Provides: bundled(libtommath) = 1.3.0 Provides: bundled(cpptrace) = 1.0.2 Provides: bundled(dbus) = 1.16.2 Provides: bundled(libproxy) = 0.4.18 Provides: bundled(sdl3) = 3.2.28 Provides: bundled(zlib) = 1.3.1 %description Ladybird is a truly independent web browser using a novel engine based on web standards. It is not a fork of or based on Blink, Gecko, or WebKit. Built specifically for RHEL 10, Rocky Linux 10, and Fedora 44. Wayland-only - X11 support has been dropped. Key features: - Multi-process architecture for security and stability - Independent LibWeb rendering engine - Independent LibJS JavaScript engine - Independent LibWasm WebAssembly implementation - Sandboxed renderer and network processes Components: - Main UI process (Qt6-based) - Compositor process (rendering pipeline) - WebContent renderer processes (one per tab) - ImageDecoder process (secure image handling) - RequestServer process (network requests) - WebWorker process (background JavaScript) Note: Ladybird is currently in a pre-alpha state, suitable for developers, testers, and early adopters. Many websites may not work correctly yet. ############################################################################# # Devel subpackage ############################################################################# %package devel Summary: Development files for Ladybird browser components Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Development files for embedding or extending Ladybird components. Warning: The Ladybird API is unstable and subject to change without notice. ############################################################################# # Prep ############################################################################# %prep %autosetup -n %{name}-%{git_commit} -p1 # Clean build directory rm -rf Build/ ############################################################################# # Build ############################################################################# %build # Environment setup export VCPKG_ROOT="${PWD}/Build/vcpkg" export VCPKG_FORCE_SYSTEM_BINARIES=1 export LADYBIRD_SOURCE_DIR="${PWD}" # Clear RPM build flags that interfere with vcpkg unset CFLAGS CXXFLAGS LDFLAGS FFLAGS FCFLAGS # Set architecture-specific compiler flags # Use baseline architectures for maximum compatibility across CPUs %ifarch x86_64 export CFLAGS="-march=x86-64-v2" export CXXFLAGS="-march=x86-64-v2" %endif %ifarch aarch64 export CFLAGS="-march=armv8-a" export CXXFLAGS="-march=armv8-a" %endif # Clone and bootstrap vcpkg if [ ! -d "${VCPKG_ROOT}" ]; then mkdir -p Build git clone https://github.com/microsoft/vcpkg.git "${VCPKG_ROOT}" fi # Unshallow if needed (vcpkg requires full git history) if [ -f "${VCPKG_ROOT}/.git/shallow" ]; then git -C "${VCPKG_ROOT}" fetch --unshallow fi # Bootstrap vcpkg if [ ! -x "${VCPKG_ROOT}/vcpkg" ]; then "${VCPKG_ROOT}/bootstrap-vcpkg.sh" -disableMetrics fi # Prepare build mkdir -p Build/caches %if %{with debug} BUILD_TYPE="Debug" VCPKG_TRIPLETS="${PWD}/Meta/CMake/vcpkg/debug-triplets" %else BUILD_TYPE="Release" VCPKG_TRIPLETS="${PWD}/Meta/CMake/vcpkg/release-triplets" %endif # Configure cmake -B Build/release -S . \ -G Ninja \ -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DCMAKE_INSTALL_BINDIR=bin \ -DCMAKE_INSTALL_LIBDIR=%{ladybird_libdir_rel} \ -DCMAKE_INSTALL_LIBEXECDIR=%{ladybird_libexecdir_rel} \ -DCMAKE_INSTALL_DATADIR=share \ -DCMAKE_INSTALL_INCLUDEDIR=include \ -DCMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" \ -DVCPKG_INSTALL_OPTIONS="--no-print-usage" \ -DVCPKG_OVERLAY_TRIPLETS="${VCPKG_TRIPLETS}" \ -DBUILD_SHARED_LIBS=ON \ -DENABLE_QT=%{?with_qt:ON}%{!?with_qt:OFF} \ -DENABLE_INSTALL_FREEDESKTOP_FILES=ON \ -DENABLE_INSTALL_HEADERS=ON \ -DENABLE_GUI_TARGETS=ON \ -DENABLE_LTO_FOR_RELEASE=OFF \ -DLADYBIRD_CACHE_DIR="${PWD}/Build/caches" # Replace -march=native in generated build files %ifarch x86_64 find Build/release -name 'build.ninja' -o -name 'flags.make' | xargs -r sed -i 's/-march=native/-march=x86-64-v2/g' %endif %ifarch aarch64 find Build/release -name 'build.ninja' -o -name 'flags.make' | xargs -r sed -i 's/-march=native/-march=armv8-a/g' %endif # Build cmake --build Build/release --parallel %{?_smp_mflags} ############################################################################# # Install ############################################################################# %install DESTDIR=%{buildroot} cmake --install Build/release # Copy vcpkg shared libraries to private lib directory VCPKG_LIB_DIR="${PWD}/Build/release/vcpkg_installed/x64-linux-dynamic/lib" if [ -d "${VCPKG_LIB_DIR}" ]; then find "${VCPKG_LIB_DIR}" -maxdepth 1 -name "*.so*" -exec cp -a {} %{buildroot}%{ladybird_libdir}/ \; fi # Fix RPATH for all binaries for binary in %{buildroot}%{_bindir}/*; do if [ -f "$binary" ] && file "$binary" | grep -q "ELF.*executable"; then patchelf --set-rpath '%{ladybird_libdir}' "$binary" || : fi done # Fix RPATH for helper processes for binary in %{buildroot}%{ladybird_libexecdir}/*; do if [ -f "$binary" ] && file "$binary" | grep -q "ELF"; then patchelf --set-rpath '%{ladybird_libdir}' "$binary" || : fi done # Fix RPATH for shared libraries for lib in %{buildroot}%{ladybird_libdir}/*.so*; do if [ -f "$lib" ] && ! [ -L "$lib" ] && file "$lib" | grep -q "ELF.*shared"; then patchelf --set-rpath '%{ladybird_libdir}' "$lib" || : fi done # Validate desktop integration desktop-file-validate %{buildroot}%{_datadir}/applications/org.ladybird.Ladybird.desktop appstream-util validate-relax --nonet \ %{buildroot}%{_datadir}/metainfo/org.ladybird.Ladybird.metainfo.xml || : ############################################################################# # Check ############################################################################# %check %if %{with tests} pushd Build/release ctest --output-on-failure --parallel %{?_smp_mflags} || : popd %endif ############################################################################# # Post-installation scriptlets ############################################################################# %post touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : %postun if [ $1 -eq 0 ]; then touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : fi %posttrans gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : update-desktop-database &>/dev/null || : ############################################################################# # Files ############################################################################# %files %license LICENSE %doc README.md CONTRIBUTING.md CODE_OF_CONDUCT.md SECURITY.md ISSUES.md %doc Documentation/ # Binaries %{_bindir}/Ladybird %{_bindir}/js %{_bindir}/wasm %{_prefix}/COMMIT # Helper processes %dir %{ladybird_libexecdir} %{ladybird_libexecdir}/Compositor %{ladybird_libexecdir}/ImageDecoder %{ladybird_libexecdir}/RequestServer %{ladybird_libexecdir}/WebContent %{ladybird_libexecdir}/WebWorker # Libraries %dir %{ladybird_libdir} %{ladybird_libdir}/*.so.* # Resources %{_datadir}/Lagom/ # Desktop integration %{_datadir}/applications/org.ladybird.Ladybird.desktop %{_datadir}/icons/hicolor/scalable/apps/org.ladybird.Ladybird.svg %{_datadir}/metainfo/org.ladybird.Ladybird.metainfo.xml %{_datadir}/dbus-1/services/org.ladybird.Ladybird.service %files devel %{ladybird_libdir}/*.so %{ladybird_libdir}/*.a %{_datadir}/Ladybird/ %{_includedir}/AK/ %{_includedir}/Lib*/ %{_includedir}/Services/ %{_includedir}/*Endpoint.h ############################################################################# # Changelog ############################################################################# %changelog * Fri May 23 2025 Dejan Lekic - 0.1.0-0.20260523git1c20baf3f3 - Update to snapshot 1c20baf3f3e84c98a242d77bd4f119cf5c1ee6ab - Add Rust/Cargo build requirements for LibRegex - Add GCC 14.x C++20 concepts patch - Target RHEL 10, Rocky 10, and Fedora 44 specifically - Use architecture-specific baseline compiler flags - Drop X11 support (Wayland only) * Mon Jan 13 2025 Dejan Lekic - 0.1.0-0.20260130gita5cabf341b - Initial RPM package - Pre-alpha development snapshot - Qt6 UI enabled by default - Multi-process sandboxed architecture