Skip to content

Commit 4f35579

Browse files
metsmakristelmerilain
authored andcommitted
Build arm64 package with python support
IB-8503 Signed-off-by: Raul Metsma <[email protected]>
1 parent 54cecfe commit 4f35579

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,13 @@ jobs:
183183
include:
184184
- platform: x86
185185
setenv: amd64_x86
186+
python: 32
186187
- platform: x64
187188
setenv: amd64
189+
python: 64
188190
- platform: arm64
189191
setenv: amd64_arm64
192+
python: arm64
190193
env:
191194
VER_SUFFIX: .VS${{ matrix.toolset }}
192195
CXXFLAGS: '/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR' # https://github.com/actions/runner-images/issues/10004
@@ -199,26 +202,23 @@ jobs:
199202
path: ${{ github.workspace }}/vcpkg_cache
200203
key: vcpkg-${{ matrix.toolset }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json', 'vcpkg-ports/**') }}
201204
- name: Install dependencies
202-
run: winget install --silent --accept-source-agreements --accept-package-agreements swig doxygen
205+
run: winget install --silent --accept-source-agreements --accept-package-agreements swig doxygen 9NQ7512CXL7T
203206
- uses: actions/setup-java@v4
204207
with:
205208
distribution: 'temurin'
206209
java-version: '17'
207-
- uses: actions/setup-python@v5
208-
if: matrix.platform != 'arm64'
209-
with:
210-
python-version: 3.12
211-
architecture: ${{ matrix.platform }}
212210
- name: Build
213211
env:
214212
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
215213
run: |
214+
& "$env:LOCALAPPDATA\Microsoft\WindowsApps\py.exe" install --target=.\python\${{ matrix.platform }} 3.12-${{ matrix.python }}
216215
$swig = (Get-Item "$env:LOCALAPPDATA\Microsoft\WinGet\Links\swig.exe").Target
217216
& "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" ${{ matrix.setenv }} "&&" pwsh build.ps1 `
218217
-vcpkg "C:/vcpkg/vcpkg.exe" `
219218
-swig $swig `
220219
-doxygen "C:/Program files/doxygen/bin/doxygen.exe" `
221-
-boost
220+
-boost `
221+
-python ${{ github.workspace }}/python
222222
- name: Archive artifacts
223223
uses: actions/upload-artifact@v5
224224
with:

build.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ param(
1616
[string]$swig = $null,
1717
[string]$doxygen = $null,
1818
[switch]$boost = $false,
19-
[string]$sign = $null
19+
[string]$sign = $null,
20+
[string]$python = $null
2021
)
2122

2223
Try {
@@ -43,14 +44,16 @@ if($doxygen) {
4344
$cmakeext += "-DDOXYGEN_EXECUTABLE=$doxygen"
4445
}
4546
if($platform -eq "arm64" -and $env:VSCMD_ARG_HOST_ARCH -ne "arm64") {
46-
$cmakeext += "-DCMAKE_DISABLE_FIND_PACKAGE_Python3=yes"
47-
$wixext += "-d", "disablePython=1"
4847
$boost = $false
4948
}
5049
if($boost) {
5150
$cmakeext += "-DVCPKG_MANIFEST_FEATURES=tests"
5251
$target += "check"
5352
}
53+
if($python) {
54+
$cmakeext += "-DPython3_ROOT_DIR=$python/$platform"
55+
$wixext += "-d", "python=1"
56+
}
5457

5558
foreach($type in @("Debug", "RelWithDebInfo")) {
5659
$buildpath = $platform+$type

libdigidocpp.wxs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<File Name="digidoc_csharp.dll" />
6565
<File Name="digidoc_java.dll" />
6666
<File Source="$(var.libdigidocpp)\share\digidocpp\digidocpp.jar" />
67-
<?ifndef var.disablePython ?>
67+
<?ifdef var.python ?>
6868
<File Name="_digidoc_python.pyd" />
6969
<File Name="digidoc.py" />
7070
<?endif?>
@@ -88,7 +88,7 @@
8888
<?ifdef var.swig ?>
8989
<File Name="digidoc_csharpd.dll" />
9090
<File Name="digidoc_javad.dll" />
91-
<?ifndef var.disablePython ?>
91+
<?ifdef var.python ?>
9292
<File Name="_digidoc_pythond.pyd" />
9393
<?endif?>
9494
<?endif?>

0 commit comments

Comments
 (0)