aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAric Belsito <lluixhi@gmail.com>2017-06-18 08:48:42 -0700
committerAric Belsito <lluixhi@gmail.com>2017-06-18 08:48:42 -0700
commit295f8291b2baa9ddae86f77c1eb69b8459154358 (patch)
tree33485fe7d7eb56e3b5465c05519c1940842d9eb1 /dev-libs
parentdev-util/valgrind: sync with upstream (diff)
downloadmusl-295f8291b2baa9ddae86f77c1eb69b8459154358.tar.gz
musl-295f8291b2baa9ddae86f77c1eb69b8459154358.tar.bz2
musl-295f8291b2baa9ddae86f77c1eb69b8459154358.zip
dev-libs/libbsd: version bump to 0.8.3-r2
refresh patches, remove r99 suffix
Diffstat (limited to 'dev-libs')
-rw-r--r--dev-libs/libbsd/Manifest11
-rw-r--r--dev-libs/libbsd/files/libbsd-0.8.2-fix-headers.patch44
-rw-r--r--dev-libs/libbsd/files/libbsd-0.8.2-musl.patch39
-rw-r--r--dev-libs/libbsd/files/libbsd-0.8.2-remore-funopen.patch33
-rw-r--r--dev-libs/libbsd/files/libbsd-0.8.2-replace__BEGIN_DECLS.patch323
-rw-r--r--dev-libs/libbsd/files/libbsd-0.8.3-cdefs.patch181
-rw-r--r--dev-libs/libbsd/files/libbsd-0.8.3-musl.patch27
-rw-r--r--dev-libs/libbsd/libbsd-0.8.2.ebuild (renamed from dev-libs/libbsd/libbsd-0.8.2-r99.ebuild)28
-rw-r--r--dev-libs/libbsd/libbsd-0.8.3-r2.ebuild49
-rw-r--r--dev-libs/libbsd/libbsd-0.8.3.ebuild47
10 files changed, 363 insertions, 419 deletions
diff --git a/dev-libs/libbsd/Manifest b/dev-libs/libbsd/Manifest
index 559bea35..c8c14598 100644
--- a/dev-libs/libbsd/Manifest
+++ b/dev-libs/libbsd/Manifest
@@ -1,6 +1,9 @@
-AUX libbsd-0.8.2-fix-headers.patch 1525 SHA256 3b23e44da0958b88eb6c6e510d8c2955380eb5d1029a8bbfd75d112aa411d96c SHA512 9f536ea8a528947069415b9208f7b573152d155bbd6dc180babdb9ec885f81e5d6dea2a04e4e47865fd66d37a1242ac801add077be364f0c0fccedefefe8f798 WHIRLPOOL 778293a18d2219d752759815b2abd5566c2aea470956432f09d61efb12d79d3895b93402865bf882f9bdc1ed549c387eeed916207ba59af42d5a02a8d773f510
-AUX libbsd-0.8.2-remore-funopen.patch 1243 SHA256 87271accf42ad6ea0f8d4c1a96ffc8bc6f55d0f73f0a6605738b270b35afd08b SHA512 2c593fbbe7f164c1b0d197cbad18a1d6645165cbd34064aebaf2c8c930dbe2aafbb15a6b7240d26eaae84606fef3ec672d1cefbc65c6f4d7d6a39971306becc9 WHIRLPOOL f35dd53c6c3a2f74b6e2ed9980e3f3795d29f2f5f5df0fae5c7d40df75d003e880263dc940ee1abdfa159c4d98fce1cbee7dcb57ebb6bb3b11227b7eb57494e9
-AUX libbsd-0.8.2-replace__BEGIN_DECLS.patch 9764 SHA256 afbb8973809150cdcbe3482fb71c99621c16347b293e590d36a4104391397809 SHA512 6afdad87ca30c624382223b1891b9073e5b65e791a85eeb9d1620e37106b4822bcf42a247184be3ead6576685cb74db23b2ce2c4965d272cb371a799eaf604f3 WHIRLPOOL 6ee85e38e9d7d40f2d650da250d99e99d82d340d768417cd0d0d6f6c77d85e49991d6903701bdb25fd83a9b161770177c2af218fe598f7b02665489181fec14e
+AUX libbsd-0.8.2-musl.patch 1160 SHA256 9960810bd2c2173ef56d3c40bd3c07b88d278fadbce6c533e83d5baffd673174 SHA512 1a5db0e4cb1a46b92d5415562246df66017b0daf3cf7d208c98a4da09e6277ae97ab7783310a410e8d93496a8698a6b279c7a2c48d74e433b494f938f0cd018f WHIRLPOOL 3dfdbb90333dad189335520cbdd698ce071d2a33e5e4a5289edd72d91155e5f75975ffac7f41699a4bd4ce0271f568b4568daa4a71334dc18d8d0e3dad89f7a6
+AUX libbsd-0.8.3-cdefs.patch 6102 SHA256 52c3453e878a7a4aad76977e40bafb82a59ddde217089fcfec9e92e54cdd7572 SHA512 924021930911012441414b077541b18ad68a283568dbc45bd27ab734e868cf1fefb59d8aa2f75bea7c8fe100169426c2c885d8da3e88456e946725897890e5e2 WHIRLPOOL 4ef017c98f6b30207e25bf677c37b7729208393beb9066ca3fd19057b65fd87fc4ed6aee031f578f3482ae536384690d1872f64a9357cafb9b336e43950d8c2e
+AUX libbsd-0.8.3-musl.patch 784 SHA256 9d8955d027719eb9d8209b9ebf3fc142b70d6185d32bb89d28a82b6143b3718e SHA512 7f8147a60c3d5dd62757045df67e13c7a09e9fbc1c96b457adf4efa77f6f3271be72d9f0fe1bfbccd0bc2eaf1502eed039030ef5ad53f2e30a7fa28b4e988d77 WHIRLPOOL 3c27788198ee7ede664ad9b095e15c83bdfe0f26b822a63dd79709837b92eb63929ac184449ec8fc72d71424c7c3fa9eb3371610e922248653b999010151bfe1
DIST libbsd-0.8.2.tar.xz 344292 SHA256 b2f644cae94a6e2fe109449c20ad79a0f6ee4faec2205b07eefa0020565e250a SHA512 2230d51a30a0c3a8518c7e325036d2b578c8c2b47525c2d0d5f530d28d82227ad48b50341e44521db21f99208fe7c0df7313254c90e3c92da1c8664a8cbb87c5 WHIRLPOOL 4f9b09aaa7c0775cd46bf0aaaba9e9a7f07040262739002bf3966aace3bb4d782f96b176e2c489e7d7cbc0840eecc463a414dee1b5c92414c9a821796d739290
-EBUILD libbsd-0.8.2-r99.ebuild 1268 SHA256 a74971fd7df08e64944b25c91fdc951d3d5c9c4297af4650e04385c8da69675c SHA512 0c9cbd722111b40d2260695431175ddc1583a98a6c103d0d048f46a1f36550335dffe604cb0cc73fc9d21887a92d092cc6f1a7bc738708371033d5cdb22b1567 WHIRLPOOL 4002f15ada0f76029b3fd0dd67f586174392a4f1412e855f1c0da6cf0a198f0afae1492637db6404586b062534874a8cc520055e940196299947208983eda8e2
+DIST libbsd-0.8.3.tar.xz 356772 SHA256 934b634f4dfd865b6482650b8f522c70ae65c463529de8be907b53c89c3a34a8 SHA512 155b895d6bd62b180718d65a2cda7484946c492d52735a57b51005705dfe4528b6a72e8745acea47b01fe68e3bbbe3c036c5e9998a8d06fc79efe2b96a04767f WHIRLPOOL ab74a85813ea3308e7e4c53b7a46f4b93e4dff4d091964a6347f9960729e8eb4c8a2a0866938de508caf47caf9371f14499fcb0cc4aa30da06f501f4ccad9ef2
+EBUILD libbsd-0.8.2.ebuild 1235 SHA256 3bd39fb377334b96185a7b7022eab7e80a5b635ccaebf4a464a6dc020c2dddd6 SHA512 8101da8fb30a3fd3cbbbbb52c2a85c3537f743aba670b4917f2e6e7d29ef946ecabb8031f97b847752a6d48d58dacba0f4aeac1402a271f0b93a32ed05f60f4d WHIRLPOOL ac583480897e075e68d6a076a322792914896b7e00ae4a2e161b47cbe5a26642b4e84fc84ca69219d3d1c6069832bdb89101c65e29a28cdc08d36f0c203ca664
+EBUILD libbsd-0.8.3-r2.ebuild 1367 SHA256 88530ca86520693d45e2ba1f518c5a78ab30e01ea6305e6954e5def7294142f8 SHA512 b103da5c43a6c4ae5b8b9f4448d304fcb34265249af2ee986a6b3e52bb8e587b3aa9b4d5bdcd40871d6e09b703898fb0777748bff084622826743f9f671401c7 WHIRLPOOL 4244b6f7bb3ba49d7163f617bd8577ae2c4081f53420f19b991bfcbf40b33b48f108cb874882700d159fe605027595faddaff88ca07799cc156e5c5927bb06bb
+EBUILD libbsd-0.8.3.ebuild 1276 SHA256 e2d7c73ffaa1eae5bfee67693183100c346db5adb2841ac63ac30acd114ca104 SHA512 9051d6869bebaad74992aafc54d60551d3829ed9bd8ec59838fc2602138f40361ec92d56f818f7f537f0b90d56c5d4506c96f89d7689f29548d40896910da94a WHIRLPOOL 608370f87e1d265a6fddf65d53c4ca0217b34d5686daecf2bc6eafae35aaa11dad46850ece56567a2107d3818ada680c3c3682c98a86047d6678fb68d18ca725
MISC metadata.xml 276 SHA256 6bb81cdb026b199d78fb2a2327320a915a3bd241a9300bb069bd9c998521f613 SHA512 673180ba375ea401c0a8f197d516417b3f9361b11943c71bac88b0d0b1407b0bc657f5763c6fb6e429cc6ee112869a2247083fe56743e9ce918855c0ea929e59 WHIRLPOOL d494386e01171fe51879cf968a6cebca04c22477f3b8a52bfdd17b9ee06afd99c3979396f7abf40bee698d6fbb060e2f37e083cb3ed010c018d84211a2bc7cd0
diff --git a/dev-libs/libbsd/files/libbsd-0.8.2-fix-headers.patch b/dev-libs/libbsd/files/libbsd-0.8.2-fix-headers.patch
deleted file mode 100644
index 890c690f..00000000
--- a/dev-libs/libbsd/files/libbsd-0.8.2-fix-headers.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/sys/cdefs.h libbsd-0.8.2/include/bsd/sys/cdefs.h
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/sys/cdefs.h 2015-09-23 05:59:27.000000000 +0000
-+++ libbsd-0.8.2/include/bsd/sys/cdefs.h 2016-04-04 22:04:30.264000000 +0000
-@@ -24,11 +24,13 @@
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-+/*
- #ifdef LIBBSD_OVERLAY
- #include_next <sys/cdefs.h>
- #else
- #include <sys/cdefs.h>
- #endif
-+*/
-
- #ifndef LIBBSD_SYS_CDEFS_H
- #define LIBBSD_SYS_CDEFS_H
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/src/flopen.c libbsd-0.8.2/src/flopen.c
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/src/flopen.c 2011-07-05 16:56:44.000000000 +0000
-+++ libbsd-0.8.2/src/flopen.c 2016-04-04 23:46:26.120000000 +0000
-@@ -35,6 +35,7 @@
- #include <stdarg.h>
- #include <unistd.h>
- #include <libutil.h>
-+#include <fcntl.h>
-
- int
- flopen(const char *path, int flags, ...)
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/src/nlist.c libbsd-0.8.2/src/nlist.c
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/src/nlist.c 2015-09-23 05:59:34.000000000 +0000
-+++ libbsd-0.8.2/src/nlist.c 2016-04-05 00:22:48.056000000 +0000
-@@ -39,10 +39,11 @@
- #include <arpa/inet.h>
-
- #include <errno.h>
--#include <a.out.h>
-+#include <linux/a.out.h>
- #include <stdio.h>
- #include <string.h>
- #include <unistd.h>
-+#include <fcntl.h>
-
- #if !defined(__NO_A_OUT_SUPPORT)
- #define _NLIST_DO_AOUT
diff --git a/dev-libs/libbsd/files/libbsd-0.8.2-musl.patch b/dev-libs/libbsd/files/libbsd-0.8.2-musl.patch
new file mode 100644
index 00000000..bc1f1e75
--- /dev/null
+++ b/dev-libs/libbsd/files/libbsd-0.8.2-musl.patch
@@ -0,0 +1,39 @@
+diff -Naur libbsd-0.8.2.orig/src/flopen.c libbsd-0.8.2/src/flopen.c
+--- libbsd-0.8.2.orig/src/flopen.c 2011-07-05 09:56:44.000000000 -0700
++++ libbsd-0.8.2/src/flopen.c 2016-02-06 17:45:19.491982943 -0800
+@@ -32,6 +32,7 @@
+ #include <sys/stat.h>
+
+ #include <errno.h>
++#include <fcntl.h>
+ #include <stdarg.h>
+ #include <unistd.h>
+ #include <libutil.h>
+diff -Naur libbsd-0.8.2.orig/src/funopen.c libbsd-0.8.2/src/funopen.c
+--- libbsd-0.8.2.orig/src/funopen.c 2015-09-22 10:56:09.000000000 -0700
++++ libbsd-0.8.2/src/funopen.c 2016-02-06 17:45:38.954982595 -0800
+@@ -137,6 +137,4 @@
+
+ return fopencookie(cookiewrap, mode, funcswrap);
+ }
+-#else
+-#error "Function funopen() needs to be ported."
+ #endif
+diff -Naur libbsd-0.8.2.orig/src/nlist.c libbsd-0.8.2/src/nlist.c
+--- libbsd-0.8.2.orig/src/nlist.c 2015-09-22 22:59:34.000000000 -0700
++++ libbsd-0.8.2/src/nlist.c 2016-02-06 17:46:01.065982199 -0800
+@@ -39,11 +39,13 @@
+ #include <arpa/inet.h>
+
+ #include <errno.h>
+-#include <a.out.h>
++#include <fcntl.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+
++#include "nlist.h"
++
+ #if !defined(__NO_A_OUT_SUPPORT)
+ #define _NLIST_DO_AOUT
+ #endif
diff --git a/dev-libs/libbsd/files/libbsd-0.8.2-remore-funopen.patch b/dev-libs/libbsd/files/libbsd-0.8.2-remore-funopen.patch
deleted file mode 100644
index 0da444da..00000000
--- a/dev-libs/libbsd/files/libbsd-0.8.2-remore-funopen.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/man/Makefile.am libbsd-0.8.2/man/Makefile.am
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/man/Makefile.am 2015-11-30 22:48:50.000000000 +0000
-+++ libbsd-0.8.2/man/Makefile.am 2016-04-05 00:23:52.848000000 +0000
-@@ -29,7 +29,6 @@
- flopen.3 \
- fmtcheck.3 \
- fparseln.3 \
-- funopen.3bsd \
- getbsize.3 \
- getmode.3 \
- getpeereid.3 \
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/src/Makefile.am libbsd-0.8.2/src/Makefile.am
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/src/Makefile.am 2015-12-14 02:34:40.000000000 +0000
-+++ libbsd-0.8.2/src/Makefile.am 2016-04-05 00:14:59.360000000 +0000
-@@ -74,7 +74,6 @@
- fmtcheck.c \
- fparseln.c \
- fpurge.c \
-- funopen.c \
- getbsize.c \
- getpeereid.c \
- hash/md5.c \
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/test/Makefile.am libbsd-0.8.2/test/Makefile.am
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/test/Makefile.am 2015-12-14 02:34:40.000000000 +0000
-+++ libbsd-0.8.2/test/Makefile.am 2016-04-05 00:24:03.592000000 +0000
-@@ -36,7 +36,6 @@
- endian \
- humanize \
- fgetln \
-- funopen \
- fparseln \
- fpurge \
- proctitle-init \
diff --git a/dev-libs/libbsd/files/libbsd-0.8.2-replace__BEGIN_DECLS.patch b/dev-libs/libbsd/files/libbsd-0.8.2-replace__BEGIN_DECLS.patch
deleted file mode 100644
index 38fcb45c..00000000
--- a/dev-libs/libbsd/files/libbsd-0.8.2-replace__BEGIN_DECLS.patch
+++ /dev/null
@@ -1,323 +0,0 @@
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/err.h libbsd-0.8.2/include/bsd/err.h
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/err.h 2015-12-13 23:58:51.000000000 +0000
-+++ libbsd-0.8.2/include/bsd/err.h 2016-04-04 23:37:30.448000000 +0000
-@@ -42,7 +42,10 @@
-
- #include <stdarg.h>
-
--__BEGIN_DECLS
-+/* __BEGIN_DECLS */
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- void warnc(int code, const char *format, ...)
- __printflike(2, 3);
- void vwarnc(int code, const char *format, va_list ap)
-@@ -51,6 +54,9 @@
- __printflike(3, 4);
- void verrc(int status, int code, const char *format, va_list ap)
- __printflike(3, 0);
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+/* __END_DECLS */
-
- #endif
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/libutil.h libbsd-0.8.2/include/bsd/libutil.h
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/libutil.h 2015-09-22 17:56:09.000000000 +0000
-+++ libbsd-0.8.2/include/bsd/libutil.h 2016-04-04 23:37:42.336000000 +0000
-@@ -53,7 +53,10 @@
- ino_t pf_ino;
- };
-
--__BEGIN_DECLS
-+/* __BEGIN_DECLS */
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- int humanize_number(char *buf, size_t len, int64_t bytes,
- const char *suffix, int scale, int flags);
- int expand_number(const char *_buf, uint64_t *_num);
-@@ -66,7 +69,10 @@
- int pidfile_remove(struct pidfh *pfh);
-
- char *fparseln(FILE *, size_t *, size_t *, const char[3], int);
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+/* __END_DECLS */
-
- /* humanize_number(3) */
- #define HN_DECIMAL 0x01
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/md5.h libbsd-0.8.2/include/bsd/md5.h
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/md5.h 2015-12-13 23:58:59.000000000 +0000
-+++ libbsd-0.8.2/include/bsd/md5.h 2016-04-04 23:37:50.496000000 +0000
-@@ -30,7 +30,10 @@
- #include <sys/cdefs.h>
- #include <sys/types.h>
-
--__BEGIN_DECLS
-+/* __BEGIN_DECLS */
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- void MD5Init(MD5_CTX *);
- void MD5Update(MD5_CTX *, const uint8_t *, size_t)
- __attribute__((__bounded__(__string__,2,3)));
-@@ -49,6 +52,9 @@
- char *MD5Data(const uint8_t *, size_t, char *)
- __attribute__((__bounded__(__string__,1,2)))
- __attribute__((__bounded__(__minbytes__,3,MD5_DIGEST_STRING_LENGTH)));
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+/* __END_DECLS */
-
- #endif /* _MD5_H_ */
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/nlist.h libbsd-0.8.2/include/bsd/nlist.h
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/nlist.h 2015-09-22 17:56:09.000000000 +0000
-+++ libbsd-0.8.2/include/bsd/nlist.h 2016-04-04 22:47:44.656000000 +0000
-@@ -30,8 +30,14 @@
- #include <sys/cdefs.h>
- #include <a.out.h>
-
--__BEGIN_DECLS
-+/* __BEGIN_DECLS */
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- extern int nlist(const char *filename, struct nlist *list);
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+/* __END_DECLS */
-
- #endif
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/readpassphrase.h libbsd-0.8.2/include/bsd/readpassphrase.h
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/readpassphrase.h 2011-07-05 18:58:44.000000000 +0000
-+++ libbsd-0.8.2/include/bsd/readpassphrase.h 2016-04-04 23:38:19.276000000 +0000
-@@ -34,8 +34,14 @@
- #include <sys/cdefs.h>
- #include <sys/types.h>
-
--__BEGIN_DECLS
-+/* __BEGIN_DECLS */
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- char * readpassphrase(const char *, char *, size_t, int);
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+/* __END_DECLS */
-
- #endif /* !_READPASSPHRASE_H_ */
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/stdio.h libbsd-0.8.2/include/bsd/stdio.h
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/stdio.h 2015-09-23 05:59:34.000000000 +0000
-+++ libbsd-0.8.2/include/bsd/stdio.h 2016-04-04 23:38:34.016000000 +0000
-@@ -41,7 +41,10 @@
- #include <sys/cdefs.h>
- #include <sys/types.h>
-
--__BEGIN_DECLS
-+/* __BEGIN_DECLS */
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- const char *fmtcheck(const char *, const char *);
-
- /* XXX: The function requires cooperation from the system libc to store the
-@@ -69,7 +72,10 @@
- #define fwopen(cookie, fn) funopen(cookie, NULL, fn, NULL, NULL)
-
- int fpurge(FILE *fp);
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+/* __END_DECLS */
-
- #endif
- #endif
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/stdlib.h libbsd-0.8.2/include/bsd/stdlib.h
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/stdlib.h 2015-09-23 05:14:21.000000000 +0000
-+++ libbsd-0.8.2/include/bsd/stdlib.h 2016-04-04 23:38:46.384000000 +0000
-@@ -46,7 +46,10 @@
- #include <sys/stat.h>
- #include <stdint.h>
-
--__BEGIN_DECLS
-+/* __BEGIN_DECLS */
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- uint32_t arc4random(void);
- void arc4random_stir(void);
- void arc4random_addrandom(u_char *dat, int datlen);
-@@ -73,6 +76,9 @@
- const char **errstr);
-
- char *getbsize(int *headerlenp, long *blocksizep);
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+/* __END_DECLS */
-
- #endif
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/string.h libbsd-0.8.2/include/bsd/string.h
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/string.h 2015-09-24 03:30:23.000000000 +0000
-+++ libbsd-0.8.2/include/bsd/string.h 2016-04-04 23:39:00.040000000 +0000
-@@ -36,13 +36,19 @@
- #include <sys/cdefs.h>
- #include <sys/types.h>
-
--__BEGIN_DECLS
-+/* __BEGIN_DECLS */
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- size_t strlcpy(char *dst, const char *src, size_t siz);
- size_t strlcat(char *dst, const char *src, size_t siz);
- char *strnstr(const char *str, const char *find, size_t str_len);
- void strmode(mode_t mode, char *str);
-
- void explicit_bzero(void *buf, size_t len);
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+/* __END_DECLS */
-
- #endif
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/stringlist.h libbsd-0.8.2/include/bsd/stringlist.h
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/stringlist.h 2015-09-22 17:56:09.000000000 +0000
-+++ libbsd-0.8.2/include/bsd/stringlist.h 2016-04-04 23:39:08.168000000 +0000
-@@ -43,12 +43,18 @@
- size_t sl_cur;
- } StringList;
-
--__BEGIN_DECLS
-+/* __BEGIN_DECLS */
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- StringList *sl_init(void);
- int sl_add(StringList *, char *);
- void sl_free(StringList *, int);
- char *sl_find(StringList *, const char *);
- int sl_delete(StringList *, const char *, int);
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+/* __END_DECLS */
-
- #endif /* _STRINGLIST_H */
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/unistd.h libbsd-0.8.2/include/bsd/unistd.h
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/unistd.h 2015-12-13 23:58:51.000000000 +0000
-+++ libbsd-0.8.2/include/bsd/unistd.h 2016-04-04 23:39:19.816000000 +0000
-@@ -45,7 +45,10 @@
- #define S_ISTXT S_ISVTX
- #endif
-
--__BEGIN_DECLS
-+/* __BEGIN_DECLS */
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- extern int optreset;
-
- #ifdef LIBBSD_OVERLAY
-@@ -68,6 +71,9 @@
- __printflike(1, 2);
-
- int getpeereid(int s, uid_t *euid, gid_t *egid);
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+/* __END_DECLS */
-
- #endif
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/vis.h libbsd-0.8.2/include/bsd/vis.h
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/vis.h 2011-07-05 18:58:44.000000000 +0000
-+++ libbsd-0.8.2/include/bsd/vis.h 2016-04-04 23:39:28.360000000 +0000
-@@ -74,7 +74,10 @@
-
- #include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+/* __BEGIN_DECLS */
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- char *vis(char *, int, int, int);
- int strvis(char *, const char *, int);
- int strvisx(char *, const char *, size_t, int);
-@@ -83,6 +86,9 @@
- int strunvisx(char *, const char *, int);
- ssize_t strnunvis(char *, const char *, size_t);
- int unvis(char *, int, int *, int);
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+/* __END_DECLS */
-
- #endif /* !_VIS_H_ */
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/wchar.h libbsd-0.8.2/include/bsd/wchar.h
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/include/bsd/wchar.h 2015-09-22 17:56:09.000000000 +0000
-+++ libbsd-0.8.2/include/bsd/wchar.h 2016-04-04 23:39:35.656000000 +0000
-@@ -43,12 +43,18 @@
- #include <sys/cdefs.h>
- #include <sys/types.h>
-
--__BEGIN_DECLS
-+/* __BEGIN_DECLS */
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- wchar_t *fgetwln(FILE *stream, size_t *len);
-
- size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
- size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size);
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+/* __END_DECLS */
-
- #endif
- #endif
-diff -Naur /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/src/hash/sha512.h libbsd-0.8.2/src/hash/sha512.h
---- /var/tmp/portage/dev-libs/libbsd-0.8.2/work/libbsd-0.8.2/src/hash/sha512.h 2015-12-01 02:35:17.000000000 +0000
-+++ libbsd-0.8.2/src/hash/sha512.h 2016-04-05 00:17:13.576000000 +0000
-@@ -39,7 +39,10 @@
- unsigned char buf[128];
- } SHA512_CTX;
-
--__BEGIN_DECLS
-+/* __BEGIN_DECLS */
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- void SHA512_Init(SHA512_CTX *);
- void SHA512_Update(SHA512_CTX *, const void *, size_t);
-@@ -48,6 +51,9 @@
- char *SHA512_File(const char *, char *);
- char *SHA512_FileChunk(const char *, char *, off_t, off_t);
- char *SHA512_Data(const void *, unsigned int, char *);
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+/* __END_DECLS */
-
- #endif /* !_SHA512_H_ */
diff --git a/dev-libs/libbsd/files/libbsd-0.8.3-cdefs.patch b/dev-libs/libbsd/files/libbsd-0.8.3-cdefs.patch
new file mode 100644
index 00000000..e11cad67
--- /dev/null
+++ b/dev-libs/libbsd/files/libbsd-0.8.3-cdefs.patch
@@ -0,0 +1,181 @@
+diff -Naur libbsd-0.8.3.orig/include/bsd/libutil.h libbsd-0.8.3/include/bsd/libutil.h
+--- libbsd-0.8.3.orig/include/bsd/libutil.h 2016-08-10 13:54:09.060111735 -0700
++++ libbsd-0.8.3/include/bsd/libutil.h 2016-08-10 13:54:23.477266978 -0700
+@@ -40,7 +40,7 @@
+ #define _LIBUTIL_H_
+
+ #include <features.h>
+-#include <sys/cdefs.h>
++#include "sys/cdefs.h"
+ #include <sys/types.h>
+ #include <stdint.h>
+ #include <stdio.h>
+diff -Naur libbsd-0.8.3.orig/include/bsd/md5.h libbsd-0.8.3/include/bsd/md5.h
+--- libbsd-0.8.3.orig/include/bsd/md5.h 2016-08-10 13:54:09.060111735 -0700
++++ libbsd-0.8.3/include/bsd/md5.h 2016-08-10 13:58:16.336688012 -0700
+@@ -27,7 +27,7 @@
+ uint8_t buffer[MD5_BLOCK_LENGTH]; /* input buffer */
+ } MD5_CTX;
+
+-#include <sys/cdefs.h>
++#include "sys/cdefs.h"
+ #include <sys/types.h>
+
+ __BEGIN_DECLS
+diff -Naur libbsd-0.8.3.orig/include/bsd/nlist.h libbsd-0.8.3/include/bsd/nlist.h
+--- libbsd-0.8.3.orig/include/bsd/nlist.h 2016-08-10 13:54:09.060111735 -0700
++++ libbsd-0.8.3/include/bsd/nlist.h 2016-08-10 13:54:42.174468307 -0700
+@@ -27,8 +27,8 @@
+ #ifndef LIBBSD_NLIST_H
+ #define LIBBSD_NLIST_H
+
+-#include <sys/cdefs.h>
+-#include <a.out.h>
++#include "sys/cdefs.h"
++#include <linux/a.out.h>
+
+ __BEGIN_DECLS
+ extern int nlist(const char *filename, struct nlist *list);
+diff -Naur libbsd-0.8.3.orig/include/bsd/readpassphrase.h libbsd-0.8.3/include/bsd/readpassphrase.h
+--- libbsd-0.8.3.orig/include/bsd/readpassphrase.h 2016-08-10 13:54:09.057111703 -0700
++++ libbsd-0.8.3/include/bsd/readpassphrase.h 2016-08-10 13:55:12.343793168 -0700
+@@ -31,7 +31,7 @@
+ #define RPP_SEVENBIT 0x10 /* Strip the high bit from input. */
+ #define RPP_STDIN 0x20 /* Read from stdin, not /dev/tty */
+
+-#include <sys/cdefs.h>
++#include "sys/cdefs.h"
+ #include <sys/types.h>
+
+ __BEGIN_DECLS
+diff -Naur libbsd-0.8.3.orig/include/bsd/stdio.h libbsd-0.8.3/include/bsd/stdio.h
+--- libbsd-0.8.3.orig/include/bsd/stdio.h 2016-08-10 13:54:09.057111703 -0700
++++ libbsd-0.8.3/include/bsd/stdio.h 2016-08-10 13:55:28.476966889 -0700
+@@ -38,7 +38,7 @@
+ #ifndef LIBBSD_STDIO_H
+ #define LIBBSD_STDIO_H
+
+-#include <sys/cdefs.h>
++#include "sys/cdefs.h"
+ #include <sys/types.h>
+
+ __BEGIN_DECLS
+diff -Naur libbsd-0.8.3.orig/include/bsd/stdlib.h libbsd-0.8.3/include/bsd/stdlib.h
+--- libbsd-0.8.3.orig/include/bsd/stdlib.h 2016-08-10 13:54:09.059111724 -0700
++++ libbsd-0.8.3/include/bsd/stdlib.h 2016-08-10 13:55:45.418149310 -0700
+@@ -42,7 +42,7 @@
+ #ifndef LIBBSD_STDLIB_H
+ #define LIBBSD_STDLIB_H
+
+-#include <sys/cdefs.h>
++#include "sys/cdefs.h"
+ #include <sys/stat.h>
+ #include <stdint.h>
+
+diff -Naur libbsd-0.8.3.orig/include/bsd/string.h libbsd-0.8.3/include/bsd/string.h
+--- libbsd-0.8.3.orig/include/bsd/string.h 2016-08-10 13:54:09.059111724 -0700
++++ libbsd-0.8.3/include/bsd/string.h 2016-08-10 13:55:58.746292826 -0700
+@@ -33,7 +33,7 @@
+ #ifndef LIBBSD_STRING_H
+ #define LIBBSD_STRING_H
+
+-#include <sys/cdefs.h>
++#include "sys/cdefs.h"
+ #include <sys/types.h>
+
+ __BEGIN_DECLS
+diff -Naur libbsd-0.8.3.orig/include/bsd/stringlist.h libbsd-0.8.3/include/bsd/stringlist.h
+--- libbsd-0.8.3.orig/include/bsd/stringlist.h 2016-08-10 13:54:09.059111724 -0700
++++ libbsd-0.8.3/include/bsd/stringlist.h 2016-08-10 13:56:10.166408777 -0700
+@@ -31,7 +31,7 @@
+
+ #ifndef _STRINGLIST_H
+ #define _STRINGLIST_H
+-#include <sys/cdefs.h>
++#include "sys/cdefs.h"
+ #include <sys/types.h>
+
+ /*
+diff -Naur libbsd-0.8.3.orig/include/bsd/sys/cdefs.h libbsd-0.8.3/include/bsd/sys/cdefs.h
+--- libbsd-0.8.3.orig/include/bsd/sys/cdefs.h 2016-08-10 13:54:09.059111724 -0700
++++ libbsd-0.8.3/include/bsd/sys/cdefs.h 2016-08-10 14:01:27.929630564 -0700
+@@ -24,11 +24,19 @@
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#if defined(__GLIBC__) || !defined(__linux__)
+ #ifdef LIBBSD_OVERLAY
+ #include_next <sys/cdefs.h>
+ #else
+ #include <sys/cdefs.h>
+ #endif
++#elif defined(__cplusplus)
++#define __BEGIN_DECLS extern "C" {
++#define __END_DECLS }
++#else
++#define __BEGIN_DECLS
++#define __END_DECLS
++#endif
+
+ #ifndef LIBBSD_SYS_CDEFS_H
+ #define LIBBSD_SYS_CDEFS_H
+diff -Naur libbsd-0.8.3.orig/include/bsd/sys/queue.h libbsd-0.8.3/include/bsd/sys/queue.h
+--- libbsd-0.8.3.orig/include/bsd/sys/queue.h 2016-08-10 13:54:09.058111714 -0700
++++ libbsd-0.8.3/include/bsd/sys/queue.h 2016-08-10 14:00:18.062922188 -0700
+@@ -33,7 +33,7 @@
+ #ifndef _SYS_QUEUE_H_
+ #define _SYS_QUEUE_H_
+
+-#include <sys/cdefs.h>
++#include "cdefs.h"
+
+ /*
+ * This file defines four types of data structures: singly-linked lists,
+diff -Naur libbsd-0.8.3.orig/include/bsd/sys/tree.h libbsd-0.8.3/include/bsd/sys/tree.h
+--- libbsd-0.8.3.orig/include/bsd/sys/tree.h 2016-08-10 13:54:09.059111724 -0700
++++ libbsd-0.8.3/include/bsd/sys/tree.h 2016-08-10 14:00:05.587795704 -0700
+@@ -30,7 +30,7 @@
+ #ifndef _SYS_TREE_H_
+ #define _SYS_TREE_H_
+
+-#include <sys/cdefs.h>
++#include "cdefs.h"
+
+ /*
+ * This file defines data structures for different types of trees:
+diff -Naur libbsd-0.8.3.orig/include/bsd/timeconv.h libbsd-0.8.3/include/bsd/timeconv.h
+--- libbsd-0.8.3.orig/include/bsd/timeconv.h 2016-08-10 13:54:09.057111703 -0700
++++ libbsd-0.8.3/include/bsd/timeconv.h 2016-08-10 13:56:26.952578971 -0700
+@@ -41,7 +41,7 @@
+ #ifndef _TIMECONV_H_
+ #define _TIMECONV_H_
+
+-#include <sys/cdefs.h>
++#include "sys/cdefs.h"
+ #include <stdint.h>
+ #include <time.h>
+
+diff -Naur libbsd-0.8.3.orig/include/bsd/vis.h libbsd-0.8.3/include/bsd/vis.h
+--- libbsd-0.8.3.orig/include/bsd/vis.h 2016-08-10 13:54:09.059111724 -0700
++++ libbsd-0.8.3/include/bsd/vis.h 2016-08-10 13:56:53.115844239 -0700
+@@ -72,7 +72,7 @@
+ */
+ #define UNVIS_END 1 /* no more characters */
+
+-#include <sys/cdefs.h>
++#include "sys/cdefs.h"
+
+ __BEGIN_DECLS
+ char *vis(char *, int, int, int);
+diff -Naur libbsd-0.8.3.orig/include/bsd/wchar.h libbsd-0.8.3/include/bsd/wchar.h
+--- libbsd-0.8.3.orig/include/bsd/wchar.h 2016-08-10 13:54:09.058111714 -0700
++++ libbsd-0.8.3/include/bsd/wchar.h 2016-08-10 13:57:03.455949077 -0700
+@@ -40,7 +40,7 @@
+ #define LIBBSD_WCHAR_H
+
+ #include <stddef.h>
+-#include <sys/cdefs.h>
++#include "sys/cdefs.h"
+ #include <sys/types.h>
+
+ __BEGIN_DECLS
diff --git a/dev-libs/libbsd/files/libbsd-0.8.3-musl.patch b/dev-libs/libbsd/files/libbsd-0.8.3-musl.patch
new file mode 100644
index 00000000..2833cdb1
--- /dev/null
+++ b/dev-libs/libbsd/files/libbsd-0.8.3-musl.patch
@@ -0,0 +1,27 @@
+diff -Naur libbsd-0.8.3.orig/src/funopen.c libbsd-0.8.3/src/funopen.c
+--- libbsd-0.8.3.orig/src/funopen.c 2016-08-10 13:54:09.064111778 -0700
++++ libbsd-0.8.3/src/funopen.c 2016-08-10 14:02:55.416520029 -0700
+@@ -137,6 +137,4 @@
+
+ return fopencookie(cookiewrap, mode, funcswrap);
+ }
+-#else
+-#error "Function funopen() needs to be ported."
+ #endif
+diff -Naur libbsd-0.8.3.orig/src/nlist.c libbsd-0.8.3/src/nlist.c
+--- libbsd-0.8.3.orig/src/nlist.c 2016-08-10 13:54:09.063111767 -0700
++++ libbsd-0.8.3/src/nlist.c 2016-08-10 14:03:35.312927245 -0700
+@@ -40,11 +40,12 @@
+
+ #include <errno.h>
+ #include <fcntl.h>
+-#include <a.out.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+
++#include "nlist.h"
++
+ #if !defined(__NO_A_OUT_SUPPORT)
+ #define _NLIST_DO_AOUT
+ #endif
diff --git a/dev-libs/libbsd/libbsd-0.8.2-r99.ebuild b/dev-libs/libbsd/libbsd-0.8.2.ebuild
index 48e46771..4204854a 100644
--- a/dev-libs/libbsd/libbsd-0.8.2-r99.ebuild
+++ b/dev-libs/libbsd/libbsd-0.8.2.ebuild
@@ -1,19 +1,26 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Id$
EAPI=5
-inherit autotools eutils multilib-minimal
+inherit eutils multilib-minimal
DESCRIPTION="An library to provide useful functions commonly found on BSD systems"
-HOMEPAGE="http://libbsd.freedesktop.org/wiki/"
-SRC_URI="http://${PN}.freedesktop.org/releases/${P}.tar.xz"
+HOMEPAGE="https://libbsd.freedesktop.org/wiki/"
+SRC_URI="https://${PN}.freedesktop.org/releases/${P}.tar.xz"
LICENSE="BSD BSD-2 BSD-4 ISC"
SLOT="0"
-KEYWORDS="amd64 arm ~mips ppc x86"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 sparc x86"
IUSE="static-libs"
+DEPEND=">=sys-kernel/linux-headers-3.17"
+RDEPEND=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-0.8.3-cdefs.patch
+ epatch "${FILESDIR}"/${P}-musl.patch
+}
+
pkg_setup() {
local f="${ROOT}/usr/$(get_libdir)/${PN}.a"
local m="You need to remove ${f} by hand or re-emerge sys-libs/glibc first."
@@ -25,19 +32,10 @@ pkg_setup() {
fi
}
-src_prepare() {
- epatch "${FILESDIR}"/${P}-replace__BEGIN_DECLS.patch
- epatch "${FILESDIR}"/${P}-fix-headers.patch
-
- /* This requires autoconf */
- epatch "${FILESDIR}"/${P}-remore-funopen.patch
- eautoreconf
-}
-
multilib_src_configure() {
# The build system will install libbsd-ctor.a despite of USE="-static-libs"
# which is correct, see:
- # http://cgit.freedesktop.org/libbsd/commit/?id=c5b959028734ca2281250c85773d9b5e1d259bc8
+ # https://cgit.freedesktop.org/libbsd/commit/?id=c5b959028734ca2281250c85773d9b5e1d259bc8
ECONF_SOURCE="${S}" econf $(use_enable static-libs static)
}
diff --git a/dev-libs/libbsd/libbsd-0.8.3-r2.ebuild b/dev-libs/libbsd/libbsd-0.8.3-r2.ebuild
new file mode 100644
index 00000000..9c345994
--- /dev/null
+++ b/dev-libs/libbsd/libbsd-0.8.3-r2.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit multilib-minimal
+
+DESCRIPTION="An library to provide useful functions commonly found on BSD systems"
+HOMEPAGE="https://libbsd.freedesktop.org/wiki/"
+SRC_URI="https://${PN}.freedesktop.org/releases/${P}.tar.xz"
+
+LICENSE="BSD BSD-2 BSD-4 ISC"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="static-libs"
+
+DEPEND=">=sys-kernel/linux-headers-3.17"
+RDEPEND=""
+
+src_prepare() {
+ eapply "${FILESDIR}"/${PN}-0.8.3-musl.patch
+ eapply "${FILESDIR}"/${PN}-0.8.3-cdefs.patch
+
+ default
+}
+
+pkg_setup() {
+ local f="${EROOT}/usr/$(get_libdir)/${PN}.a"
+ local m="You need to remove ${f} by hand or re-emerge sys-libs/glibc first."
+ if ! has_version ${CATEGORY}/${PN}; then
+ if [[ -e ${f} ]]; then
+ eerror "${m}"
+ die "${m}"
+ fi
+ fi
+}
+
+multilib_src_configure() {
+ # The build system will install libbsd-ctor.a despite of USE="-static-libs"
+ # which is correct, see:
+ # https://cgit.freedesktop.org/libbsd/commit/?id=c5b959028734ca2281250c85773d9b5e1d259bc8
+ ECONF_SOURCE="${S}" econf $(use_enable static-libs static)
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+ find "${ED}" -name "*.la" -delete || die
+
+ rm "${ED%/}"/usr/share/man/man3/explicit_bzero.3 || die # 617462
+}
diff --git a/dev-libs/libbsd/libbsd-0.8.3.ebuild b/dev-libs/libbsd/libbsd-0.8.3.ebuild
new file mode 100644
index 00000000..5e96f523
--- /dev/null
+++ b/dev-libs/libbsd/libbsd-0.8.3.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils multilib-minimal
+
+DESCRIPTION="An library to provide useful functions commonly found on BSD systems"
+HOMEPAGE="https://libbsd.freedesktop.org/wiki/"
+SRC_URI="https://${PN}.freedesktop.org/releases/${P}.tar.xz"
+
+LICENSE="BSD BSD-2 BSD-4 ISC"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
+IUSE="static-libs"
+
+DEPEND=">=sys-kernel/linux-headers-3.17"
+RDEPEND=""
+
+src_prepare() {
+ eapply "${FILESDIR}"/${PN}-0.8.3-musl.patch
+ eapply "${FILESDIR}"/${PN}-0.8.3-cdefs.patch
+
+ default
+}
+
+pkg_setup() {
+ local f="${EROOT}/usr/$(get_libdir)/${PN}.a"
+ local m="You need to remove ${f} by hand or re-emerge sys-libs/glibc first."
+ if ! has_version ${CATEGORY}/${PN}; then
+ if [[ -e ${f} ]]; then
+ eerror "${m}"
+ die "${m}"
+ fi
+ fi
+}
+
+multilib_src_configure() {
+ # The build system will install libbsd-ctor.a despite of USE="-static-libs"
+ # which is correct, see:
+ # https://cgit.freedesktop.org/libbsd/commit/?id=c5b959028734ca2281250c85773d9b5e1d259bc8
+ ECONF_SOURCE="${S}" econf $(use_enable static-libs static)
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+ prune_libtool_files
+}