From 3413bf2810b173c23aa6e523eea7aad5d4750d6a Mon Sep 17 00:00:00 2001 From: David Zbarsky Date: Tue, 29 Aug 2023 17:00:23 -0400 Subject: [PATCH] initial commit --- .github/workflows/amd64-linux.yml | 23 ++++++++++ .github/workflows/arm64-linux.yml | 23 ++++++++++ .gitignore | 3 ++ build.sh | 74 +++++++++++++++++++++++++++++++ release.sh | 2 + 5 files changed, 125 insertions(+) create mode 100644 .github/workflows/amd64-linux.yml create mode 100644 .github/workflows/arm64-linux.yml create mode 100644 .gitignore create mode 100755 build.sh create mode 100755 release.sh diff --git a/.github/workflows/amd64-linux.yml b/.github/workflows/amd64-linux.yml new file mode 100644 index 0000000..acc8301 --- /dev/null +++ b/.github/workflows/amd64-linux.yml @@ -0,0 +1,23 @@ +name: release-amd64-linux + +on: + push: + tags: + - "v*.*.*" + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Build + run: NAME="debian_bullseye_amd64_sysroot" LIB_ARCH="x86_64" URL="https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/f5f68713249b52b35db9e08f67184cac392369ab/debian_bullseye_amd64_sysroot.tar.xz" ./build.sh + + - name: Release artifact + uses: softprops/action-gh-release@v1 + with: + files: | + debian_bullseye_amd64_sysroot.tar.xz + debian_bullseye_amd64_sysroot.tar.zst diff --git a/.github/workflows/arm64-linux.yml b/.github/workflows/arm64-linux.yml new file mode 100644 index 0000000..745009f --- /dev/null +++ b/.github/workflows/arm64-linux.yml @@ -0,0 +1,23 @@ +name: release-arm64-linux + +on: + push: + tags: + - "v*.*.*" + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Build + run: NAME="debian_bullseye_arm64_sysroot" LIB_ARCH="aarch64" URL="https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/80fc74e431f37f590d0c85f16a9d8709088929e8/debian_bullseye_arm64_sysroot.tar.xz" ./build.sh + + - name: Release artifact + uses: softprops/action-gh-release@v1 + with: + files: | + debian_bullseye_arm64_sysroot.tar.xz + debian_bullseye_arm64_sysroot.tar.zst diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..328dff8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +clang+llvm-16.0.3-arm64-apple-darwin22.0* +bin/ +*.swp diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..8060079 --- /dev/null +++ b/build.sh @@ -0,0 +1,74 @@ +set -eux + +curl -L "$URL" -o src.tar.xz +tar -xvf src.tar.xz \ + "./lib" \ + "./usr/include" \ + "./usr/lib/gcc" \ + "./usr/lib/$LIB_ARCH-linux-gnu" \ + &>/dev/null + +# Cleanup some includes Chrome uses. +# TODO(zbarsky): It would be cleaner to start from a clean state and build a more minimal sysroot. + +rm -rf "usr/include/EGL" +rm -rf "usr/include/FLAC" +rm -rf "usr/include/GL" +rm -rf "usr/include/GLES" +rm -rf "usr/include/GLES2" +rm -rf "usr/include/GLES3" +rm -rf "usr/include/X11" +rm -rf "usr/include/alsa" +rm -rf "usr/include/at-spi-2.0" +rm -rf "usr/include/atk-1.0" +rm -rf "usr/include/bluetooth" +rm -rf "usr/include/cairo" +rm -rf "usr/include/dbus-1.0" +rm -rf "usr/include/epoxy" +rm -rf "usr/include/freetype2" +rm -rf "usr/include/fribidi" +rm -rf "usr/include/gdk-pixbuf-2.0" +rm -rf "usr/include/glib-2.0" +rm -rf "usr/include/gio-unix-2.0" +rm -rf "usr/include/gnutls" +rm -rf "usr/include/graphene-1.0" +rm -rf "usr/include/gtk-3.0" +rm -rf "usr/include/gtk-4.0" +rm -rf "usr/include/harfbuzz" +rm -rf "usr/include/libevdev-1.0" +rm -rf "usr/include/libxml2" +rm -rf "usr/include/jsoncpp" +rm -rf "usr/include/krb5" +rm -rf "usr/include/libdbusmenu-glib-0.4" +rm -rf "usr/include/libdrm" +rm -rf "usr/include/libpng"* +rm -rf "usr/include/libxslt" +rm -rf "usr/include/linux" +rm -rf "usr/include/mit-krb5" +rm -rf "usr/include/nspr" +rm -rf "usr/include/nss" +rm -rf "usr/include/openssl" +rm -rf "usr/include/opus" +rm -rf "usr/include/pango-1.0" +rm -rf "usr/include/pipewire-0.3" +rm -rf "usr/include/pulse" +rm -rf "usr/include/spa-0.2" +rm -rf "usr/include/sound" +rm -rf "usr/include/systemd" +rm -rf "usr/include/xcb" +rm -rf "usr/include/xkbcommon" +rm -rf "usr/include/valgrind" +rm -rf "usr/include/vulkan" +rm -rf "usr/include/webp" +rm -rf "usr/include/zlib.h" +rm -rf "usr/include/$LIB_ARCH-linux-gnu/qt5" +rm -rf "usr/include/$LIB_ARCH-linux-gnu/qt6" + +mv "./usr/lib/$LIB_ARCH-linux-gnu" "./usr/lib/$LIB_ARCH-linux-gnu-backup" +mkdir "./usr/lib/$LIB_ARCH-linux-gnu" + +mv "./usr/lib/$LIB_ARCH-linux-gnu-backup"/{*.o,libc*,libm*,libpthread*,librt*} "./usr/lib/$LIB_ARCH-linux-gnu" +rm -rf "./usr/lib/$LIB_ARCH-linux-gnu-backup" + +tar -cJf "$NAME.tar.xz" lib/ usr/ +tar -c -I zstd f "$NAME.tar.zst" lib/ usr/ diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..bf9b132 --- /dev/null +++ b/release.sh @@ -0,0 +1,2 @@ +git tag -a $VERSION -m "$VERSION" +git push origin $VERSION