Skip to content

Commit 1b6889f

Browse files
metsmaJakuje
authored andcommitted
Remove autotools dependency from NMake build
Signed-off-by: Raul Metsma <raul@metsma.ee>
1 parent d048fef commit 1b6889f

13 files changed

Lines changed: 98 additions & 130 deletions

File tree

.appveyor.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,6 @@ build_script:
9292
$env:OPENPACE_DEF="/DENABLE_OPENPACE"
9393
$env:OPENPACE_DIR="C:\openpace-${env:OPENSSL_PF}"
9494
}
95-
- bash -c "exec 0</dev/null && if [ \"$APPVEYOR_REPO_BRANCH\" == \"master\" -a -z \"$APPVEYOR_PULL_REQUEST_NUMBER\" ]; then ./bootstrap; fi"
96-
- bash -c "exec 0</dev/null && if [ \"$APPVEYOR_REPO_BRANCH\" == \"master\" -a -n \"$APPVEYOR_PULL_REQUEST_NUMBER\" ]; then ./bootstrap.ci -s \"-pr$APPVEYOR_PULL_REQUEST_NUMBER\"; fi"
97-
- bash -c "exec 0</dev/null && if [ \"$APPVEYOR_REPO_BRANCH\" != \"master\" -a -z \"$APPVEYOR_PULL_REQUEST_NUMBER\" ]; then ./bootstrap.ci -s \"-$APPVEYOR_REPO_BRANCH\"; fi"
98-
- bash -c "exec 0</dev/null && if [ \"$APPVEYOR_REPO_BRANCH\" != \"master\" -a -n \"$APPVEYOR_PULL_REQUEST_NUMBER\" ]; then ./bootstrap.ci -s \"-$APPVEYOR_REPO_BRANCH-prAPPVEYOR_PULL_REQUEST_NUMBER\"; fi"
99-
# disable features to speed up the script
100-
- bash -c "exec 0</dev/null && ./configure --with-cygwin-native --disable-openssl --disable-readline --disable-zlib || cat config.log"
10195
- nmake /nologo /f Makefile.mak opensc.msi
10296
- move win32\OpenSC.msi %ARTIFACT%.msi
10397
# put all pdb files for dump analysis, but this consumes approx 100 MB per build

.github/setup-wix.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
param(
2-
[string]$version = '6.0.0'
2+
[string]$version = '6.0.2'
33
)
44
& dotnet tool install -g --version $version wix
55
& wix extension add -g WixToolset.UI.wixext/$version

.github/vcpkg.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "opensc",
3-
"dependencies": [
4-
"openssl",
5-
"zlib"
6-
],
7-
"builtin-baseline": "0d5cae153065957df7f382de7c1549ccc88027e5"
2+
"name": "opensc",
3+
"dependencies": [
4+
"openssl",
5+
"zlib"
6+
],
7+
"builtin-baseline": "bc38a15b0bee8bc48a49ea267cc32fbb49aedfc4"
88
}

