Github messages for voidlinux
 help / color / mirror / Atom feed
From: klarasm <klarasm@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] nss-pam-ldapd: build libnss_ldap.so.2 for musl
Date: Fri, 14 Jun 2024 15:11:29 +0200	[thread overview]
Message-ID: <20240614131129.45F7C224C4@inbox.vuxu.org> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-49070@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 929 bytes --]

There is an updated pull request by klarasm against master on the void-packages repository

https://github.com/klarasm/void-packages nss-pam-ldapd/musl
https://github.com/void-linux/void-packages/pull/49070

nss-pam-ldapd: build libnss_ldap.so.2 for musl
Don't disable nss in configure. Grab patch from Gentoo for defines missing in musl netdb.h. Disable netgroup_lookup test for musl.

Also remove -F flag in runit script for musl-nscd as it's not recognized.

Tested against my ldap servers and can confirm that it fetches the data defined by nsswitch.conf.

#### Testing the changes
- I tested the changes in this PR: **briefly**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-musl)
- I built this PR locally for these architectures:
  - aarch64-musl
  - armv7l
  - armv6l-musl


A patch file from https://github.com/void-linux/void-packages/pull/49070.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-nss-pam-ldapd/musl-49070.patch --]
[-- Type: text/x-diff, Size: 3757 bytes --]

From c142399607c5c5ac122603e4a3869deea96660a3 Mon Sep 17 00:00:00 2001
From: Klara Modin <klarasmodin@gmail.com>
Date: Mon, 4 Mar 2024 00:28:30 +0100
Subject: [PATCH 1/2] nss-pam-ldapd: build libnss_ldap.so for musl

Use patch from gentoo for missing define in netdb.h. Disable lookup_netgroup
test for musl which fails otherwise.
---
 .../nss-pam-ldapd-0.9.12-netdb-defines.patch  | 26 +++++++++++++++++++
 srcpkgs/nss-pam-ldapd/template                |  9 +++++--
 2 files changed, 33 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/nss-pam-ldapd/patches/nss-pam-ldapd-0.9.12-netdb-defines.patch

diff --git a/srcpkgs/nss-pam-ldapd/patches/nss-pam-ldapd-0.9.12-netdb-defines.patch b/srcpkgs/nss-pam-ldapd/patches/nss-pam-ldapd-0.9.12-netdb-defines.patch
new file mode 100644
index 00000000000000..1b43686c28e73e
--- /dev/null
+++ b/srcpkgs/nss-pam-ldapd/patches/nss-pam-ldapd-0.9.12-netdb-defines.patch
@@ -0,0 +1,26 @@
+Bug: https://bugs.gentoo.org/716272
+
+--- a/nss/hosts.c
++++ b/nss/hosts.c
+@@ -49,6 +49,9 @@
+   *h_errnop = NO_RECOVERY;                                                  \
+   return NSS_STATUS_UNAVAIL;
+
++#ifndef NETDB_INTERNAL
++#define NETDB_INTERNAL -1
++#endif
+ #undef ERROR_OUT_BUFERROR
+ #define ERROR_OUT_BUFERROR(fp)                                              \
+   *errnop = ERANGE;                                                         \
+--- a/nss/networks.c
++++ b/nss/networks.c
+@@ -49,6 +49,9 @@
+   *h_errnop = NO_RECOVERY;                                                  \
+   return NSS_STATUS_UNAVAIL;
+
++#ifndef NETDB_INTERNAL
++#define NETDB_INTERNAL -1
++#endif
+ #undef ERROR_OUT_BUFERROR
+ #define ERROR_OUT_BUFERROR(fp)                                              \
+   *errnop = ERANGE;                                                         \
diff --git a/srcpkgs/nss-pam-ldapd/template b/srcpkgs/nss-pam-ldapd/template
index 2b3a35ae85a334..83944593610ef4 100644
--- a/srcpkgs/nss-pam-ldapd/template
+++ b/srcpkgs/nss-pam-ldapd/template
@@ -1,7 +1,7 @@
 # Template file for 'nss-pam-ldapd'
 pkgname=nss-pam-ldapd
 version=0.9.12
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--enable-sasl --enable-kerberos --with-pam-seclib-dir=/usr/lib/security/"
 conf_files="/etc/nslcd.conf"
@@ -16,10 +16,15 @@ checksum=829b2371be42c040108165d2ea422eb6f6cacba6a01083f67025752a574a685b
 system_accounts="nslcd"
 
 case "$XBPS_TARGET_MACHINE" in
-	*musl) configure_args+=" --disable-nss";;
+	*musl) makedepends+=" musl-nscd-devel" ;;
 esac
 
 pre_configure() {
+	case "$XBPS_TARGET_MACHINE" in
+		*musl)
+			vsed -i 's/ lookup_netgroup / /' tests/Makefile.am
+			;;
+	esac
 	./autogen.sh
 }
 

From aed418e9ea698be43215251f973e23cdcbab8a45 Mon Sep 17 00:00:00 2001
From: Klara Modin <klarasmodin@gmail.com>
Date: Mon, 4 Mar 2024 00:34:35 +0100
Subject: [PATCH 2/2] musl-nscd: remove -F option in run file, not recognized

---
 srcpkgs/musl-nscd/files/nscd/run | 2 +-
 srcpkgs/musl-nscd/template       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/musl-nscd/files/nscd/run b/srcpkgs/musl-nscd/files/nscd/run
index 53127524af2b10..f1a5684daeb3fd 100755
--- a/srcpkgs/musl-nscd/files/nscd/run
+++ b/srcpkgs/musl-nscd/files/nscd/run
@@ -2,4 +2,4 @@
 exec 2>&1
 [ -r conf ] && . ./conf
 mkdir -p /var/run/nscd /var/db/nscd
-exec nscd -F ${OPTS} >/dev/null
+exec nscd ${OPTS} >/dev/null
diff --git a/srcpkgs/musl-nscd/template b/srcpkgs/musl-nscd/template
index 39a66105b222b2..f3bcbf9a8ac88d 100644
--- a/srcpkgs/musl-nscd/template
+++ b/srcpkgs/musl-nscd/template
@@ -1,7 +1,7 @@
 # Template file for 'musl-nscd'
 pkgname=musl-nscd
 version=1.1.1
-revision=1
+revision=2
 archs="*-musl"
 build_style=gnu-configure
 hostmakedepends="bison flex"

  parent reply	other threads:[~2024-06-14 13:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-03 23:52 [PR PATCH] " klarasm
2024-03-04  0:21 ` [PR PATCH] [Updated] " klarasm
2024-06-02  1:50 ` github-actions
2024-06-14 13:11 ` klarasm [this message]
2024-06-14 15:53 ` klarasm
2024-09-13  1:56 ` github-actions
2024-09-27  1:59 ` [PR PATCH] [Closed]: " github-actions
2024-09-27  2:01 ` [PR PATCH] [Merged]: " the-maldridge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240614131129.45F7C224C4@inbox.vuxu.org \
    --to=klarasm@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).