Skip to content

Commit

Permalink
ARM64
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma committed Dec 17, 2024
1 parent 05da9c9 commit fad745c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 40 deletions.
33 changes: 18 additions & 15 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,16 @@ jobs:
runs-on: ${{ matrix.image }}
strategy:
matrix:
platform: [x86, x64]
platform: [x86, x64, arm64]
configuration: [Light, Release]
image: [windows-2019, windows-2022]
include:
- platform: x86
setenv: amd64_x86
- platform: x64
setenv: amd64
- platform: arm64
setenv: amd64_arm64
env:
OPENPACE_VER: 1.1.3
steps:
Expand All @@ -31,11 +38,6 @@ jobs:
- name: Git describe
id: ghd
uses: proudust/gh-describe@v2
- name: Package name
shell: bash
run: |
echo PACKAGE_NAME=OpenSC-${{ steps.ghd.outputs.tag }} >> $GITHUB_ENV
echo ARTIFACT=OpenSC-${{ steps.ghd.outputs.tag }}_${{ matrix.platform == 'x86' && 'win32' || 'win64' }}${{ matrix.configuration == 'Light' && '-Light' || '' }} >> $GITHUB_ENV
- name: Install CPDK
run: choco install windows-cryptographic-provider-development-kit -y > $null
- name: Install autotools
Expand All @@ -60,7 +62,7 @@ jobs:
- name: Setup dev env
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.platform }}
arch: ${{ matrix.setenv }}
- name: Prepare vcpkg
if: matrix.configuration == 'Release'
uses: lukka/run-vcpkg@v7
Expand Down Expand Up @@ -98,7 +100,7 @@ jobs:
ca_lib.c cv_cert.c cvc_lookup.c x509_lookup.c eac_asn1.c eac.c eac_ca.c eac_dh.c `
eac_ecdh.c eac_kdf.c eac_lib.c eac_print.c eac_util.c misc.c pace.c pace_lib.c `
pace_mappings.c ri.c ri_lib.c ta.c ta_lib.c objects.c ssl_compat.c
lib /nologo /machine:${{ matrix.platform }} /out:libeac.lib `
lib /nologo /out:libeac.lib `
ca_lib.obj cv_cert.obj cvc_lookup.obj x509_lookup.obj eac_asn1.obj eac.obj eac_ca.obj eac_dh.obj `
eac_ecdh.obj eac_kdf.obj eac_lib.obj eac_print.obj eac_util.obj misc.obj pace.obj pace_lib.obj `
pace_mappings.obj ri.obj ri_lib.obj ta.obj ta_lib.obj objects.obj ssl_compat.obj
Expand All @@ -118,16 +120,17 @@ jobs:
- name: Build OpenSC
run: |
nmake /nologo /f Makefile.mak opensc.msi
move win32\OpenSC.msi OpenSC-${env:ARTIFACT}.msi
- name: Debug symbols
run: |
Get-ChildItem -recurse . -exclude vc*.pdb *.pdb | % {
7z a -tzip ${env:ARTIFACT}-Debug.zip $_.FullName
}
move win32\OpenSC.msi OpenSC-${{ steps.ghd.outputs.tag }}_${{ matrix.platform }}${{ matrix.configuration == 'Light' && '-Light' || '' }}.msi
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: msi_${{ matrix.image }}_${{ matrix.platform }}_${{ matrix.configuration }}
path: |
./*.msi
./*-Debug.zip
- name: Archive debug artifacts
uses: actions/upload-artifact@v4
with:
name: debug_${{ matrix.image }}_${{ matrix.platform }}_${{ matrix.configuration }}
path: |
./src/**/*.pdb
!./src/**/vc*.pdb
4 changes: 2 additions & 2 deletions win32/Make.rules.mak
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ COPTS = /nologo /Zi /GS /W3 /WX /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_WAR
/DWINVER=0x0601 /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DOPENSC_FEATURES="\"$(OPENSC_FEATURES)\"" \
$(DEBUG_DEF) $(OPENPACE_DEF) $(OPENSSL_DEF) $(ZLIB_DEF) $(MINIDRIVER_DEF) $(SM_DEF) $(TESTS_DEF) $(OPENSSL_EXTRA_CFLAGS) \
/I$(TOPDIR)\win32 /I$(TOPDIR)\src $(OPENPACE_INCL_DIR) $(OPENSSL_INCL_DIR) $(ZLIB_INCL_DIR) $(CPDK_INCL_DIR)
LINKFLAGS = /nologo /machine:$(PLATFORM) /INCREMENTAL:NO /NXCOMPAT /DYNAMICBASE /DEBUG /NODEFAULTLIB:MSVCRT /NODEFAULTLIB:MSVCRTD
LIBFLAGS = /nologo /machine:$(PLATFORM)
LINKFLAGS = /nologo /INCREMENTAL:NO /NXCOMPAT /DYNAMICBASE /DEBUG /NODEFAULTLIB:MSVCRT /NODEFAULTLIB:MSVCRTD
LIBFLAGS = /nologo
WIXFLAGS = -arch $(PLATFORM) $(WIXFLAGS)

