diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 805cbf5ea..598681629 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,6 @@ jobs: run: | brew update brew install --formula ninja swig doxygen boost - brew unlink python@3.11 || true brew unlink python@3.12 || true brew unlink python@3.13 || true brew unlink openssl@3 || true @@ -136,8 +135,10 @@ jobs: include: - toolset: 143 image: windows-2022 + vcvars: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" - toolset: 142 image: windows-2019 + vcvars: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" - platform: x86 setenv: amd64_x86 - platform: x64 @@ -166,17 +167,13 @@ jobs: Invoke-WebRequest -UserAgent "Wget" "https://sourceforge.net/projects/swig/files/swigwin/swigwin-4.2.1/swigwin-4.2.1.zip/download" -OutFile swig.zip tar xf swig.zip - uses: actions/setup-python@v5 - if: matrix.platform == 'x86' + if: matrix.platform != 'arm64' with: python-version: 3.12 - architecture: x86 - - name: Setup dev env - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: ${{ matrix.setenv }} + architecture: ${{ matrix.platform }} - name: Build run: | - & .\build.ps1 ` + & "${{ matrix.vcvars }}" ${{ matrix.setenv }} "&&" pwsh build.ps1 ` -swig ${{ github.workspace }}/swigwin-4.2.1/swig.exe ` -doxygen "C:/Program files/doxygen/bin/doxygen.exe" ` -boost diff --git a/CMakeLists.txt b/CMakeLists.txt index 42c18ff70..b456ae54a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,7 +77,7 @@ endif() find_package(SWIG) if(SWIG_FOUND) find_package(JNI) - find_package(Python3 COMPONENTS Interpreter Development) + find_package(Python3 COMPONENTS Development) if((WIN32 OR APPLE) AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.24") find_package(Python3 COMPONENTS Development.SABIModule) endif() diff --git a/build.ps1 b/build.ps1 index 3b19e96a3..2382ed8e8 100644 --- a/build.ps1 +++ b/build.ps1 @@ -43,13 +43,11 @@ if($doxygen) { $cmakeext += "-DDOXYGEN_EXECUTABLE=$doxygen" $wixext += "-d", "docLocation=$(Get-Location)/$platform/share/doc/libdigidocpp" } -if($env:VSCMD_ARG_HOST_ARCH -ne "arm64") { +if($platform -eq "arm64" -and $env:VSCMD_ARG_HOST_ARCH -ne "arm64") { $cmakeext += "-DCMAKE_DISABLE_FIND_PACKAGE_Python3=yes" $wixext += "-d", "disablePython=1" - if($platform -eq "arm64") { - $boost = $false - } -} + $boost = $false +} if($boost) { $cmakeext += "-DVCPKG_MANIFEST_FEATURES=tests" $target += "check" diff --git a/libdigidocpp.wxs b/libdigidocpp.wxs index e21f679a6..1bbdd9a96 100644 --- a/libdigidocpp.wxs +++ b/libdigidocpp.wxs @@ -105,12 +105,6 @@ - - - - - - @@ -124,7 +118,7 @@ - + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9ab0027a5..a56df2830 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -207,15 +207,11 @@ if(SWIG_FOUND) endif() #configure_file(setup.py.cmake setup.py) #install(CODE "execute_process(COMMAND python3 ${CMAKE_CURRENT_BINARY_DIR}/setup.py install)") - if(NOT Python3_SITELIB) - execute_process(COMMAND /usr/bin/python3 -c - "from distutils import sysconfig;print(sysconfig.get_python_lib(plat_specific=False,standard_lib=False))" - OUTPUT_VARIABLE Python3_SITELIB OUTPUT_STRIP_TRAILING_WHITESPACE) - endif() if(WIN32) set(Python3_SITELIB ${CMAKE_INSTALL_BINDIR}) install(FILES $ DESTINATION ${Python3_SITELIB} OPTIONAL) else() + find_package(Python3 COMPONENTS Interpreter) # for Python3_SITELIB set_target_properties(digidoc_python PROPERTIES SUFFIX .so) endif() set_target_properties(digidoc_python PROPERTIES