gnu: p11-kit: Fix Hurd build.
* gnu/packages/patches/p11-kit-hurd.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/tls.scm (p11-kit)[native-inputs]: Add autoconf, automake, gettext and libtool when targeting Hurd. [inputs]: Add libbsd and hurd-patch when targeting hurd. [arguments]: Add 'apply-hurd-patch and 'bootstrap phases when targeting Hurd.master
parent
9211d4324c
commit
1a244b7814
|
@ -1564,6 +1564,7 @@ dist_patch_DATA = \
|
||||||
%D%/packages/patches/smalltalk-multiplication-overflow.patch \
|
%D%/packages/patches/smalltalk-multiplication-overflow.patch \
|
||||||
%D%/packages/patches/sqlite-hurd.patch \
|
%D%/packages/patches/sqlite-hurd.patch \
|
||||||
%D%/packages/patches/sunxi-tools-remove-sys-io.patch \
|
%D%/packages/patches/sunxi-tools-remove-sys-io.patch \
|
||||||
|
%D%/packages/patches/p11-kit-hurd.patch \
|
||||||
%D%/packages/patches/patchutils-test-perms.patch \
|
%D%/packages/patches/patchutils-test-perms.patch \
|
||||||
%D%/packages/patches/patch-hurd-path-max.patch \
|
%D%/packages/patches/patch-hurd-path-max.patch \
|
||||||
%D%/packages/patches/perl-autosplit-default-time.patch \
|
%D%/packages/patches/perl-autosplit-default-time.patch \
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
Taken from: https://groups.google.com/g/linux.debian.bugs.dist/c/mX4GpUJih4k.
|
||||||
|
|
||||||
|
--- a/configure.ac
|
||||||
|
+++ b/configure.ac
|
||||||
|
@@ -132,6 +132,16 @@ if test "$os_unix" = "yes"; then
|
||||||
|
AC_CHECK_FUNCS([getpeereid])
|
||||||
|
AC_CHECK_FUNCS([getpeerucred])
|
||||||
|
AC_CHECK_FUNCS([issetugid])
|
||||||
|
+ case "$host_os" in
|
||||||
|
+ kfreebsd*-gnu | gnu*)
|
||||||
|
+ have_getpeereid=no
|
||||||
|
+ AC_CHECK_LIB(bsd, getpeereid, have_getpeereid=yes)
|
||||||
|
+ if test "x$have_getpeereid" = "xyes"; then
|
||||||
|
+ AC_DEFINE([HAVE_GETPEEREID], [1], [have getpeereid])
|
||||||
|
+ AC_SEARCH_LIBS([getpeereid], [bsd])
|
||||||
|
+ fi
|
||||||
|
+ ;;
|
||||||
|
+ esac
|
||||||
|
|
||||||
|
AC_CACHE_CHECK([for thread-local storage class],
|
||||||
|
[ac_cv_tls_keyword],
|
||||||
|
|
||||||
|
--- a/common/unix-peer.c
|
||||||
|
+++ b/common/unix-peer.c
|
||||||
|
@@ -47,6 +47,11 @@
|
||||||
|
# include <ucred.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#ifdef HAVE_GETPEEREID
|
||||||
|
+/* Declare getpeereid from /usr/include/bsd/unistd.h */
|
||||||
|
+extern int getpeereid(int s, uid_t *euid, gid_t *egid);
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
/* Returns the unix domain socket peer information.
|
||||||
|
* Returns zero on success.
|
||||||
|
*/
|
||||||
|
@@ -73,7 +78,8 @@ p11_get_upeer_id (int cfd, uid_t *uid, u
|
||||||
|
*pid = cr.pid;
|
||||||
|
|
||||||
|
#elif defined(HAVE_GETPEEREID)
|
||||||
|
- /* *BSD/MacOSX */
|
||||||
|
+ /* *BSD/MacOSX/kFreeBSD/Hurd */
|
||||||
|
+
|
||||||
|
uid_t euid;
|
||||||
|
gid_t egid;
|
||||||
|
|
|
@ -57,6 +57,7 @@
|
||||||
#:use-module (gnu packages curl)
|
#:use-module (gnu packages curl)
|
||||||
#:use-module (gnu packages dns)
|
#:use-module (gnu packages dns)
|
||||||
#:use-module (gnu packages gawk)
|
#:use-module (gnu packages gawk)
|
||||||
|
#:use-module (gnu packages gettext)
|
||||||
#:use-module (gnu packages guile)
|
#:use-module (gnu packages guile)
|
||||||
#:use-module (gnu packages hurd)
|
#:use-module (gnu packages hurd)
|
||||||
#:use-module (gnu packages libbsd)
|
#:use-module (gnu packages libbsd)
|
||||||
|
@ -143,13 +144,33 @@ in intelligent transportation networks.")
|
||||||
(base32 "1dn6br4v033d3gp2max9lsr3y4q0nj6iyr1yq3kzi8ym7lal13wa"))))
|
(base32 "1dn6br4v033d3gp2max9lsr3y4q0nj6iyr1yq3kzi8ym7lal13wa"))))
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("pkg-config" ,pkg-config)))
|
`(,@(if (hurd-target?)
|
||||||
|
`(("autoconf" ,autoconf)
|
||||||
|
("automake" ,automake)
|
||||||
|
("gettext" ,gettext-minimal) ;for autopoint
|
||||||
|
("libtool" ,libtool))
|
||||||
|
'())
|
||||||
|
("pkg-config" ,pkg-config)))
|
||||||
(inputs
|
(inputs
|
||||||
`(("libffi" ,libffi)
|
`(("libffi" ,libffi)
|
||||||
|
,@(if (hurd-target?)
|
||||||
|
`(("libbsd" ,libbsd)
|
||||||
|
("hurd-patch" ,(search-patch "p11-kit-hurd.patch")))
|
||||||
|
'())
|
||||||
("libtasn1" ,libtasn1)))
|
("libtasn1" ,libtasn1)))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:configure-flags '("--without-trust-paths")
|
`(#:configure-flags '("--without-trust-paths")
|
||||||
#:phases (modify-phases %standard-phases
|
#:phases (modify-phases %standard-phases
|
||||||
|
,@(if (hurd-target?)
|
||||||
|
'((add-after 'unpack 'apply-hurd-patch
|
||||||
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
|
(let ((patch (assoc-ref inputs "hurd-patch")))
|
||||||
|
(invoke "patch" "-p1" "--batch" "-i"
|
||||||
|
patch))))
|
||||||
|
(replace 'bootstrap
|
||||||
|
(lambda _
|
||||||
|
(invoke "autoreconf" "-fiv"))))
|
||||||
|
'())
|
||||||
(add-before 'check 'prepare-tests
|
(add-before 'check 'prepare-tests
|
||||||
(lambda _
|
(lambda _
|
||||||
;; "test-runtime" expects XDG_RUNTIME_DIR to be set up
|
;; "test-runtime" expects XDG_RUNTIME_DIR to be set up
|
||||||
|
|
Reference in New Issue