-
Notifications
You must be signed in to change notification settings - Fork 30
/
appveyor.yml
112 lines (99 loc) · 6.23 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
version: 1.1.3.{build}
platform:
- x86
- x64
environment:
PATH: C:\msys64\usr\bin;%PATH%
CL_OPTIONS: /W3 /D_CRT_SECURE_NO_DEPRECATE /DWIN32_LEAN_AND_MEAN /GS /MT /DHAVE_CONFIG_H /I%APPVEYOR_BUILD_FOLDER%
GENGETOPT: /usr/bin/gengetopt.exe --include-getopt
HELP2MAN: /usr/bin/true # don't generate manual files
# If AppVeyor comes with OpenSSL 1.1.0 installed
#OPENSSL_1_1_0_FLAGS: /DHAVE_ASN1_STRING_GET0_DATA=1 /DHAVE_DECL_OPENSSL_ZALLOC=1 /DHAVE_DH_GET0_KEY=1 /DHAVE_DH_GET0_PQG=1 /DHAVE_DH_SET0_KEY=1 /DHAVE_DH_SET0_PQG=1 /DHAVE_ECDSA_SIG_GET0=1 /DHAVE_ECDSA_SIG_SET0=1 /DHAVE_EC_KEY_METHOD=1 /DHAVE_RSA_GET0_KEY=1 /DHAVE_RSA_SET0_KEY=1
matrix:
- VSVER: 14
install:
- ps: >-
If ($env:Platform -Match "x86") {
$env:VCVARS_PLATFORM="x86"
$env:OPENSSL_PLATFORM="Win32"
$env:OPENPACE_PLATFORM="win32"
# If AppVeyor comes with OpenSSL 1.1.0 installed
#$env:LIBCRYPTO="libcrypto32MT.lib"
$env:LIBCRYPTO="libeay32MT.lib"
$env:PYTHON_PLATFORM=""
} Else {
$env:VCVARS_PLATFORM="amd64"
$env:OPENSSL_PLATFORM="Win64"
$env:OPENPACE_PLATFORM="win64"
# If AppVeyor comes with OpenSSL 1.1.0 installed
#$env:LIBCRYPTO="libcrypto64MT.lib"
$env:LIBCRYPTO="libeay32MT.lib"
$env:PYTHON_PLATFORM="-x64"
}
- set PATH=C:\Python38%PYTHON_PLATFORM%;%PATH%
- set PYTHON_INCLUDE=C:\Python38%PYTHON_PLATFORM%\include
- set PYTHON_LIB=C:\Python38%PYTHON_PLATFORM%\libs\python38.lib
- set ARTIFACT=%APPVEYOR_PROJECT_NAME%_%OPENPACE_PLATFORM%-vs%VSVER%-python3
- set OPENSSL_DIR=C:\OpenSSL-%OPENSSL_PLATFORM%
- for /f "usebackq tokens=*" %%a in (`cygpath -u %OPENSSL_DIR%`) do set OPENSSL_CYGDIR=%%a
- set OPENPACE_DIR=C:\%ARTIFACT%
- for /f "usebackq tokens=*" %%a in (`cygpath -u %OPENPACE_DIR%`) do set DESTDIR=%%a
- set CRYPTO_CFLAGS=-I%OPENSSL_CYGDIR%/include
- set CRYPTO_LIBS="-L%OPENSSL_CYGDIR%/lib -llibeay32"
# # Switch from SF to msys2.org (default, much faster)
- bash -c "pacman --needed --noconfirm --sync pacman-mirrors"
- bash -c "pacman --needed --noconfirm --sync autoconf automake libtool gengetopt swig"
- python -V
- swig -version
- ps: $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:VSVER" + "0COMNTOOLS"))
- echo "Using Visual Studio %VSVER%.0 at %VSCOMNTOOLS%"
- call "%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" %VCVARS_PLATFORM%
build_script:
# preparation with Autotools and MinGW-w64
- bash -c "autoreconf -i"
- bash -c "touch src/cvc-create.1 src/cvc-print.1"
- bash -c "./configure --prefix=/"
# linking would fail because the VC libraries are incompatible with MinGW-w64,
# so we only create and install what is usable and needed later
- bash -c "make -C src cvc-print-cmdline.c cvc-create-cmdline.c"
# build with plain cl in cmd and statically bound OpenSSL
- cd src
- cl /I%OPENSSL_DIR%\include /I. /DX509DIR=\"/\" /DCVCDIR=\"/\" %CL_OPTIONS% %OPENSSL_1_1_0_FLAGS% /c 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 /out:libeacMT.lib ws2_32.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
- cl /I%OPENSSL_DIR%\include /I. libeacMT.lib %OPENSSL_DIR%\lib\VC\static\%LIBCRYPTO% user32.lib advapi32.lib crypt32.lib gdi32.lib %CL_OPTIONS% %OPENSSL_1_1_0_FLAGS% eactest.c vc.c ssl_compat.c
# The following has already been performed by make (see above)
# gengetopt.exe --include-getopt --file-name=cvc-print-cmdline --input=cvc-print.ggo
- cl /I%OPENSSL_DIR%\include /I. libeacMT.lib %OPENSSL_DIR%\lib\VC\static\%LIBCRYPTO% user32.lib advapi32.lib crypt32.lib gdi32.lib %CL_OPTIONS% %OPENSSL_1_1_0_FLAGS% cvc-print.c read_file.c cvc-print-cmdline.c vc.c
# The following has already been performed by make (see above)
# gengetopt.exe --include-getopt --file-name=cvc-create-cmdline --input= cvc-create.ggo
- cl /I%OPENSSL_DIR%\include /I. libeacMT.lib %OPENSSL_DIR%\lib\VC\static\%LIBCRYPTO% user32.lib advapi32.lib crypt32.lib gdi32.lib %CL_OPTIONS% %OPENSSL_1_1_0_FLAGS% cvc-create.c read_file.c cvc-create-cmdline.c vc.c
- cd ..
- cd bindings\python\
- swig -python -outdir . -I.. eac.i
- cl /I%OPENSSL_DIR%\include /I%PYTHON_INCLUDE% /I..\..\src %CL_OPTIONS% %OPENSSL_1_1_0_FLAGS% /c eac_wrap.c ..\..\src\ssl_compat.c ..\..\src\vc.c
- link /out:_eac.pyd /dll eac_wrap.obj ssl_compat.obj vc.obj %PYTHON_LIB% ..\..\src\libeacMT.lib %OPENSSL_DIR%\lib\VC\static\%LIBCRYPTO% user32.lib advapi32.lib crypt32.lib gdi32.lib
- cd ..\..
# package all artifacts
- bash -c "make install-data-recursive"
- bash -c "cp src/libeacMT.lib $DESTDIR/lib"
- bash -c "mkdir -p $DESTDIR/bin"
- bash -c "cp src/eactest.exe $DESTDIR/bin"
- bash -c "cp src/cvc-create.exe $DESTDIR/bin"
- bash -c "cp src/cvc-print.exe $DESTDIR/bin"
- bash -c "tail -n +2 bindings/python/cvc_rehash.in > $DESTDIR/bin/cvc_rehash"
- bash -c "cp bindings/python/eac.py $DESTDIR/bin"
- bash -c "cp bindings/python/_eac.pyd $DESTDIR/bin"
- bash -c "cp bindings/python/example.py $DESTDIR/bin"
- bash -c "cp bindings/python/chat.py $DESTDIR/bin"
- bash -c "cp bindings/python/pace_entity.py $DESTDIR/bin"
- bash -c "$OPENSSL_CYGDIR/bin/openssl.exe version >> $DESTDIR/dependencies.txt"
# tests
- bash -c " $DESTDIR/bin/eactest.exe"
- bash -c "for i in $DESTDIR/etc/eac/cvc/*; do $DESTDIR/bin/cvc-print --cvc=$i --cvc-dir=$DESTDIR/etc/eac/cvc/; done"
- bash -c "python bindings/python/test.py"
# push the binaries
- 7z a %ARTIFACT%.zip %OPENPACE_DIR% > nul
- appveyor PushArtifact %ARTIFACT%.zip
cache:
- C:\msys64\var\cache\pacman\pkg\gengetopt* -> appveyor.yml
- C:\msys64\var\cache\pacman\pkg\swig* -> appveyor.yml