dev-db/lmdb: fix build on <=darwin9, remove upstreamed Solaris fix
authorFabian Groffen <grobian@gentoo.org>
Tue, 8 Jan 2019 10:52:39 +0000 (11:52 +0100)
committerFabian Groffen <grobian@gentoo.org>
Tue, 8 Jan 2019 13:45:09 +0000 (14:45 +0100)
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11

dev-db/lmdb/lmdb-0.9.22.ebuild

index 3219ba9b0b512891806b83c0f9a0226dc653b3d3..9e4e027f8378c92eaa6752ab2a27ad801a7b29e2 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -21,6 +21,11 @@ S="${WORKDIR}/${PN}-LMDB_${PV}/libraries/liblmdb"
 
 src_prepare() {
        eapply_user
+       if [[ ${CHOST} == *-darwin* && ${CHOST#*-darwin} -lt 10 ]] ; then
+               # posix_memalign isn't available before 10.6, but on OSX
+               # malloc is always aligned for any addressable type
+               sed -i -e '/(__APPLE__)/a#define HAVE_MEMALIGN 1\n#define memalign(X,Y) malloc(X)' mdb.c || die
+       fi
        multilib_copy_sources
 }
 
@@ -38,8 +43,6 @@ multilib_src_configure() {
                "Makefile" || die
 
        if [[ ${CHOST} == *-solaris* ]] ; then
-               # ensure sigwait has a second sig argument
-               append-cppflags -D_POSIX_PTHREAD_SEMANTICS
                # fdatasync lives in -lrt on Solaris 10
                [[ ${CHOST#*-solaris2.} -le 10 ]] && append-ldflags -lrt
        fi