Skip to content

Commit

Permalink
seperate setup msys2 step
Browse files Browse the repository at this point in the history
  • Loading branch information
DerryAlex committed Aug 12, 2024
1 parent b725418 commit 36dca82
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/cimport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:

- uses: mlugg/[email protected]

- name: Setup msys2
run: cd test/abi && ./setup_msys2.sh && cd ../..

- name: Generate c.zig
run: cd test/abi && ./ci.sh && cd ../..

Expand Down
16 changes: 0 additions & 16 deletions test/abi/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,6 @@ pkg_rel=1 # used to trigger ci without actual changes
zig translate-c -cflags $(pkg-config --keep-system-cflags --cflags-only-I gtk4) -- c_linux.h >c_linux.zig
patch c_linux.zig c_linux.patch

# setup msys2 env
HEADERS_VERSION=$(wget -qO- "https://packages.msys2.org/api/search?query=headers" | jq -r ".results.exact.version")
wget -qO- "https://mirror.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-headers-git-$HEADERS_VERSION-any.pkg.tar.zst" | \
zstdcat - | tar -x ucrt64
WINPTHREADS_VERSION=$(wget -qO- "https://packages.msys2.org/api/search?query=winpthreads" | jq -r ".results.exact.version")
wget -qO- "https://mirror.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-winpthreads-git-$WINPTHREADS_VERSION-any.pkg.tar.zst" | \
zstdcat - | tar -x ucrt64
GLIB_VERSION=$(wget -qO- "https://packages.msys2.org/api/search?query=glib2" | jq -r ".results.exact.version")
wget -qO- "https://mirror.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-glib2-$GLIB_VERSION-any.pkg.tar.zst" | \
zstdcat - | tar -x ucrt64
PANGO_VERSION=$(wget -qO- "https://packages.msys2.org/api/search?query=pango" | jq -r ".results.exact.version")
wget -qO- "https://mirror.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-pango-$PANGO_VERSION-any.pkg.tar.zst" | \
zstdcat - | tar -x ucrt64
GTK_VERSION=$(wget -qO- "https://packages.msys2.org/api/search?query=gtk4" | jq -r ".results.exact.version")
wget -qO- "https://mirror.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-gtk4-$GTK_VERSION-any.pkg.tar.zst" | \
zstdcat - | tar -x ucrt64
# pkg-config cross-compliation support
sed -i 's:prefix=/ucrt64:prefix=ucrt64:g' ucrt64/lib/pkgconfig/*.pc
export PKG_CONFIG_PATH=$(pwd)/ucrt64/lib/pkgconfig/
Expand Down
16 changes: 16 additions & 0 deletions test/abi/setup_msys2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/bash
HEADERS_VERSION=$(wget -qO- "https://packages.msys2.org/api/search?query=headers" | jq -r ".results.exact.version")
wget -qO- "https://mirror.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-headers-git-$HEADERS_VERSION-any.pkg.tar.zst" | \
zstdcat - | tar -x ucrt64
WINPTHREADS_VERSION=$(wget -qO- "https://packages.msys2.org/api/search?query=winpthreads" | jq -r ".results.exact.version")
wget -qO- "https://mirror.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-winpthreads-git-$WINPTHREADS_VERSION-any.pkg.tar.zst" | \
zstdcat - | tar -x ucrt64
GLIB_VERSION=$(wget -qO- "https://packages.msys2.org/api/search?query=glib2" | jq -r ".results.exact.version")
wget -qO- "https://mirror.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-glib2-$GLIB_VERSION-any.pkg.tar.zst" | \
zstdcat - | tar -x ucrt64
PANGO_VERSION=$(wget -qO- "https://packages.msys2.org/api/search?query=pango" | jq -r ".results.exact.version")
wget -qO- "https://mirror.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-pango-$PANGO_VERSION-any.pkg.tar.zst" | \
zstdcat - | tar -x ucrt64
GTK_VERSION=$(wget -qO- "https://packages.msys2.org/api/search?query=gtk4" | jq -r ".results.exact.version")
wget -qO- "https://mirror.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-gtk4-$GTK_VERSION-any.pkg.tar.zst" | \
zstdcat - | tar -x ucrt64

0 comments on commit 36dca82

Please sign in to comment.