!IF "$(DEBUG_DEF)" == "/DDEBUG"
Expand Down
49 changes: 26 additions & 23 deletions win32/OpenSC.wxs.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,26 @@
<?define ProductName = "@OPENSC_VS_FF_PRODUCT_NAME@ (64bit)" ?>
<?endif?>
<?define PlatformUpgradeCode = "{9A449570-69A2-11E0-9CC6-955B4824019B}" ?>
<?define NATIVE_ARCH = "AMD64" ?>
<?define SUFFIX = "" ?>
<?elseif $(sys.BUILDARCH) = arm64 ?>
<?ifndef OpenSSL ?>
<?define ProductName = "@OPENSC_VS_FF_PRODUCT_NAME@ Light (ARM 64bit)" ?>
<?else?>
<?define ProductName = "@OPENSC_VS_FF_PRODUCT_NAME@ (ARM 64bit)" ?>
<?endif?>
<?define PlatformUpgradeCode = "{63666c12-c4b5-4e55-87af-3babcd563c28}" ?>
<?define NATIVE_ARCH = "ARM64" ?>
<?define SUFFIX = "_arm64" ?>
<?else?>
<?ifndef OpenSSL ?>
<?define ProductName = "@OPENSC_VS_FF_PRODUCT_NAME@ Light" ?>
<?else?>
<?define ProductName = "@OPENSC_VS_FF_PRODUCT_NAME@" ?>
<?endif?>
<?define PlatformUpgradeCode = "{69428F65-B96D-458D-BB87-DBB5FDB35DCE}" ?>
<?define NATIVE_ARCH = "x86" ?>
<?define SUFFIX = "" ?>
<?endif?>

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
Expand All @@ -24,7 +37,7 @@
Codepage="1252"
Version="@OPENSC_VERSION_MAJOR@.@OPENSC_VERSION_MINOR@.@OPENSC_VERSION_FIX@.@OPENSC_VERSION_REVISION@"
Manufacturer="@OPENSC_VS_FF_COMPANY_NAME@"
InstallerVersion="300">
InstallerVersion="500">
<SummaryInformation Description="@VS_FF_PRODUCT_NAME@ Installer"
Manufacturer="@OPENSC_VS_FF_COMPANY_NAME@" />
<!-- Setup background images -->
Expand Down Expand Up @@ -57,7 +70,7 @@
<StandardDirectory Id="ProgramFiles6432Folder">
<Directory Id="OpenSC_Project_Dir" Name="OpenSC Project">
<!-- Most of the stuff goes to the Program Files folder -->
<Directory Id="INSTALLDIR" Name="OpenSC">
<Directory Id="INSTALLDIR" Name="OpenSC$(var.SUFFIX)">
<!-- opensc.conf sample goes to installation directory -->
<Component Id="opensc.conf">
<File Source="$(var.SOURCE_DIR)\etc\opensc.conf" KeyPath="yes" />
Expand Down Expand Up @@ -106,33 +119,27 @@
</Directory>