.github/workflows/windows.yml

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,49 +33,46 @@ jobs:
3333
env:
3434
OPENPACE_VER: 1.1.3
3535
VCPKG_INSTALLED: ${{ github.workspace }}\vcpkg_installed
36+
BUILD_NUMBER: ${{ github.run_number }}
3637
steps:
3738
- name: Checkout
38-
uses: actions/checkout@v4
39+
uses: actions/checkout@v5
3940
- name: Git describe
4041
id: ghd
4142
uses: proudust/gh-describe@v2
4243
- name: Package name
4344
shell: bash
44-
run: |
45-
echo ARTIFACT=OpenSC-${{ steps.ghd.outputs.tag }}_${{ matrix.platform }}${{ matrix.configuration == 'Light' && '-Light' || '' }} >> $GITHUB_ENV
46-
- name: Install CPDK
47-
run: choco install windows-cryptographic-provider-development-kit -y > $null
48-
- name: Install autotools
49-
uses: msys2/setup-msys2@v2
50-
with:
51-
install: autotools mingw-w64-x86_64-pkg-config
52-
- name: Bootstrap
53-
shell: msys2 {0}
5445
run: |
5546
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref_name }}" == "master" ]]; then
56-
./bootstrap
47+
SUFFIX=""
5748
elif [[ "${{ github.event_name }}" == "push" ]]; then
58-
./bootstrap.ci -s "-${{ github.ref_name }}"
49+
SUFFIX="-${{ github.ref_name }}"
5950
elif [[ "${{ github.event_name }}" == "pull_request" && "${{ github.base_ref }}" == "master" ]]; then
60-
./bootstrap.ci -s "-pr${{ github.event.number }}"
51+
SUFFIX="-pr${{ github.event.number }}"
6152
else
62-
./bootstrap.ci -s "-${{ github.base_ref }}-pr${{ github.event.number }}"
53+
SUFFIX="-${{ github.base_ref }}-pr${{ github.event.number }}"
6354
fi
64-
- name: Configure
65-
shell: bash
66-
run: ./configure --disable-openssl --disable-readline --disable-zlib || cat config.log
55+
echo ARTIFACT=${{ steps.ghd.outputs.tag }}${SUFFIX}_${{ matrix.platform }}${{ matrix.configuration == 'Light' && '-Light' || '' }} >> $GITHUB_ENV
56+
- name: Install CPDK
57+
run: choco install windows-cryptographic-provider-development-kit -y > $null
6758
- name: Setup dev env
6859
uses: ilammy/msvc-dev-cmd@v1
6960
with:
7061
arch: ${{ matrix.setenv }}
62+
- name: Cache vcpkg
63+
if: matrix.configuration == 'Release'
64+
uses: actions/cache@v4
65+
with:
66+
path: ${{ github.workspace }}/vcpkg_cache
67+
key: vcpkg-${{ matrix.configuration }}-${{ matrix.platform }}-${{ hashFiles('.github/workflows/windows.yml', '.github/vcpkg.json') }}
7168
- name: Prepare vcpkg
7269
if: matrix.configuration == 'Release'
7370
uses: lukka/run-vcpkg@v11
7471
with:
75-
vcpkgGitCommitId: 0d5cae153065957df7f382de7c1549ccc88027e5
7672
vcpkgJsonGlob: .github/vcpkg.json
7773
runVcpkgInstall: true
7874
env:
75+
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
7976
VCPKG_DEFAULT_TRIPLET: ${{ matrix.platform }}-windows-static
8077
VCPKG_INSTALLED_DIR: ${{ env.VCPKG_INSTALLED }}
8178
- name: Install WIX
@@ -131,7 +128,7 @@ jobs:
131128
- name: Archive debug artifacts
132129
uses: actions/upload-artifact@v4
133130
with:
134-
name: ${{ env.ARTIFACT }}-Debug
131+
name: OpenSC-${{ env.ARTIFACT }}-Debug
135132
path: |
136133
./src/**/*.pdb
137134
./win32/*.pdb

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ src/tools/org.opensc-project.mac.opensc-notify.plist
9797
src/tools/org.opensc-project.mac.pkcs11-register.plist
9898

9999
win32/OpenSC.iss
100-
win32/OpenSC.wxs
101-
win32/winconfig.h
102100
win32/OpenSC.msi
103101
win32/OpenSC.wixobj
104102
win32/OpenSC.wixpdb

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ MAINTAINERCLEANFILES = \
1111
$(srcdir)/m4/ltversion.m4 $(srcdir)/m4/lt~obsolete.m4 \
1212
$(srcdir)/m4/ltoptions.m4 \
1313
$(srcdir)/packaged
14-
EXTRA_DIST = Makefile.mak
14+
EXTRA_DIST = Makefile.mak VERSION.mk
1515

1616
DISTCHECK_CONFIGURE_FLAGS = --with-completiondir=/tmp
1717

VERSION.mk

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
PRODUCT_NAME=OpenSC
2+
PRODUCT_TARNAME=opensc
3+
PRODUCT_BUGREPORT=https://github.com/OpenSC/OpenSC/issues
4+
PRODUCT_URL=https://github.com/OpenSC/OpenSC
5+
PACKAGE_VERSION_MAJOR=0
6+
PACKAGE_VERSION_MINOR=26
7+
PACKAGE_VERSION_FIX=1
8+
PACKAGE_VERSION_REVISION=0
9+
PACKAGE_SUFFIX=
10+
PACKAGE_SCM_REVISION=No Git revision info available
11+
12+
VS_FF_LEGAL_COPYRIGHT=OpenSC Project
13+
VS_FF_LEGAL_COMPANY_NAME=OpenSC Project
14+
VS_FF_LEGAL_COMPANY_URL=https://github.com/OpenSC
15+
VS_FF_COMMENTS=Provided under the terms of the GNU Lesser General Public License (LGPLv2.1+).
16+
VS_FF_PRODUCT_NAME=OpenSC smartcard framework
17+
VS_FF_PRODUCT_UPDATES=https://github.com/OpenSC/OpenSC/releases

configure.ac

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,16 @@ dnl -*- mode: m4; -*-
22

33
AC_PREREQ(2.68)
44

5-
define([PRODUCT_NAME], [OpenSC])
6-
define([PRODUCT_TARNAME], [opensc])
7-
define([PRODUCT_BUGREPORT], [https://github.com/OpenSC/OpenSC/issues])
8-
define([PRODUCT_URL], [https://github.com/OpenSC/OpenSC])
9-
define([PACKAGE_VERSION_MAJOR], [0])
10-
define([PACKAGE_VERSION_MINOR], [26])
11-
define([PACKAGE_VERSION_FIX], [1])
12-
define([PACKAGE_SUFFIX], [])
13-
14-
define([VS_FF_LEGAL_COPYRIGHT], [OpenSC Project])
15-
define([VS_FF_LEGAL_COMPANY_NAME], [OpenSC Project])
16-
define([VS_FF_LEGAL_COMPANY_URL], [https://github.com/OpenSC])
17-
define([VS_FF_COMMENTS], [Provided under the terms of the GNU Lesser General Public License (LGPLv2.1+).])
18-
define([VS_FF_PRODUCT_NAME], [OpenSC smartcard framework])
19-
define([VS_FF_PRODUCT_UPDATES], [https://github.com/OpenSC/OpenSC/releases])
5+
m4_esyscmd([awk -F= '
6+
/^[[:space:]]*#/ { next }
7+
/^[[:space:]]*$/ { next }
8+
{
9+
key = $1; val = $2;
10+
gsub(/^[[:space:]]+|[[:space:]]+$/, "", key);
11+
gsub(/^[[:space:]]+|[[:space:]]+$/, "", val);
12+
printf("m4_define([%s],[%s])\n", key, val);
13+
}
14+
' "VERSION.mk"])
2015

2116
m4_sinclude(m4/version.m4.ci)
2217

@@ -418,8 +413,8 @@ if test "${GIT_CHECKOUT}" = "yes"; then
418413
OPENSC_SCM_REVISION="OpenSC-${REVISION_DESCRIPTION}, ${HASH_COMMIT_DATE}"
419414
OPENSC_VERSION_REVISION="$(${GIT} rev-list ${GIT_TAG_COMMIT}..HEAD --count || echo 0)"
420415
else
421-
OPENSC_SCM_REVISION="No Git revision info available"
422-
OPENSC_VERSION_REVISION="0"
416+
OPENSC_SCM_REVISION="PACKAGE_SCM_REVISION"
417+
OPENSC_VERSION_REVISION="PACKAGE_VERSION_REVISION"
423418
fi
424419

425420
dnl C Compiler features
@@ -1206,9 +1201,7 @@ AC_CONFIG_FILES([
12061201
src/minidriver/Makefile
12071202
src/minidriver/opensc-minidriver.inf
12081203
win32/Makefile
1209-
win32/winconfig.h
12101204
win32/OpenSC.iss
1211-
win32/OpenSC.wxs
12121205
MacOSX/Makefile
12131206
MacOSX/build-package
12141207
MacOSX/Distribution.xml

src/tools/Makefile.mak

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ sc-hsm-tool.exe: sc-hsm-tool.obj fread_to_eof.obj $(OBJECTS) $(LIBS)
6161
pkcs11-tool.exe: pkcs11-tool.obj pkcs11_uri.obj $(OBJECTS) $(LIBS)
6262
cl $(COPTS) /c $*.c
6363
link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj pkcs11-tool.obj pkcs11_uri.obj $(OBJECTS) $(LIBS) $(OPENSSL_LIB) gdi32.lib shell32.lib User32.lib ws2_32.lib shlwapi.lib
64-
mt -manifest exe.manifest -outputresource:$@;1
6564

6665
.c.exe:
6766
cl $(COPTS) /c $<

win32/Make.rules.mak

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
1-
OPENSC_FEATURES = pcsc
1+
!INCLUDE $(TOPDIR)\VERSION.mk
2+
3+
!IF "$(BUILD_NUMBER)" != ""
4+
PACKAGE_VERSION_REVISION = $(BUILD_NUMBER)
5+
!ENDIF
26

7+
OPENSC_FEATURES = pcsc
8+
PRODUCT_VERSION = $(PACKAGE_VERSION_MAJOR).$(PACKAGE_VERSION_MINOR).$(PACKAGE_VERSION_FIX).$(PACKAGE_VERSION_REVISION)
9+
WIXFLAGS = \
10+
-d PRODUCT_NAME="$(VS_FF_PRODUCT_NAME)" \
11+
-d PRODUCT_BUGREPORT="$(PRODUCT_BUGREPORT)" \
12+
-d PRODUCT_URL="$(PRODUCT_URL)" \
13+
-d VS_FF_LEGAL_COMPANY_NAME="$(VS_FF_LEGAL_COMPANY_NAME)" \
14+
-d VS_FF_PRODUCT_UPDATES="$(VS_FF_PRODUCT_UPDATES)" \
15+
-d VS_FF_LEGAL_COMPANY_URL="$(VS_FF_LEGAL_COMPANY_URL)"
316
#Include support for minidriver
417
MINIDRIVER_DEF = /DENABLE_MINIDRIVER
5-
WIXFLAGS = -d ENABLE_MINIDRIVER
18+
WIXFLAGS = -d ENABLE_MINIDRIVER $(WIXFLAGS)
619

720
#Build MSI with the Windows Installer XML (WIX) toolkit
821
!IF "$(WIX_PACKAGES)" == ""
922
WIX_PACKAGES = $(TOPDIR)\win32\packages
10-
WIX_VERSION = 6.0.0
23+
WIX_VERSION = 6.0.2
1124
!ENDIF
1225
WIX_INCL_DIR = "/I$(WIX_PACKAGES)/wixtoolset.dutil/$(WIX_VERSION)/build/native/include" \
1326
"/I$(WIX_PACKAGES)/wixtoolset.wcautil/$(WIX_VERSION)/build/native/include"
@@ -117,7 +130,13 @@ WIXFLAGS = -d OpenPACE="$(OPENPACE_DIR)" $(WIXFLAGS)
117130
# Used for MiniDriver
118131
CPDK_INCL_DIR = "/IC:\Program Files (x86)\Windows Kits\10\Cryptographic Provider Development Kit\Include"
119132

120-
DEFS = /DWINVER=0x0601 /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DOPENSC_FEATURES="\"$(OPENSC_FEATURES)\""
133+
DEFS = /DWINVER=0x0601 /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DOPENSC_FEATURES="\"$(OPENSC_FEATURES)\"" \
134+
/DPACKAGE_NAME="\"$(PRODUCT_NAME)\"" /DPACKAGE_VERSION="\"$(PRODUCT_VERSION)\"" \
135+
/DOPENSC_VERSION_MAJOR=$(PACKAGE_VERSION_MAJOR) /DOPENSC_VERSION_MINOR=$(PACKAGE_VERSION_MINOR) \
136+
/DOPENSC_VERSION_FIX=$(PACKAGE_VERSION_FIX) /DOPENSC_VERSION_REVISION=$(PACKAGE_VERSION_REVISION) \
137+
/DOPENSC_SCM_REVISION="\"$(PACKAGE_SCM_REVISION)\"" \
138+
/DOPENSC_VS_FF_COMPANY_NAME="\"$(VS_FF_LEGAL_COMPANY_NAME)\"" /DOPENSC_VS_FF_PRODUCT_NAME="\"$(VS_FF_PRODUCT_NAME)\"" \
139+
/DOPENSC_VS_FF_LEGAL_COPYRIGHT="\"$(VS_FF_LEGAL_COPYRIGHT)\"" /DOPENSC_VS_FF_COMMENTS="\"$(VS_FF_COMMENTS)\""
121140
COPTS = /nologo /Zi /GS /W3 /WX /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_WARNINGS /DHAVE_CONFIG_H \
122141
$(DEFS) $(DEBUG_DEF) $(OPENPACE_DEF) $(OPENSSL_DEF) $(ZLIB_DEF) $(MINIDRIVER_DEF) $(SM_DEF) $(TESTS_DEF) $(OPENSSL_EXTRA_CFLAGS) \
123142
/I$(TOPDIR)\win32 /I$(TOPDIR)\src $(OPENPACE_INCL_DIR) $(OPENSSL_INCL_DIR) $(ZLIB_INCL_DIR) $(CPDK_INCL_DIR)

0 commit comments

Comments
 (0)