sys-libs/libsemanage: fix bad -I/-L flag usage
authorMike Frysinger <vapier@gentoo.org>
Wed, 17 Feb 2016 19:41:07 +0000 (14:41 -0500)
committerMike Frysinger <vapier@gentoo.org>
Wed, 17 Feb 2016 20:11:03 +0000 (15:11 -0500)
sys-libs/libsemanage/files/libsemanage-2.4-build-paths.patch [new file with mode: 0644]
sys-libs/libsemanage/libsemanage-2.4-r2.ebuild
sys-libs/libsemanage/libsemanage-9999.ebuild

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 (file)
index 0000000..7eeb9be
--- /dev/null
@@ -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
index b949d14907aa47cd2bddff260c1126c35ea29ab5..d43e13b090e6b4a20287b6ec6fc803f212e28fdb 100644 (file)
@@ -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
 
index 5132051ba8c2b5af5e5ce3ae2a16924fb12c7bcb..734b83821ca6465e18e21c455bcdcd1e0f174679 100644 (file)
@@ -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