From e50ea557e01abdedb0e59b0d758e93a8ae9bd4d4 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Thu, 2 Aug 2018 01:13:44 +0200 Subject: windows-libs: add script to build gcrypt libs package Tested with MSVC 2015 (Win64) and the WireGuard patches on top of v2.9.0rc0-1338-g9b9a0d0f88. The decryption suite (43 tests) passes. README.Wireshark is based on Pascal's instructions from libgcrypt-1.7.6-win64ws.zip --- windows-libs/make-libgcrypt-libs-zip.sh | 80 +++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100755 windows-libs/make-libgcrypt-libs-zip.sh diff --git a/windows-libs/make-libgcrypt-libs-zip.sh b/windows-libs/make-libgcrypt-libs-zip.sh new file mode 100755 index 0000000..3a5b5d1 --- /dev/null +++ b/windows-libs/make-libgcrypt-libs-zip.sh @@ -0,0 +1,80 @@ +#!/bin/bash +# Create a libgcrypt-*-win??ws.zip file based on MingW packages. +# +# Copyright 2018, Peter Wu +# +# SPDX-License-Identifier: (GPL-2.0-or-later or MIT) +set -eu + +# Debian buster (already contains --disable-padlock-support --disable-asm) +# https://packages.debian.org/buster/libgpg-error-mingw-w64-dev +# https://packages.debian.org/buster/libgcrypt-mingw-w64-dev +# https://salsa.debian.org/debian/libgpg-error/blob/debian/1.32-1/debian/rules +# https://salsa.debian.org/gnutls-team/libgcrypt/blob/1.8.3-1/debian/rules +urls=( +http://ftp.nl.debian.org/debian/pool/main/libg/libgpg-error/libgpg-error-mingw-w64-dev_1.32-1_all.deb +http://ftp.nl.debian.org/debian/pool/main/libg/libgcrypt20/libgcrypt-mingw-w64-dev_1.8.3-1_all.deb +) +version=1.8.3 + +if [ -e usr ]; then + echo "Remove usr/ before proceeding" + exit 1 +fi + +# 1. Download .deb files if they are missing and verify integrity. +for url in "${urls[@]}"; do + filename="${url##*/}" + if [ ! -e "$filename" ]; then + echo "Retrieving $url" + curl -O "$url" + fi +done +sha256sum --check < "$prefix/README.Wireshark" +done + +# 5. Create an archive +files=( +"bin/libgcrypt-20.dll" +"bin/libgcrypt-20.lib" +"bin/libgpg-error-0.dll" +"bin/libgpg-error-0.lib" +"include" +"README.Wireshark" +) +bsdtar -caf "libgcrypt-$version-win32ws.zip" -C usr/i686-w64-mingw32 "${files[@]}" +bsdtar -caf "libgcrypt-$version-win64ws.zip" -C usr/x86_64-w64-mingw32 "${files[@]}" + +ls -l "libgcrypt-$version-win32ws.zip" "libgcrypt-$version-win64ws.zip" -- cgit v1.2.1