From bbf12005c19b8d6bdc3dbdc3096b89d25fec09c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Thu, 31 May 2018 09:52:18 +0200 Subject: [PATCH] p11-kit: upstream patch for issetugid(2) test. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jürgen Buchmüller --- .../p11-kit/patches/fix-issetugid-check.patch | 36 +++++++++++++++++++ srcpkgs/p11-kit/template | 10 +++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/p11-kit/patches/fix-issetugid-check.patch diff --git a/srcpkgs/p11-kit/patches/fix-issetugid-check.patch b/srcpkgs/p11-kit/patches/fix-issetugid-check.patch new file mode 100644 index 00000000000..8683b56c02a --- /dev/null +++ b/srcpkgs/p11-kit/patches/fix-issetugid-check.patch @@ -0,0 +1,36 @@ +build: Ease issetugid() check when cross-compiling + +When cross-compiling, the configure check for issetugid() aborts, +because of the pessimistic default of AC_RUN_IFELSE. This patch +provides the non-pessimistic default to AC_RUN_IFELSE and wrap the +macro invocation with AC_CACHE_CHECK so that the user can override the +check by setting ac_cv_issetugid_openbsd=yes, as suggested in: +https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Runtime.html#Runtime + +--- configure.ac 2018-05-30 16:10:47.000000000 +0200 ++++ configure.ac 2018-05-31 15:43:06.099988369 +0200 +@@ -115,15 +115,17 @@ + + # Check if issetugid() is available and has compatible behavior with OpenBSD + AC_CHECK_FUNCS([issetugid], [ +- AC_MSG_CHECKING([whether issetugid() can detect setuid/setgid]) +- issetugid_openbsd=no +- AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include ]], +- [[return issetugid ();]])], +- [chmod 02777 ./conftest$EXEEXT; ./conftest$EXEEXT || issetugid_openbsd=yes]) +- if test "$issetugid_openbsd" = yes; then ++ AC_CACHE_CHECK([whether issetugid() can detect setuid/setgid], ++ [ac_cv_issetugid_openbsd], ++ [ac_cv_issetugid_openbsd=no ++ AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include ]], ++ [[return issetugid ();]])], ++ [chmod 02777 ./conftest$EXEEXT; ./conftest$EXEEXT || ac_cv_issetugid_openbsd=yes], ++ [ac_cv_issetugid_openbsd=no], ++ [ac_cv_issetugid_openbsd="guessing no"])]) ++ if test "$ac_cv_issetugid_openbsd" = yes; then + AC_DEFINE([HAVE_ISSETUGID_OPENBSD], [1], [Whether issetugid() has compatible behavior with OpenBSD]) + fi +- AC_MSG_RESULT([$issetugid_openbsd]) + ]) + + # Required functions diff --git a/srcpkgs/p11-kit/template b/srcpkgs/p11-kit/template index 55341ccc0bd..9fa40689dc3 100644 --- a/srcpkgs/p11-kit/template +++ b/srcpkgs/p11-kit/template @@ -4,7 +4,7 @@ version=0.23.12 revision=1 build_style=gnu-configure configure_args="--with-module-path=/usr/lib/pkcs11 --without-trust-paths" -hostmakedepends="pkg-config" +hostmakedepends="automake libtool pkg-config" makedepends="libtasn1-devel libffi-devel" short_desc="Provides a way to load and enumerate PKCS#11 modules" maintainer="Juan RP " @@ -14,6 +14,14 @@ distfiles="${homepage}/releases/download/${version}/p11-kit-${version}.tar.gz" checksum=58bae22f19db1de1a1103e7ca4149eed6e303e727878c2cd5ea9e6fe445fd403 conf_files="/etc/pkcs11/pkcs11.conf" +case "$XBPS_TARGET_MACHIN" in + *-musl) configure_args+=" ac_cv_issetugid_openbsd=no" ;; +esac + +pre_configure() { + NOCONFIGURE=1 autoreconf -fi +} + post_install() { mv ${DESTDIR}/etc/pkcs11/pkcs11.conf.example ${DESTDIR}/etc/pkcs11/pkcs11.conf vlicense COPYING