Skip to content

Commit 0811049

Browse files
author
jayeshmepani
committed
fix: use msys2 bash and autotools for windows build
1 parent 183934c commit 0811049

3 files changed

Lines changed: 27 additions & 3 deletions

File tree

.github/workflows/release-prebuilt-libs.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,14 @@ jobs:
117117
install: >-
118118
base-devel
119119
mingw-w64-x86_64-toolchain
120-
mingw-w64-x86_64-autotools
120+
autoconf
121+
automake
122+
libtool
121123
git
122124
123125
- name: Compile shared library
124-
shell: pwsh
125-
run: .\build\compile-windows.ps1
126+
shell: msys2 {0}
127+
run: bash build/compile-windows.sh
126128

127129
- name: Create release archive
128130
shell: pwsh

build/compile-windows.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
DIR="$(cd "$(dirname "$0")" && pwd)"
4+
ROOT_DIR="$(dirname "$DIR")"
5+
TARGET="windows-x64"
6+
7+
echo "Building for $TARGET"
8+
cd "$DIR"
9+
if [ ! -d "libpostal" ]; then
10+
git clone https://github.com/openvenues/libpostal.git
11+
fi
12+
cd libpostal
13+
cp -rf windows/* ./
14+
./bootstrap.sh
15+
./configure --disable-data-download
16+
make -j4
17+
18+
mkdir -p "$ROOT_DIR/postalkit/libs/$TARGET"
19+
cp src/.libs/libpostal-1.dll "$ROOT_DIR/postalkit/libs/$TARGET/postal.dll"
20+
echo "Success: Compiled to $ROOT_DIR/postalkit/libs/$TARGET/postal.dll"

build/compile.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ if [[ "$OS" == *"linux"* ]]; then
77
bash "$DIR/compile-linux.sh"
88
elif [[ "$OS" == *"darwin"* ]]; then
99
bash "$DIR/compile-macos.sh"
10+
elif [[ "$OS" == *"mingw"* ]] || [[ "$OS" == *"msys"* ]] || [[ "$OS" == *"cygwin"* ]]; then
11+
bash "$DIR/compile-windows.sh"
1012
else
1113
echo "Unsupported OS. Use compile-windows.ps1 for Windows."
1214
exit 1

0 commit comments

Comments
 (0)