Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
Separate win32/64 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitern committed Jul 31, 2022
1 parent 7b038d8 commit bc797d9
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 30 deletions.
45 changes: 36 additions & 9 deletions .github/workflows/build.yaml
Expand Up @@ -27,15 +27,48 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- name: Prepare Windows builds
- name: Prepare Windows x86 builds
uses: ilammy/msvc-dev-cmd@v1
with:
toolset: "14.0"
arch: ${{ matrix.arch }}
arch: "x86"

- name: Build wheels
- name: Build Windows x86 wheels
uses: pypa/cibuildwheel@v2.8.1
env:
CIBW_BUILD: "*win32"
CIBW_BEFORE_BUILD_WINDOWS: "call xmlstarlet\\setup_msvc.bat"
CIBW_ENVIRONMENT_WINDOWS: >
PLATFORM_NAME=x86
DISTUTILS_USE_SDK=1
MSSdk=1
with:
package-dir: .
output-dir: wheelhouse

- name: Prepare Windows x64 builds
uses: ilammy/msvc-dev-cmd@v1
with:
toolset: "14.0"
arch: "x64"

- name: Build Windows x86 wheels
uses: pypa/cibuildwheel@v2.8.1
env:
CIBW_BUILD: "*win_amd64"
CIBW_BEFORE_BUILD_WINDOWS: "call xmlstarlet\\setup_msvc.bat"
CIBW_ENVIRONMENT_WINDOWS: >
PLATFORM_NAME=amd64
DISTUTILS_USE_SDK=1
MSSdk=1
with:
package-dir: .
output-dir: wheelhouse

- name: Build Linux and MacOS wheels
uses: pypa/cibuildwheel@v2.8.1
env:
CIBW_SKIP: "*win*"
CIBW_BEFORE_ALL_LINUX: >
yum install -y libxslt-devel ||
apt-get -y install libxslt1-dev libxml2-dev ||
Expand All @@ -45,18 +78,12 @@ jobs:
brew cleanup -s libxml2 libxslt libffi &&
brew cleanup --prune-prefix &&
brew install libxml2 libxslt automake pkg-config
CIBW_BEFORE_ALL_WINDOWS: "call xmlstarlet\\setup_msvc.bat"
CIBW_BEFORE_BUILD_WINDOWS: "call xmlstarlet\\build_msvc.bat"
CIBW_ENVIRONMENT_MACOS: >
ARCHFLAGS="-arch x86_64"
PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig:/usr/local/opt/libxslt/lib/pkgconfig"
LDFLAGS="-L/usr/local/opt/libxml2/lib -L/usr/local/opt/libxslt/lib"
CPPFLAGS="-I/usr/local/opt/libxml2/include -I/usr/local/opt/libxslt/include -I/usr/local/opt/libffi/include"
PATH="/usr/local/opt/libxslt/bin:/usr/local/opt/libxml2/bin:$PATH"
CIBW_ENVIRONMENT_WINDOWS: >
CIBW_BUILD="*win32 *win_amd64"
DISTUTILS_USE_SDK=1
MSSdk=1
with:
package-dir: .
output-dir: wheelhouse
Expand Down
14 changes: 0 additions & 14 deletions xmlstarlet/build_msvc.bat

This file was deleted.

15 changes: 8 additions & 7 deletions xmlstarlet/setup_msvc.bat
Expand Up @@ -7,20 +7,13 @@ set XSLT_URL=https://download.gnome.org/sources/libxslt/1.1/
set XML2_TARBALL=libxml2-2.9.1.tar.xz
set XSLT_TARBALL=libxslt-1.1.28.tar.xz

echo ENVIRONMENT
echo %Platform%
set

set PREFIX=C:\opt

if exist %PREFIX% rd /q /s %PREFIX%

if exist _build rd /q /s _build
md _build

if exist "C:\Program Files\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" call "C:\Program Files\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"
if exist "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"

rem Kill Git's link.exe which shadows MSVC's link.exe
if exist "C:\Program Files\Git\usr\bin\link.exe" del "C:\Program Files\Git\usr\bin\link.exe"
if exist "C:\Program Files (x86)\Git\usr\bin\link.exe" del "C:\Program Files (x86)\Git\usr\bin\link.exe"
Expand Down Expand Up @@ -70,3 +63,11 @@ del Makefile.patch
nmake all
nmake install
cd ..\..\..

echo Building xmlstarlet...
cd xmlstarlet\win32\

cscript configure.js include=%PREFIX%\include\libxml2 prefix=%PREFIX% static=yes debug=no arch=%PLATFORM_NAME%
nmake all
nmake install
cd ..\..

0 comments on commit bc797d9

Please sign in to comment.