summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/libnsl
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-05-21 22:00:29 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-05-25 23:59:32 +0100
commitd06896acf147f2a30a6943e394e588e128a5809f (patch)
tree776762291504a42c507db173aeca98a87b04d083 /meta/recipes-extended/libnsl
parent80c00910b8b250ad67e6eb3941d0c8fe56c0fe3f (diff)
downloadpoky-d06896acf147f2a30a6943e394e588e128a5809f.tar.gz
libnsl2: Add recipe
NIS functionality has been split out into independent library from glibc (From OE-Core rev: b73de31cbf58efb303006125f8cd22f130e21d8c) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/libnsl')
-rw-r--r--meta/recipes-extended/libnsl/libnsl2/0001-include-sys-cdefs.h-explicitly.patch68
-rw-r--r--meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch57
-rw-r--r--meta/recipes-extended/libnsl/libnsl2_git.bb35
3 files changed, 160 insertions, 0 deletions
diff --git a/meta/recipes-extended/libnsl/libnsl2/0001-include-sys-cdefs.h-explicitly.patch b/meta/recipes-extended/libnsl/libnsl2/0001-include-sys-cdefs.h-explicitly.patch
new file mode 100644
index 0000000000..c6c259adb8
--- /dev/null
+++ b/meta/recipes-extended/libnsl/libnsl2/0001-include-sys-cdefs.h-explicitly.patch
@@ -0,0 +1,68 @@
1From 508a0ff690dfebc17c4f55a5f81824ed549bed66 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 18 Apr 2017 09:13:33 -0700
4Subject: [PATCH 1/2] include sys/cdefs.h explicitly
5
6glibc includes this header indirectly but not musl
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10Upstream_status: Pending
11
12 src/rpcsvc/nis.h | 1 +
13 src/rpcsvc/nislib.h | 1 +
14 src/rpcsvc/ypclnt.h | 1 +
15 src/rpcsvc/ypupd.h | 1 +
16 4 files changed, 4 insertions(+)
17
18diff --git a/src/rpcsvc/nis.h b/src/rpcsvc/nis.h
19index 933c4d9..88cbca0 100644
20--- a/src/rpcsvc/nis.h
21+++ b/src/rpcsvc/nis.h
22@@ -32,6 +32,7 @@
23 #ifndef _RPCSVC_NIS_H
24 #define _RPCSVC_NIS_H 1
25
26+#include <sys/cdefs.h>
27 #include <features.h>
28 #include <rpc/rpc.h>
29 #include <rpcsvc/nis_tags.h>
30diff --git a/src/rpcsvc/nislib.h b/src/rpcsvc/nislib.h
31index a59c19b..a53fab3 100644
32--- a/src/rpcsvc/nislib.h
33+++ b/src/rpcsvc/nislib.h
34@@ -19,6 +19,7 @@
35 #ifndef __RPCSVC_NISLIB_H__
36 #define __RPCSVC_NISLIB_H__
37
38+#include <sys/cdefs.h>
39 #include <features.h>
40
41 __BEGIN_DECLS
42diff --git a/src/rpcsvc/ypclnt.h b/src/rpcsvc/ypclnt.h
43index fe43fd4..a686b61 100644
44--- a/src/rpcsvc/ypclnt.h
45+++ b/src/rpcsvc/ypclnt.h
46@@ -20,6 +20,7 @@
47 #ifndef __RPCSVC_YPCLNT_H__
48 #define __RPCSVC_YPCLNT_H__
49
50+#include <sys/cdefs.h>
51 #include <features.h>
52
53 /* Some defines */
54diff --git a/src/rpcsvc/ypupd.h b/src/rpcsvc/ypupd.h
55index d07fd4d..2c57301 100644
56--- a/src/rpcsvc/ypupd.h
57+++ b/src/rpcsvc/ypupd.h
58@@ -33,6 +33,7 @@
59 #ifndef __RPCSVC_YPUPD_H__
60 #define __RPCSVC_YPUPD_H__
61
62+#include <sys/cdefs.h>
63 #include <features.h>
64
65 #include <rpc/rpc.h>
66--
672.12.2
68
diff --git a/meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch b/meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch
new file mode 100644
index 0000000000..68d819c42c
--- /dev/null
+++ b/meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch
@@ -0,0 +1,57 @@
1From 60282514ea01af004d7f9e66dd3929223b7d2e7b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 18 Apr 2017 09:16:12 -0700
4Subject: [PATCH 2/2] Define glibc specific macros
5
6Check and define
7rawmemchr, __asprintf, __mempcpy, __strtok_r
8__always_inline, TEMP_FAILURE_RETRY
9
10if not existing. Helps compiling with musl
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14Upstream_status: Pending
15
16diff --git a/src/rpcsvc/nis.h b/src/rpcsvc/nis.h
17index 88cbca0..23fc20c 100644
18--- a/src/rpcsvc/nis.h
19+++ b/src/rpcsvc/nis.h
20@@ -57,6 +57,34 @@ __BEGIN_DECLS
21 * <kukuk@suse.de>
22 */
23
24+#ifndef rawmemchr
25+#define rawmemchr(s,c) memchr((s),(size_t)-1,(c))
26+#endif
27+
28+#ifndef __asprintf
29+#define __asprintf asprintf
30+#endif
31+
32+#ifndef __mempcpy
33+#define __mempcpy mempcpy
34+#endif
35+
36+#ifndef __strtok_r
37+#define __strtok_r strtok_r
38+#endif
39+
40+#ifndef __always_inline
41+#define __always_inline __attribute__((__always_inline__))
42+#endif
43+
44+#ifndef TEMP_FAILURE_RETRY
45+#define TEMP_FAILURE_RETRY(exp) ({ \
46+typeof (exp) _rc; \
47+ do { \
48+ _rc = (exp); \
49+ } while (_rc == -1 && errno == EINTR); \
50+ _rc; })
51+#endif
52
53 #ifndef __nis_object_h
54 #define __nis_object_h
55--
562.12.2
57
diff --git a/meta/recipes-extended/libnsl/libnsl2_git.bb b/meta/recipes-extended/libnsl/libnsl2_git.bb
new file mode 100644
index 0000000000..1698f69edb
--- /dev/null
+++ b/meta/recipes-extended/libnsl/libnsl2_git.bb
@@ -0,0 +1,35 @@
1# Copyright (C) 2017 Khem Raj <raj.khem@gmail.com>
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4SUMMARY = "Library containing NIS functions using TI-RPC (IPv6 enabled)"
5DESCRIPTION = "This library contains the public client interface for NIS(YP) and NIS+\
6 it was part of glibc and now is standalone packages. it also supports IPv6"
7HOMEPAGE = "https://github.com/thkukuk/libnsl"
8LICENSE = "LGPL-2.1"
9LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
10SECTION = "libs"
11DEPENDS = "libtirpc"
12DEPENDS_append_libc-musl = " bsd-headers"
13
14PV = "1.0.5+git${SRCPV}"
15
16SRCREV = "dfa2f313524aff9243c4d8ce1bace73786478356"
17
18SRC_URI = "git://github.com/thkukuk/libnsl \
19 file://0001-include-sys-cdefs.h-explicitly.patch \
20 file://0002-Define-glibc-specific-macros.patch \
21 "
22
23S = "${WORKDIR}/git"
24
25inherit autotools pkgconfig gettext
26
27EXTRA_OECONF += "--libdir=${libdir}/nsl --includedir=${includedir}/nsl"
28
29do_install_append() {
30 install -d ${D}${libdir}
31 mv ${D}${libdir}/nsl/pkgconfig ${D}${libdir}
32}
33
34FILES_${PN} += "${libdir}/nsl/*.so.*"
35FILES_${PN}-dev += "${includedir}/nsl ${libdir}/nsl/*.so"