<Directory Id="INSTALLDIR_PKCS11" Name="pkcs11">
<Component Id="opensc_pkcs11.dll">
<File Source="$(var.SOURCE_DIR)\src\pkcs11\opensc-pkcs11.dll" />
</Component>
<Component Id="onepin_opensc_pkcs11.dll">
<File Name="onepin-opensc-pkcs11.dll" Source="$(var.SOURCE_DIR)\src\pkcs11\opensc-pkcs11.dll" />
</Component>
<File Id="opensc_pkcs11.dll" Source="$(var.SOURCE_DIR)\src\pkcs11\opensc-pkcs11.dll" />
<File Id="onepin_opensc_pkcs11.dll" Name="onepin-opensc-pkcs11.dll" Source="$(var.SOURCE_DIR)\src\pkcs11\opensc-pkcs11.dll" />
</Directory>

<Directory Id="INSTALLDIR_TOOLS" Name="tools" />

<Component Id="Autostart_tools">
<RegistryKey Root="HKMU" Key="Software\Microsoft\Windows\CurrentVersion\Run">
<RegistryValue Type="string" Name="pkcs11-register.exe" Value="[INSTALLDIR_TOOLS]pkcs11-register.exe" />
</RegistryKey>
</Component>
<Component Id="Autostart_native_tools" Condition="$(sys.BUILDARCH) != 'x86' OR ($(sys.BUILDARCH) = 'x86' AND NOT VersionNT64)">
<Component Id="Autostart_native_tools" Condition="$(env.PROCESSOR_ARCHITECTURE) == '$(var.NATIVE_ARCH)'">
<RegistryKey Root="HKMU" Key="Software\Microsoft\Windows\CurrentVersion\Run">
<RegistryValue Type="string" Name="opensc-notify.exe" Value="[INSTALLDIR_TOOLS]opensc-notify.exe" />
</RegistryKey>
</Component>

<?ifdef OpenPACE ?>
<Directory Id="INSTALLDIR_CVC" Name="cvc">
<Component Id="DESRCACC100001">
<File Source="$(var.SOURCE_DIR)\etc\DESRCACC100001" />
</Component>
<Component Id="DESCHSMCVCA00001">
<File Source="$(var.SOURCE_DIR)\etc\DESCHSMCVCA00001" />
</Component>
<File Id="DESRCACC100001" Source="$(var.SOURCE_DIR)\etc\DESRCACC100001" />
<File Id="DESCHSMCVCA00001" Source="$(var.SOURCE_DIR)\etc\DESCHSMCVCA00001" />
</Directory>
<?endif?>
</Directory>
Expand All @@ -158,22 +165,18 @@
</StandardDirectory>

<!-- Tools have their own folder -->
<ComponentGroup Id="tools" Directory="INSTALLDIR" Subdirectory="tools">
<ComponentGroup Id="tools" Directory="INSTALLDIR_TOOLS">
<?ifdef zlib ?>
<Component Id="zlib1.dll">
<File Source="$(var.zlib)\zlib1.dll" />
</Component>
<File Id="zlib1.dll" Source="$(var.zlib)\zlib1.dll" />
<?endif?>
<?ifdef OpenSSL ?>
<Component Id="smm_local.dll">
<File Source="$(var.SOURCE_DIR)\src\smm\smm-local.dll" />
</Component>
<File Id="smm_local.dll" Source="$(var.SOURCE_DIR)\src\smm\smm-local.dll" />
<?endif?>
<File Source="$(var.SOURCE_DIR)\src\libopensc\opensc.dll" />
<Files Include="$(var.SOURCE_DIR)\src\tools\*.exe">
<Exclude Files="$(var.SOURCE_DIR)\src\tools\pkcs11-register.exe" />
</Files>
<File Source="$(var.SOURCE_DIR)\src\tools\pkcs11-register.exe" Id="pkcs11_register.exe" />
<File Id="pkcs11_register.exe" Source="$(var.SOURCE_DIR)\src\tools\pkcs11-register.exe" />
</ComponentGroup>

<?ifdef OpenSSL ?>
Expand Down

0 comments on commit fad745c

Please sign in to comment.