From patchwork Fri Mar 31 15:42:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 3181 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7301:5492:b0:b2:b40d:92f9 with SMTP id ab18csp568491dyc; Fri, 31 Mar 2023 08:42:58 -0700 (PDT) X-Google-Smtp-Source: AKy350ZbkQzbB67BYfSqLeQG0Qbm4Qx7JZncyI5AJogHoIOk+eqhRnVvpBx54wKVZKkwQSLS9CCS X-Received: by 2002:a17:902:ce92:b0:1a2:1042:cadc with SMTP id f18-20020a170902ce9200b001a21042cadcmr32407167plg.18.1680277378183; Fri, 31 Mar 2023 08:42:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680277378; cv=none; d=google.com; s=arc-20160816; b=jGIOfmzCmf/RCHjhOauzCu6dtLQTIvowC78CHV8fk7CMzAmmYXl0+7BXDRjhanew8v YEq7x6VHb11CyL0tMbglkrYyVHJk8NpEmRFeh7bAnCPH9wfd/ceG7sPvrzJe+eJiHG7b OggLUOcjG4b34S0PBHfs5mOauJUjfREoEWAmUdOgO+8r7xLi2M0HxRQ9In17lKmPd+Bi 4RFAWD/ha68MYi7SUjRfN8vdxGxN2q1vYNWCC88iBPJFSpKqaS0MSXcY5Ii5QXRkxQ/t o41vhg/q0J3TmV7/i79J1HIgfFNyDPIi5bJxBdQ1mWU7DVeyJOdVKAQsdJolPA7BhE46 acGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=V+4E70GyLVCC3av7avmxTVUErdaImVsuu0rAEpxo/c4=; b=VCqPf2thx5zU7kzRq4vPBMIWt/PCucah2O2R3YTiZMBjG40BJAUEYwO6PpZCjZtqPX Q5aDyqWKNZzsmLQMs8ct6qAOLPj8YUNGuTqk5/0c3T0GJ+JtOUKDgJuVwKOzdqACGYep ORLVyY1VkoEhbJpA/wIboxPI3TCxLpY90rCG9/FgHaRKSMbY6rOxu84nAc97/AFezxEz ZHzH1fGEKM0X6uZiEACQ0egydxjywAPpcRNguQJQ2MjLSPAbyefyTHJCKR+tfEPgsfee tJQgv42Zky5CywaGiSYgZfOXF4VkIWKTWcKlKOhaAac459seKLMyo2ntYRNvBmereTZ/ 6Ong== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=GYZbuVHY; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=XqNMOwTq; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=TMf+VaD8; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id u17-20020a170902e81100b001a05d12eeb3si2718529plg.189.2023.03.31.08.42.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Mar 2023 08:42:58 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=GYZbuVHY; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=XqNMOwTq; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=TMf+VaD8; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1piGtf-0007Jn-0L; Fri, 31 Mar 2023 15:42:34 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1piGtc-0007Jg-Hy for openvpn-devel@lists.sourceforge.net; Fri, 31 Mar 2023 15:42:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=NvtrGL398141oZcx0mRKNuSyhbWM0ZVgLSbSKDtGxr8=; b=GYZbuVHYRKdY5yD41L68g9i2iR lTXPbVbBrP3kqedfsD4suPECfb7ho3YX6J9SDumFjNbHiPzJWeKxN0XTqvhkBPk4zDtcpkcRYxW2Q VleWEwLlebbXTShWbdlvTZ8YVpPzhDpuRPmh9+obdUWdu9JSfOiC2hZm/EZmmPsPfrVI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=NvtrGL398141oZcx0mRKNuSyhbWM0ZVgLSbSKDtGxr8=; b=XqNMOwTqXueC3Bdi6TOPFs+RW+ RSZDMXBTJj34srkL4biQfm7rPyAeFdRojG8VYuGM8iPwGBfLZqT3moaVpVnRQ/J8xLEPA0w0GdTH1 8PKL6GV68xIFjaQfAvsmHyCuxPIMwUFGRXrvyu9CvkSe5dUCKLF2wXzwTg/VwM9c6c+8=; Received: from mout-p-101.mailbox.org ([80.241.56.151]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1piGtZ-0004QD-Pw for openvpn-devel@lists.sourceforge.net; Fri, 31 Mar 2023 15:42:31 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4Pp4Kg1rClz9sTQ for ; Fri, 31 Mar 2023 17:42:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1680277335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NvtrGL398141oZcx0mRKNuSyhbWM0ZVgLSbSKDtGxr8=; b=TMf+VaD8grWyS9bnoXlPcDq27DFz4UTCjeQcBi7OUmbCOye5j2XH0PHxJRpCtKP+kfU6sq XynQwzKyIMCGCm+TKA5TCosE6wmheef5X/ahjTYS03fyK5R6Xf7fMqslvsJ/4PWup5gaMs QbOT+080kPIhvuxo8sGWsy1S5viclZDD8MAWFDMzhD8dSUmHgmp7cWMx4mc4yx77ysq1lQ qL39P04XI+tf0cesH8Lvvt5s9o2ksupMioVA+JwqyGufsOl5QqdZiCkmZungTfAf6ClKhB XEhCg06Yf16Z6rC6x8AeINU1inYj3+OBCXFdqvsczoFUoRHJ6leZ/Rin0hfaBQ== From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Fri, 31 Mar 2023 17:42:12 +0200 Message-Id: <20230331154214.613245-2-frank@lichtenheld.com> In-Reply-To: <20230331154214.613245-1-frank@lichtenheld.com> References: <20230331154214.613245-1-frank@lichtenheld.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4Pp4Kg1rClz9sTQ X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Annoyingly this requires custom vcpkg triplets because the mingw toolchain definition and the vcpkg_configure_make function use incompatible default triplets (-pc-mingw32 vs -w64-mingw32). Change-Id: I4e671938220e9bfd798f91819f34b6f8ceaa45f5 Signed-off-by: Frank Lichtenheld --- ...to-succeed-if-configured-with-disabl.patch | 46 +++++++++++++++++++ .../vcpkg-ports [...] Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.151 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-Headers-End: 1piGtZ-0004QD-Pw Subject: [Openvpn-devel] [PATCH 1/3] vcpkg-ports/pkcs11-helper: Make compatible with mingw build X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1761898532434395423?= X-GMAIL-MSGID: =?utf-8?q?1761898532434395423?= Annoyingly this requires custom vcpkg triplets because the mingw toolchain definition and the vcpkg_configure_make function use incompatible default triplets (-pc-mingw32 vs -w64-mingw32). Change-Id: I4e671938220e9bfd798f91819f34b6f8ceaa45f5 Signed-off-by: Frank Lichtenheld Acked-by: Lev Stipakov --- ...to-succeed-if-configured-with-disabl.patch | 46 +++++++++++++++++++ .../vcpkg-ports/pkcs11-helper/portfile.cmake | 33 ++++++++++--- contrib/vcpkg-triplets/x64-mingw-ovpn.cmake | 8 ++++ contrib/vcpkg-triplets/x86-mingw-ovpn.cmake | 8 ++++ 4 files changed, 88 insertions(+), 7 deletions(-) create mode 100644 contrib/vcpkg-ports/pkcs11-helper/0001-Allow-the-build-to-succeed-if-configured-with-disabl.patch create mode 100644 contrib/vcpkg-triplets/x64-mingw-ovpn.cmake create mode 100644 contrib/vcpkg-triplets/x86-mingw-ovpn.cmake diff --git a/contrib/vcpkg-ports/pkcs11-helper/0001-Allow-the-build-to-succeed-if-configured-with-disabl.patch b/contrib/vcpkg-ports/pkcs11-helper/0001-Allow-the-build-to-succeed-if-configured-with-disabl.patch new file mode 100644 index 00000000..102be4ec --- /dev/null +++ b/contrib/vcpkg-ports/pkcs11-helper/0001-Allow-the-build-to-succeed-if-configured-with-disabl.patch @@ -0,0 +1,46 @@ +From 7171396a151a2edb3474c7a321b7ae4ff7e171fc Mon Sep 17 00:00:00 2001 +From: Frank Lichtenheld +Date: Wed, 29 Mar 2023 12:44:44 +0200 +Subject: [PATCH] Allow the build to succeed if configured with + --disable-shared + +Do not try to install a file that does not exist. + +Signed-off-by: Frank Lichtenheld +--- + configure.ac | 1 + + lib/Makefile.am | 2 ++ + 2 files changed, 3 insertions(+) + +diff --git a/configure.ac b/configure.ac +index a7e9760..f154ae3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -581,6 +581,7 @@ AC_SUBST([LIBPKCS11_HELPER_LT_AGE]) + AC_SUBST([LIBPKCS11_HELPER_LT_OLDEST]) + AC_SUBST([WIN_LIBPREFIX]) + AC_SUBST([PKCS11H_FEATURES]) ++AM_CONDITIONAL([ENABLE_SHARED], [test "${enable_shared}" = "yes" ]) + AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"]) + AM_CONDITIONAL([CYGWIN], [test "${CYGWIN}" = "yes"]) + AM_CONDITIONAL([ENABLE_DOC], [test "${enable_doc}" = "yes"]) +diff --git a/lib/Makefile.am b/lib/Makefile.am +index 31b928f..3cba32f 100644 +--- a/lib/Makefile.am ++++ b/lib/Makefile.am +@@ -128,10 +128,12 @@ if ENABLE_PKCS11H_TOKEN + endif + + if WIN32 ++if ENABLE_SHARED + mylibdir=$(libdir) + mylib_DATA=.libs/@WIN_LIBPREFIX@pkcs11-helper-@LIBPKCS11_HELPER_LT_OLDEST@.dll.def + .libs/@WIN_LIBPREFIX@pkcs11-helper-@LIBPKCS11_HELPER_LT_OLDEST@.dll.def: libpkcs11-helper.la + endif ++endif + + RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) +-- +2.34.1 + diff --git a/contrib/vcpkg-ports/pkcs11-helper/portfile.cmake b/contrib/vcpkg-ports/pkcs11-helper/portfile.cmake index 1c6cedac..67e9a2bf 100644 --- a/contrib/vcpkg-ports/pkcs11-helper/portfile.cmake +++ b/contrib/vcpkg-ports/pkcs11-helper/portfile.cmake @@ -13,24 +13,43 @@ vcpkg_extract_source_archive_ex( PATCHES 0001-nmake-compatibility-with-vcpkg-nmake.patch 0002-config-w32-vc.h.in-indicate-OpenSSL.patch + 0001-Allow-the-build-to-succeed-if-configured-with-disabl.patch pkcs11-helper-001-RFC7512.patch pkcs11-helper-002-dynamic_loader_flags.patch ) -vcpkg_build_nmake( +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + vcpkg_build_nmake( SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH lib PROJECT_NAME Makefile.w32-vc OPTIONS OPENSSL=1 OPENSSL_HOME=${CURRENT_PACKAGES_DIR}/../openssl_${TARGET_TRIPLET} -) + ) + + file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/pkcs11-helper.dll.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/pkcs11-helper.dll.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + + file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/libpkcs11-helper-1.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/libpkcs11-helper-1.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + + file(INSTALL ${SOURCE_PATH}/include/pkcs11-helper-1.0 DESTINATION ${CURRENT_PACKAGES_DIR}/include/) + +else() + find_program(man_to_html man2html REQUIRED) + + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS --disable-crypto-engine-gnutls --disable-crypto-engine-nss + --disable-crypto-engine-polarssl --disable-crypto-engine-mbedtls + ) + vcpkg_install_make() + vcpkg_fixup_pkgconfig() -file(INSTALL ${SOURCE_PATH}/include/pkcs11-helper-1.0 DESTINATION ${CURRENT_PACKAGES_DIR}/include/) -file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/pkcs11-helper.dll.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/pkcs11-helper.dll.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +endif() -file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/libpkcs11-helper-1.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin) -file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/libpkcs11-helper-1.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) +vcpkg_copy_pdbs() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/contrib/vcpkg-triplets/x64-mingw-ovpn.cmake b/contrib/vcpkg-triplets/x64-mingw-ovpn.cmake new file mode 100644 index 00000000..3676cdb0 --- /dev/null +++ b/contrib/vcpkg-triplets/x64-mingw-ovpn.cmake @@ -0,0 +1,8 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_ENV_PASSTHROUGH PATH) + +set(VCPKG_CMAKE_SYSTEM_NAME MinGW) + +set(VCPKG_MAKE_BUILD_TRIPLET --host=x86_64-w64-mingw32) diff --git a/contrib/vcpkg-triplets/x86-mingw-ovpn.cmake b/contrib/vcpkg-triplets/x86-mingw-ovpn.cmake new file mode 100644 index 00000000..9e65f67f --- /dev/null +++ b/contrib/vcpkg-triplets/x86-mingw-ovpn.cmake @@ -0,0 +1,8 @@ +set(VCPKG_TARGET_ARCHITECTURE x86) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_ENV_PASSTHROUGH PATH) + +set(VCPKG_CMAKE_SYSTEM_NAME MinGW) + +set(VCPKG_MAKE_BUILD_TRIPLET --host=i686-w64-mingw32)