commit:     0eb147b01782e40c55276fe284e9804c25a7981e
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 17 19:41:07 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Feb 17 20:11:03 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0eb147b0

sys-libs/libsemanage: fix bad -I/-L flag usage

 .../files/libsemanage-2.4-build-paths.patch        | 35 ++++++++++++++++++++++
 sys-libs/libsemanage/libsemanage-2.4-r2.ebuild     |  1 +
 sys-libs/libsemanage/libsemanage-9999.ebuild       |  1 +
 3 files changed, 37 insertions(+)

diff --git a/sys-libs/libsemanage/files/libsemanage-2.4-build-paths.patch 
b/sys-libs/libsemanage/files/libsemanage-2.4-build-paths.patch
new file mode 100644
index 0000000..7eeb9be
--- /dev/null
+++ b/sys-libs/libsemanage/files/libsemanage-2.4-build-paths.patch
@@ -0,0 +1,35 @@
+there's no point in using -I/-L flags to the system paths and this breaks
+cross-compiling.  just drop them.
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -60,7 +60,7 @@
+ SWIG_CFLAGS += -Wno-error -Wno-unused-but-set-variable -Wno-unused-variable 
-Wno-shadow \
+               -Wno-unused-parameter
+ 
+-override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE 
++override CFLAGS += -I../include -D_GNU_SOURCE
+ RANLIB=ranlib
+ 
+ SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./
+@@ -82,17 +82,17 @@
+       $(CC) $(CFLAGS) $(SWIG_CFLAGS) $(RUBYINC) -fPIC -DSHARED -c -o $@ $<
+ 
+ $(SWIGSO): $(SWIGLOBJ)
+-      $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lsemanage -L$(LIBDIR)
++      $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lsemanage
+ 
+ $(SWIGRUBYSO): $(SWIGRUBYLOBJ)
+-      $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lsemanage -L$(LIBDIR)
++      $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lsemanage
+ 
+ $(LIBA): $(OBJS)
+       $(AR) rcs $@ $^
+       $(RANLIB) $@
+ 
+ $(LIBSO): $(LOBJS)
+-      $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -lsepol -laudit -lselinux 
-lbz2 -lustr -L$(LIBDIR) 
-Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
++      $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -lsepol -laudit -lselinux 
-lbz2 -lustr -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
+       ln -sf $@ $(TARGET)
+ 
+ $(LIBPC): $(LIBPC).in ../VERSION

diff --git a/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild 
b/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild
index b949d14..d43e13b 100644
--- a/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild
+++ b/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild
@@ -70,6 +70,7 @@ src_prepare() {
                
"${FILESDIR}/0003-libsemanage-Add-file_contexts-and-seusers-to-the-sto.patch" \
                
"${FILESDIR}/0004-libsemanage-save-homedir_template-in-the-policy-stor.patch" \
                
"${FILESDIR}/0005-libsemanage-store-users_extra-in-the-policy-store.patch"
+       epatch "${FILESDIR}"/${PN}-2.4-build-paths.patch
 
        epatch_user
 

diff --git a/sys-libs/libsemanage/libsemanage-9999.ebuild 
b/sys-libs/libsemanage/libsemanage-9999.ebuild
index 5132051..734b838 100644
--- a/sys-libs/libsemanage/libsemanage-9999.ebuild
+++ b/sys-libs/libsemanage/libsemanage-9999.ebuild
@@ -76,6 +76,7 @@ src_prepare() {
                # If wanted for live builds, please use /etc/portage/patches
                epatch 
"${FILESDIR}/0001-libsemanage-do-not-copy-contexts-in-semanage_migrate.patch"
        fi
+       epatch "${FILESDIR}"/${PN}-2.4-build-paths.patch
 
        epatch_user
 

Reply via email to