Skip to content

Commit d8aee10

Browse files
Enable localisation in Windows builds
1 parent 3dbb499 commit d8aee10

File tree

2 files changed

+51
-12
lines changed

2 files changed

+51
-12
lines changed

.github/workflows/build-windows-27.yml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ jobs:
88
- name: Check out repository code
99
uses: actions/checkout@v4
1010

11+
- name: Fetch Gettext
12+
run: >
13+
c:\msys64\usr\bin\wget.exe -nv
14+
https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.21-v1.16/gettext0.21-iconv1.16-shared-64.zip
15+
-O gettext.zip
16+
17+
- name: Extract Gettext
18+
shell: bash
19+
run: |
20+
mkdir gettext
21+
cd gettext
22+
unzip ../gettext.zip
23+
1124
- name: Fetch Exiv2 source
1225
run: >
1326
c:\msys64\usr\bin\wget.exe -nv
@@ -19,13 +32,19 @@ jobs:
1932
run: |
2033
tar -xzf exiv2.tar.gz
2134
mv exiv2-0.27.7-Source libexiv2
35+
# tweaks to allow NLS
36+
rm libexiv2/cmake/FindIconv.cmake
37+
echo -e "24a25\n> self.requires('libgettext/0.21')" |
38+
c:/msys64/usr/bin/patch.exe libexiv2/conanfile.py
2239
2340
- name: Build wheels
2441
uses: pypa/[email protected]
2542
env:
2643
CIBW_ARCHS: auto64
2744
CIBW_SKIP: pp3*
28-
CIBW_ENVIRONMENT: EXIV2_ROOT=libexiv2/build-msvc/install
45+
CIBW_ENVIRONMENT: |
46+
EXIV2_ROOT=libexiv2/build-msvc/install
47+
PATH="$PATH;$(pwd)\\gettext\\bin"
2948
CIBW_TEST_COMMAND: >
3049
python -m exiv2 -v &&
3150
python -m unittest discover {project}/tests -v
@@ -34,16 +53,17 @@ jobs:
3453
cd libexiv2 &&
3554
conan install . -of build-msvc -if build-msvc -o unitTests=False
3655
-o iconv=True -o webready=True -b missing &&
37-
cmake -B build-msvc -DCMAKE_BUILD_TYPE=Release
38-
-DCMAKE_INSTALL_PREFIX=build-msvc/install
39-
-DEXIV2_ENABLE_WIN_UNICODE=ON
40-
-DEXIV2_BUILD_SAMPLES=OFF
41-
-DEXIV2_BUILD_EXIV2_COMMAND=OFF
42-
-DEXIV2_ENABLE_BMFF=ON
43-
-DEXIV2_ENABLE_NLS=OFF
44-
-DEXIV2_ENABLE_VIDEO=ON
45-
-DEXIV2_ENABLE_WEBREADY=ON
46-
-DCMAKE_CXX_STANDARD=98
56+
cmake -B build-msvc
57+
-D CMAKE_BUILD_TYPE=Release
58+
-D CMAKE_INSTALL_PREFIX=build-msvc/install
59+
-D EXIV2_ENABLE_WIN_UNICODE=ON
60+
-D EXIV2_BUILD_SAMPLES=OFF
61+
-D EXIV2_BUILD_EXIV2_COMMAND=OFF
62+
-D EXIV2_ENABLE_BMFF=ON
63+
-D EXIV2_ENABLE_NLS=ON
64+
-D EXIV2_ENABLE_VIDEO=ON
65+
-D EXIV2_ENABLE_WEBREADY=ON
66+
-D CMAKE_CXX_STANDARD=98
4767
-G "Visual Studio 16 2019" -A x64 &&
4868
cmake --build build-msvc --config Release &&
4969
cmake --install build-msvc --config Release

.github/workflows/build-windows-28.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ jobs:
88
- name: Check out repository code
99
uses: actions/checkout@v4
1010

11+
- name: Fetch Gettext
12+
run: >
13+
c:\msys64\usr\bin\wget.exe -nv
14+
https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.21-v1.16/gettext0.21-iconv1.16-shared-64.zip
15+
-O gettext.zip
16+
17+
- name: Extract Gettext
18+
shell: bash
19+
run: |
20+
mkdir gettext
21+
cd gettext
22+
unzip ../gettext.zip
23+
1124
- name: Fetch Exiv2 source
1225
run: >
1326
c:\msys64\usr\bin\wget.exe -nv
@@ -19,13 +32,18 @@ jobs:
1932
run: |
2033
tar -xzf exiv2.tar.gz
2134
mv exiv2-0.28.1 libexiv2
35+
# tweaks to allow NLS
36+
echo -e "24a25\n> self.requires('libgettext/0.21')" |
37+
c:/msys64/usr/bin/patch.exe libexiv2/conanfile.py
2238
2339
- name: Build wheels
2440
uses: pypa/[email protected]
2541
env:
2642
CIBW_ARCHS: auto64
2743
CIBW_SKIP: pp3*
28-
CIBW_ENVIRONMENT: EXIV2_ROOT=libexiv2/build-msvc/install
44+
CIBW_ENVIRONMENT: |
45+
EXIV2_ROOT=libexiv2/build-msvc/install
46+
PATH="$PATH;$(pwd)\\gettext\\bin"
2947
CIBW_TEST_COMMAND: >
3048
python -m exiv2 -v &&
3149
python -m unittest discover {project}/tests -v
@@ -37,6 +55,7 @@ jobs:
3755
-D EXIV2_BUILD_SAMPLES=OFF
3856
-D EXIV2_BUILD_EXIV2_COMMAND=OFF
3957
-D EXIV2_BUILD_UNIT_TESTS=OFF
58+
-D EXIV2_ENABLE_NLS=ON
4059
-G "Visual Studio 16 2019" &&
4160
cmake --build build-msvc --config Release &&
4261
cmake --install build-msvc --config Release &&

0 commit comments

Comments
 (0)