diff --git a/.gitignore b/.gitignore index a01e5a08452..e9b7b6e64e2 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ output/ .vim/ .exrc .helix/ +.flatpak-builder/ # Environments .venv/ diff --git a/Meta/CMake/flatpak/angle-build.sh b/Meta/CMake/flatpak/angle-build.sh new file mode 100755 index 00000000000..16f515eb4fc --- /dev/null +++ b/Meta/CMake/flatpak/angle-build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +export PATH=$PWD/depot_tools:$PATH +cd angle + +ninja -j"$(nproc)" -C out diff --git a/Meta/CMake/flatpak/angle-checkout.sh b/Meta/CMake/flatpak/angle-checkout.sh new file mode 100755 index 00000000000..bfe5b97f325 --- /dev/null +++ b/Meta/CMake/flatpak/angle-checkout.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -e + +git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git depot_tools +export PATH=$PWD/depot_tools:$PATH + +gclient config https://chromium.googlesource.com/angle/angle < <(yes) +gclient sync -r chromium/7258 < <(yes) +gclient runhooks < <(yes) diff --git a/Meta/CMake/flatpak/angle-configure.sh b/Meta/CMake/flatpak/angle-configure.sh new file mode 100755 index 00000000000..837ccb8fa9f --- /dev/null +++ b/Meta/CMake/flatpak/angle-configure.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -e + +export PATH=$PWD/depot_tools:$PATH +cd angle + +gn gen out --args=' + is_official_build=true + is_component_build=true + is_debug=false + angle_build_tests=false + angle_enable_renderdoc=false + angle_enable_swiftshader=false + angle_enable_vulkan=true + angle_enable_wgpu=false + angle_expose_non_conformant_extensions_and_versions=true + angle_use_wayland=true + angle_use_x11=false + build_angle_deqp_tests=false + use_custom_libcxx=false + use_safe_libstdcxx=true + chrome_pgo_phase=0 + is_cfi = false +' diff --git a/Meta/CMake/flatpak/angle-install.sh b/Meta/CMake/flatpak/angle-install.sh new file mode 100755 index 00000000000..f14acdaea86 --- /dev/null +++ b/Meta/CMake/flatpak/angle-install.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +set -e + +export PATH=$PWD/depot_tools:$PATH +cd angle + +# Headers +pushd include + find . -type f -and -name "*.h" -exec install -D -m644 {} "$FLATPAK_DEST/include/angle/"{} \; +popd + +# Libraries +libs=( + libEGL.so + libEGL_vulkan_secondaries.so + libGLESv1_CM.so + libGLESv2.so + libGLESv2_vulkan_secondaries.so + libGLESv2_with_capture.so + libchrome_zlib.so + libfeature_support.so + libthird_party_abseil-cpp_absl.so +) + +for lib in "${libs[@]}"; do + install -D -m644 out/"$lib" "$FLATPAK_DEST/lib/$lib" +done + +# Pkg-config +mkdir -p "$FLATPAK_DEST/lib/pkgconfig" +cat > "$FLATPAK_DEST/lib/pkgconfig/angle.pc" < out/last_commit_position.h < Cache.cmake" + ] + }, + { + "type": "dir", + "path": "../../../" + } + ], + "build-options": { + "ldflags": "-Wl,-rpath-link,/app/lib" + }, + "config-opts": [ + "-CCache.cmake", + "-DCMAKE_PREFIX_PATH=/app", + "-DCMAKE_INSTALL_LIBDIR=lib", + "-DCMAKE_BUILD_TYPE=Release", + "-DENABLE_LTO_FOR_RELEASE=OFF", + "-DENABLE_INSTALL_FREEDESKTOP_FILES=ON", + "-DICU_ROOT=/app" + ] + } + ] +} diff --git a/Meta/CMake/flatpak/skia-build.sh b/Meta/CMake/flatpak/skia-build.sh new file mode 100755 index 00000000000..91c90c85a09 --- /dev/null +++ b/Meta/CMake/flatpak/skia-build.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +ninja -j"$(nproc)" -C out :skia :modules diff --git a/Meta/CMake/flatpak/skia-configure.sh b/Meta/CMake/flatpak/skia-configure.sh new file mode 100755 index 00000000000..e44426a6eab --- /dev/null +++ b/Meta/CMake/flatpak/skia-configure.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -e + +gn gen out --args=' + is_official_build=true + is_component_build=true + is_debug=false + skia_use_dng_sdk=false + skia_use_wuffs=false + skia_use_zlib=true + skia_use_system_zlib=true + skia_use_harfbuzz=true + skia_use_vulkan=true + skia_use_fontconfig=true + skia_use_icu=true + skia_use_system_icu=true + extra_cflags=["-DSK_USE_EXTERNAL_VULKAN_HEADERS","-Wno-psabi"] + extra_cflags_cc=["-DSKCMS_API=__attribute__((visibility(\"default\")))"] +' diff --git a/Meta/CMake/flatpak/skia-install.sh b/Meta/CMake/flatpak/skia-install.sh new file mode 100755 index 00000000000..56c112af883 --- /dev/null +++ b/Meta/CMake/flatpak/skia-install.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +set -e + +# Libs +mkdir -p "$FLATPAK_DEST/lib" +for path in out/*.a out/*.so; do + install -Dm644 "$path" "$FLATPAK_DEST/lib/$(basename "$path")" +done + +# Includes +mkdir -p "$FLATPAK_DEST/include/skia/modules" +pushd include + find . -name '*.h' -exec install -Dm644 {} "$FLATPAK_DEST/include/skia/{}" \; +popd +pushd modules + find . -name '*.h' -exec install -Dm644 {} "$FLATPAK_DEST/include/skia/modules/{}" \; +popd + +# Pkg-config +mkdir -p "$FLATPAK_DEST/lib/pkgconfig" +cat > "$FLATPAK_DEST/lib/pkgconfig/skia.pc" <