Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
prevent LDFLAGS from ending up in pkg-config .pc file
I can’t find much mention of this problem when searching the web,
except for one case in curl where it was fixed in 2009:
curl/curl@4c8adc8
  • Loading branch information
stapelberg committed May 2, 2020
1 parent e2005c9 commit cefded2
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkgs/giblib/build.textproto
Expand Up @@ -2,6 +2,8 @@ source: "http://deb.debian.org/debian/pool/main/g/giblib/giblib_1.2.4.orig.tar.g
hash: "e437756ce3ded019946fb3d979991cda7604bc345dbb1338b17655caff65a3d3"
version: "1.2.4-8"

cherry_pick: "pc-ldflags.patch"

writable_sourcedir: true
in_tree_build: true

Expand Down
11 changes: 11 additions & 0 deletions pkgs/giblib/pc-ldflags.patch
@@ -0,0 +1,11 @@
--- old/giblib.pc.in 2004-09-04 16:40:40.000000000 +0200
+++ new/giblib.pc.in 2020-05-02 11:13:50.450107188 +0200
@@ -6,6 +6,6 @@
Name: giblib
Description: wrapper library for imlib2, and other stuff
Version: @VERSION@
-Libs: -L${libdir} -lgiblib @LDFLAGS@ @IMLIB_LIBS@
+Libs: -L${libdir} -lgiblib @IMLIB_LIBS@
Cflags: -I${includedir} -I${includedir}/giblib @IMLIB_CFLAGS@

Binary files /dev/null and new/giblib.pc.in~ differ
2 changes: 2 additions & 0 deletions pkgs/guile/build.textproto
Expand Up @@ -2,6 +2,8 @@ source: "https://ftp.gnu.org/gnu/guile/guile-2.0.14.tar.xz"
hash: "e8442566256e1be14e51fc18839cd799b966bc5b16c6a1d7a7c35155a8619d82"
version: "2.0.14-6"

cherry_pick: "pc-ldflags.patch"

cbuilder: {}

# build dependencies:
Expand Down
12 changes: 12 additions & 0 deletions pkgs/guile/pc-ldflags.patch
@@ -0,0 +1,12 @@
--- old/configure 2017-02-13 22:18:15.000000000 +0100
+++ new/configure 2020-05-02 11:57:10.998023956 +0200
@@ -54946,7 +54946,7 @@
done

GUILE_CFLAGS="$GUILE_CFLAGS $PTHREAD_CFLAGS"
-GUILE_LIBS="$LDFLAGS $LIBS"
+GUILE_LIBS=" $LIBS"



Binary files /dev/null and new/configure~ differ
3 changes: 3 additions & 0 deletions pkgs/ncurses/build.textproto
Expand Up @@ -8,6 +8,9 @@ extra_file: "panelw.so.ld"
extra_file: "formw.so.ld"
extra_file: "menuw.so.ld"

# Prevent our LDFLAGS from ending up in the pkg-config .pc file:
cherry_pick: "pc-ldflags.patch"

cbuilder: {
# TODO: enable C++ support?
extra_configure_flag: "--without-cxx-binding"
Expand Down
15 changes: 15 additions & 0 deletions pkgs/ncurses/pc-ldflags.patch
@@ -0,0 +1,15 @@
--- old/misc/gen-pkgconfig.in 2020-05-02 11:08:19.661290907 +0200
+++ new/misc/gen-pkgconfig.in 2020-05-02 11:10:50.262568124 +0200
@@ -92,6 +92,12 @@
-Wl,-z,*) # ignore flags used to manipulate shared image
continue
;;
+ -Wl,-rpath*) # ignore rpath
+ continue
+ ;;
+ -Wl,--dynamic-linker*) # ignore ELF interpreter
+ continue
+ ;;
-L*)
[ -d ${opt##-L} ] || continue
case ${opt##-L} in
2 changes: 2 additions & 0 deletions pkgs/ruby/build.textproto
Expand Up @@ -5,6 +5,8 @@ pull: {
releases_url: "https://www.ruby-lang.org/en/downloads/"
}

cherry_pick: "pc-ldflags.patch"

cbuilder: {}

# build dependencies:
Expand Down
17 changes: 17 additions & 0 deletions pkgs/ruby/pc-ldflags.patch
@@ -0,0 +1,17 @@
--- old/template/ruby.pc.in 2020-03-31 12:44:55.000000000 +0200
+++ new/template/ruby.pc.in 2020-05-02 13:24:09.239957802 +0200
@@ -48,12 +48,11 @@
LIBRUBYARG_STATIC=@LIBRUBYARG_STATIC@
LIBRUBYARG=@LIBRUBYARG@
LIBS=@LIBS@
-DLDFLAGS=@DLDFLAGS@

Name: Ruby
Description: Object Oriented Script Language
Version: ${ruby_version}
URL: https://www.ruby-lang.org
Cflags: -I${rubyarchhdrdir} -I${rubyhdrdir}
-Libs: ${DLDFLAGS} ${LIBRUBYARG_SHARED} ${LIBS}
+Libs: ${LIBRUBYARG_SHARED} ${LIBS}
Requires:
Binary files /dev/null and new/template/ruby.pc.in~ differ

0 comments on commit cefded2

Please sign in to comment.