Skip to content

Commit

Permalink
install tiny-pkg-config for windows ci
Browse files Browse the repository at this point in the history
  • Loading branch information
cpunion committed Nov 20, 2024
1 parent ff21a5d commit c953ff6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 16 deletions.
12 changes: 12 additions & 0 deletions .github/assets/python3-embed.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
prefix=${pcfiledir}/../..
exec_prefix=${prefix}
libdir=${exec_prefix}
includedir=${prefix}/include

Name: Python
Description: Embed Python into an application
Requires:
Version: 3.13
Libs.private:
Libs: -L${libdir} -lpython313
Cflags: -I${includedir}
38 changes: 22 additions & 16 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@ jobs:
sys:
- {os: macos-latest, shell: bash}
- {os: ubuntu-24.04, shell: bash}
- {os: windows-latest, shell: 'msys2 {0}'}
- {os: windows-latest, shell: bash}
defaults:
run:
shell: ${{ matrix.sys.shell }}
runs-on: ${{matrix.sys.os}}
steps:
- uses: msys2/setup-msys2@v2
if: matrix.sys.os == 'windows-latest'
with:
update: true
install: >-
curl
git
pkg-config
# - uses: msys2/setup-msys2@v2
# if: matrix.sys.os == 'windows-latest'
# with:
# update: true
# install: >-
# curl
# git
# pkg-config

- uses: actions/checkout@v4

Expand All @@ -73,16 +73,23 @@ jobs:
python-version: '3.13'
update-environment: true

- name: Test PKG_CONFIG_PATH
- name: Generate Python pkg-config for windows (patch)
if: matrix.sys.os == 'windows-latest'
run: |
mkdir -p $PKG_CONFIG_PATH
cp .github/assets/python3-embed.pc $PKG_CONFIG_PATH/
- name: Install tiny-pkg-config for windows (patch)
if: matrix.sys.os == 'windows-latest'
run: |
echo on
dir /c/hostedtoolcache/windows/Python/3.13.0/x64/
dir /c/hostedtoolcache/windows/Python/3.13.0/x64/lib
dir /c/hostedtoolcache/windows/Python/3.13.0/x64/lib/pkgconfig
set -x
curl -L https://github.com/cpunion/tiny-pkg-config/releases/download/v0.2.0/tiny-pkg-config_Windows_x86_64.zip -o /tmp/tiny-pkg-config.zip
unzip /tmp/tiny-pkg-config.zip -d $HOME/bin
mv $HOME/bin/tiny-pkg-config.exe $HOME/bin/pkg-config.exe
echo $PKG_CONFIG_PATH
pkg-config --libs python-3.13-embed
cat $PKG_CONFIG_PATH/python3-embed.pc
pkg-config --libs python3-embed
pkg-config --cflags python3-embed
- name: Build
run: go install -v ./...
Expand All @@ -99,7 +106,6 @@ jobs:
gopy install -v .
- name: Upload coverage to Codecov
if: matrix.sys.os == 'ubuntu-24.04'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down

0 comments on commit c953ff6

Please sign in to comment.