summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-08-04 23:48:24 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-08-05 21:51:38 -0400
commite6062b6195c2d100f88bf8a82c45b7e9182ca088 (patch)
tree9dcbce36316b7187dd4159fefd85b333d0132db0 /gnu/packages/patches
parentd9a412bd94e533f854d44f87d956908490a05133 (diff)
downloadguix-e6062b6195c2d100f88bf8a82c45b7e9182ca088.tar.gz
gnu: pjproject: Update the pkg-config patch.
* gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch: Update patch.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch77
1 files changed, 61 insertions, 16 deletions
diff --git a/gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch b/gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch
index a3f2852515..1199d82f1e 100644
--- a/gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch
+++ b/gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch
@@ -1,34 +1,79 @@
-From 7a86f357ffa2339a67991e5f4f5610a218e80693 Mon Sep 17 00:00:00 2001
+From 9bcba7fb28055550961b134e517b695a8cd05b2a Mon Sep 17 00:00:00 2001
 From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
 Date: Mon, 3 Aug 2020 17:43:19 -0400
-Subject: [PATCH 2/2] build.mak.in: Filter out 3rd party libraries from
- PJ_INSTALL_LDFLAGS.
+Subject: [PATCH] libpjproject.pc: Move external libraries to Libs.private.
 
-This is done so users of the installed pjproject libraries do not get
+This is done so users of a shared pjproject library do not get link
 directives (provided via pkg-config file of pjproject) to link against
 pjproject's own library dependencies.
 
-* build.mak.in (THIRD_PARTY_LIBRARIES): New variable.
-(PJ_INSTALL_LDFLAGS): Filter out THIRD_PARTY_LIBRARIES.
+Static linking with pjproject is preserved by moving the external
+libraries link directives to the Libs.private field, which is
+specifically intended for this purpose, via for example:
+
+  $ pkg-config --static --libs libpjproject
+
+* build.mak.in (PJ_INSTALL_LDFLAGS_PRIVATE): New variable.
+(PJ_INSTALL_LDFLAGS): Filter out PJ_INSTALL_LDFLAGS_PRIVATE entries.
+* libpjproject.pc.in (Libs.private): New field.
+* Makefile: Substitute PJ_INSTALL_LDFLAGS_PRIVATE as the value for the
+Libs.private field.
 ---
- build.mak.in | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
+ Makefile           | 5 +++--
+ build.mak.in       | 3 ++-
+ libpjproject.pc.in | 1 +
+ 3 files changed, 6 insertions(+), 3 deletions(-)
 
+diff --git a/Makefile b/Makefile
+index 3fd5cab40..d67badfa4 100644
+--- a/Makefile
++++ b/Makefile
+@@ -54,14 +54,14 @@ doc:
+ 		    exit 1; \
+ 		fi; \
+ 	done
+-	
++
+ LIBS = 	pjlib/lib/libpj-$(TARGET_NAME).a \
+ 	pjlib-util/lib/libpjlib-util-$(TARGET_NAME).a \
+ 	pjnath/lib/libpjnath-$(TARGET_NAME).a \
+ 	pjmedia/lib/libpjmedia-$(TARGET_NAME).a \
+ 	pjmedia/lib/libpjmedia-audiodev-$(TARGET_NAME).a \
+ 	pjmedia/lib/libpjmedia-codec-$(TARGET_NAME).a \
+-    	pjsip/lib/libpjsip-$(TARGET_NAME).a \
++	pjsip/lib/libpjsip-$(TARGET_NAME).a \
+ 	pjsip/lib/libpjsip-ua-$(TARGET_NAME).a \
+ 	pjsip/lib/libpjsip-simple-$(TARGET_NAME).a \
+ 	pjsip/lib/libpjsua-$(TARGET_NAME).a
+@@ -133,6 +133,7 @@ install:
+ 		sed -e "s!@LIBDIR@!$(libdir)!" | \
+ 		sed -e "s/@PJ_VERSION@/$(PJ_VERSION)/" | \
+ 		sed -e "s!@PJ_INSTALL_LDFLAGS@!$(PJ_INSTALL_LDFLAGS)!" | \
++		sed -e "s!@PJ_INSTALL_LDFLAGS_PRIVATE@!$(PJ_INSTALL_LDFLAGS_PRIVATE)!" | \
+ 		sed -e "s!@PJ_INSTALL_CFLAGS@!$(PJ_INSTALL_CFLAGS)!" > $(DESTDIR)/$(libdir)/pkgconfig/libpjproject.pc
+ 
+ uninstall:
 diff --git a/build.mak.in b/build.mak.in
-index a9078bb25..86fd1ec30 100644
+index a9078bb25..1a18a8513 100644
 --- a/build.mak.in
 +++ b/build.mak.in
-@@ -314,8 +314,9 @@ export PJ_LIBXX_FILES := $(APP_LIBXX_FILES)
- 
- # And here are the variables to use if application is using the
- # library from the install location (i.e. --prefix)
-+THIRD_PARTY_LIBRARIES := $(APP_THIRD_PARTY_LIBS) $(APP_THIRD_PARTY_EXT) @LIBS@
- export PJ_INSTALL_DIR := @prefix@
+@@ -318,4 +318,5 @@ export PJ_INSTALL_DIR := @prefix@
  export PJ_INSTALL_INC_DIR := @includedir@
  export PJ_INSTALL_LIB_DIR := @libdir@
  export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @ac_cflags@
 -export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDXXLIBS)
-+export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(filter-out $(THIRD_PARTY_LIBRARIES),$(APP_LDXXLIBS))
++export PJ_INSTALL_LDFLAGS_PRIVATE := $(APP_THIRD_PARTY_LIBS) $(APP_THIRD_PARTY_EXT) @LIBS@
++export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(filter-out $(PJ_INSTALL_LDFLAGS_PRIVATE),$(APP_LDXXLIBS))
+diff --git a/libpjproject.pc.in b/libpjproject.pc.in
+index 30ea05c07..4372d5016 100644
+--- a/libpjproject.pc.in
++++ b/libpjproject.pc.in
+@@ -10,4 +10,5 @@ Description: Multimedia communication library
+ URL: http://www.pjsip.org
+ Version: @PJ_VERSION@
+ Libs: @PJ_INSTALL_LDFLAGS@
++Libs.private: @PJ_INSTALL_LDFLAGS_PRIVATE@
+ Cflags: @PJ_INSTALL_CFLAGS@
 -- 
 2.27.0