Skip to content

Commit

Permalink
net-nds/ldapvi: Fix call to undeclared function on_exit
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/898066
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
  • Loading branch information
listout committed Jul 15, 2023
1 parent 4f6aa9d commit 524721b
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
32 changes: 32 additions & 0 deletions net-nds/ldapvi/files/ldapvi-1.7-fix-missing-on_exit-musl.patch
@@ -0,0 +1,32 @@
Use internal on_exit function as on_exit is not available on musl libc
Bug: https://bugs.gentoo.org/898066
--- a/common.h
+++ b/common.h
@@ -372,3 +372,7 @@ void sasl_defaults_free(tsasl_defaults *sd);
int ldapvi_sasl_interact(LDAP *ld, unsigned flags, void *defaults, void *p);

void fdcp(int fdsrc, int fddst);
+
+#ifndef HAVE_ON_EXIT
+int on_exit(void (*function)(int, void *), void *arg);
+#endif
--- a/parse.c
+++ b/parse.c
@@ -18,6 +18,7 @@
#define _XOPEN_SOURCE
#include <unistd.h>
#include <crypt.h>
+#include <stdio.h>
#include "common.h"

#define fast_g_string_append_c(gstring, c) \
--- a/port.c
+++ b/port.c
@@ -31,6 +31,7 @@
#include <unistd.h>

#include "config.h"
+#include "common.h"

#if defined(HAVE_OPENSSL)
#include <openssl/sha.h>
60 changes: 60 additions & 0 deletions net-nds/ldapvi/ldapvi-1.7_p20101214-r5.ebuild
@@ -0,0 +1,60 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit autotools

DESCRIPTION="Manage LDAP entries with a text editor"
HOMEPAGE="http://www.lichteblau.com/ldapvi/"
SRC_URI="mirror://gentoo/${P}.tar.bz2"
S="${WORKDIR}"/${P}/${PN}

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86"
IUSE="gnutls sasl"

RDEPEND="dev-libs/popt
dev-libs/glib:2
sys-libs/readline:=
sys-libs/ncurses:0=
virtual/libcrypt:=
gnutls? (
net-libs/gnutls
net-nds/openldap[gnutls]
)
!gnutls? (
dev-libs/openssl:0
net-nds/openldap[ssl]
)
sasl? ( dev-libs/cyrus-sasl:2[ssl] )"
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"

PATCHES=(
"${FILESDIR}/${PN}-1.7-fix-implicit-function-declarations.patch"
"${FILESDIR}/${PN}-1.7-fix-missing-on_exit-musl.patch"
)

src_prepare() {
default

# bug #459478
sed -i \
-e '/^AC_SEARCH_LIBS/s:curses ncurses:curses ncurses tinfo:' \
configure.in || die

eautoreconf
}

src_configure() {
econf \
--with-libcrypto=$(usex gnutls gnutls openssl)
}

src_install() {
dobin ldapvi
doman ldapvi.1
dodoc NEWS manual/{bg.png,html.xsl,manual.{css,xml}}
}

0 comments on commit 524721b

Please sign in to comment.