openconnect-sys-0.1.0 has been yanked.
Visit the last successful build:
openconnect-sys-0.1.5
Build guide
Pre-request
according to the openconnect build guide, you should install the following packages as dependencies.
Download vpnc-script if you don't have it
You can test if vpnc-script exists in your system by ls /etc/vpnc/vpnc-script or ls /usr/share/vpnc-scripts/vpnc-script. If it doesn't exist, you can download it from the openconnect project.
# you may need to run under sudo
For Ubuntu
For building tools:
For MacOS
For building tools:
For Windows (MSYS2 MINGW64)
Download MSYS2
Switch rust toolchain to windows-gnu
You have to use MSYS2 MINGW64 shell to build the library for 64-bit Windows.
Minor changes for Windows
-
in config.h, you may add
-
for cargo build, you have to use CFLAGS under MSYS2 MINGW64 shell, this avoid error when building rustls. See details here: https://github.com/aws/aws-lc-rs/issues/370
For bash:
&&For powershell:
$env:CFLAGS="-D_ISOC11_SOURCE"; cargo build
Download source
Build static library
# --with-vpnc-script=./vpnc-script-win.js # for windows
# --with-vpnc-script=/opt/vpnc-scripts/vpnc-script # for *nix without vpnc-script installed