diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2020-08-03 02:01:19 -0400 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2020-08-03 23:30:11 -0400 |
commit | 839bb42f0cc80dbdbcd101fffadd47ead93409d2 (patch) | |
tree | 9fbc6be9398a0e33c49ecbf41cbcc9bf0b4058c2 | |
parent | 742c49bafef6e0e5e1860e8ce8f3a9433e24bd24 (diff) | |
download | guix-839bb42f0cc80dbdbcd101fffadd47ead93409d2.tar.gz |
gnu: pjproject: Fix problem in pkg-config file.
* gnu/packages/patches/pjproject-correct-the-cflags-field.patch: Add patch. * gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch: Likewise. * gnu/local.mk (dist_patch_DATA): Register the new patches. * gnu/packages/telephony.scm (pjproject): Use them. * gnu/packages/jami.scm (pjproject-jami): Remove a patch from pjproject-jami that is already applied against pjproject.
-rw-r--r-- | gnu/local.mk | 2 | ||||
-rw-r--r-- | gnu/packages/jami.scm | 3 | ||||
-rw-r--r-- | gnu/packages/patches/pjproject-correct-the-cflags-field.patch | 121 | ||||
-rw-r--r-- | gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch | 34 | ||||
-rw-r--r-- | gnu/packages/telephony.scm | 4 |
5 files changed, 163 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 8be9bac67c..dee4862b93 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1410,6 +1410,8 @@ dist_patch_DATA = \ %D%/packages/patches/pingus-boost-headers.patch \ %D%/packages/patches/pingus-sdl-libs-config.patch \ %D%/packages/patches/pixman-CVE-2016-5296.patch \ + %D%/packages/patches/pjproject-correct-the-cflags-field.patch \ + %D%/packages/patches/pjproject-fix-pkg-config-ldflags.patch \ %D%/packages/patches/plink-1.07-unclobber-i.patch \ %D%/packages/patches/plink-endian-detection.patch \ %D%/packages/patches/plib-CVE-2011-4620.patch \ diff --git a/gnu/packages/jami.scm b/gnu/packages/jami.scm index 85a06026ed..6dbde4078b 100644 --- a/gnu/packages/jami.scm +++ b/gnu/packages/jami.scm @@ -171,7 +171,8 @@ "0007-pj_ice_sess" "0008-fix_ioqueue_ipv6_sendto" "0009-add-config-site" - "0010-fix-pkgconfig" + ;; Note: The base pjproject is already patched with + ;; "0010-fix-pkgconfig". "0011-fix-tcp-death-detection" "0012-fix-turn-shutdown-crash")) #t))) diff --git a/gnu/packages/patches/pjproject-correct-the-cflags-field.patch b/gnu/packages/patches/pjproject-correct-the-cflags-field.patch new file mode 100644 index 0000000000..8bc503580d --- /dev/null +++ b/gnu/packages/patches/pjproject-correct-the-cflags-field.patch @@ -0,0 +1,121 @@ +From 44f8f6c1c71bec6bf00269b075a2dc801ae6fd45 Mon Sep 17 00:00:00 2001 +From: Vladimir Stoiakin <VStoiakin@lavabit.com> +Date: Thu, 23 Apr 2020 14:06:40 +0300 +Subject: [PATCH 1/2] libpjproject.pc: correct the field 'cflags' + +--- + Makefile | 6 ++---- + aconfigure | 4 ++++ + aconfigure.ac | 3 +++ + build.mak.in | 7 +++---- + libpjproject.pc.in | 4 ++-- + 5 files changed, 14 insertions(+), 10 deletions(-) + +diff --git a/Makefile b/Makefile +index ffaf638dd..3fd5cab40 100644 +--- a/Makefile ++++ b/Makefile +@@ -132,10 +132,8 @@ install: + sed -e "s!@INCLUDEDIR@!$(includedir)!" | \ + sed -e "s!@LIBDIR@!$(libdir)!" | \ + sed -e "s/@PJ_VERSION@/$(PJ_VERSION)/" | \ +- sed -e "s!@PJ_LDLIBS@!!" | \ +- sed -e "s!@PJ_LDXXLIBS@!$(PJ_LDXXLIBS)!" | \ +- sed -e "s!@PJ_INSTALL_CFLAGS@!!" | \ +- sed -e "s!@PJ_INSTALL_CXXFLAGS@!$(PJ_INSTALL_CXXFLAGS)!" > $(DESTDIR)/$(libdir)/pkgconfig/libpjproject.pc ++ sed -e "s!@PJ_INSTALL_LDFLAGS@!$(PJ_INSTALL_LDFLAGS)!" | \ ++ sed -e "s!@PJ_INSTALL_CFLAGS@!$(PJ_INSTALL_CFLAGS)!" > $(DESTDIR)/$(libdir)/pkgconfig/libpjproject.pc + + uninstall: + $(RM) $(DESTDIR)$(libdir)/pkgconfig/libpjproject.pc +diff --git a/aconfigure b/aconfigure +index 2abbcf533..1ab932bda 100755 +--- a/aconfigure ++++ b/aconfigure +@@ -706,6 +706,7 @@ GREP + CPP + ac_cross_compile + ac_shlib_suffix ++ac_cflags + ac_build_mak_vars + ac_pjdir + CC_CFLAGS +@@ -3952,6 +3953,7 @@ if test "$CC_CFLAGS" = ""; then CC_CFLAGS="-Wall"; fi + + + ++ + case $host in + *mingw* | *cygw* | *win32* | *w32* ) + if pwd -W 2&> /dev/null; then +@@ -5138,8 +5140,10 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + if test "x$ac_cv_c_bigendian" = "xyes"; then + CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0" ++ ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0" + else + CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1" ++ ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1" + fi + + +diff --git a/aconfigure.ac b/aconfigure.ac +index 83d3559ed..b1d493c08 100644 +--- a/aconfigure.ac ++++ b/aconfigure.ac +@@ -71,6 +71,7 @@ AC_SUBST(CC_CFLAGS) + + AC_SUBST(ac_pjdir) + AC_SUBST(ac_build_mak_vars) ++AC_SUBST(ac_cflags) + + case $host in + *mingw* | *cygw* | *win32* | *w32* ) +@@ -144,8 +145,10 @@ AC_C_BIGENDIAN + + if test "x$ac_cv_c_bigendian" = "xyes"; then + CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0" ++ ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0" + else + CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1" ++ ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1" + fi + + dnl +diff --git a/build.mak.in b/build.mak.in +index abc0c4fa0..a9078bb25 100644 +--- a/build.mak.in ++++ b/build.mak.in +@@ -299,7 +299,7 @@ export APP_LDXXLIBS := $(PJSUA2_LIB_LDLIB) \ + -lstdc++ \ + $(APP_LDLIBS) + +-# Here are the variabels to use if application is using the library ++# Here are the variables to use if application is using the library + # from within the source distribution + export PJ_CC := $(APP_CC) + export PJ_CXX := $(APP_CXX) +@@ -317,6 +317,5 @@ export PJ_LIBXX_FILES := $(APP_LIBXX_FILES) + 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 @CFLAGS@ +-export PJ_INSTALL_CXXFLAGS := @CXXFLAGS@ $(PJ_INSTALL_CFLAGS) +-export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDLIBS) ++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) +diff --git a/libpjproject.pc.in b/libpjproject.pc.in +index fa8d39114..30ea05c07 100644 +--- a/libpjproject.pc.in ++++ b/libpjproject.pc.in +@@ -9,5 +9,5 @@ Name: libpjproject + Description: Multimedia communication library + URL: http://www.pjsip.org + Version: @PJ_VERSION@ +-Libs: -L${libdir} @PJ_LDXXLIBS@ +-Cflags: -I${includedir} @PJ_INSTALL_CXXFLAGS@ ++Libs: @PJ_INSTALL_LDFLAGS@ ++Cflags: @PJ_INSTALL_CFLAGS@ +-- +2.27.0 + diff --git a/gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch b/gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch new file mode 100644 index 0000000000..a3f2852515 --- /dev/null +++ b/gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch @@ -0,0 +1,34 @@ +From 7a86f357ffa2339a67991e5f4f5610a218e80693 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. + +This is done so users of the installed pjproject libraries do not get +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. +--- + build.mak.in | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/build.mak.in b/build.mak.in +index a9078bb25..86fd1ec30 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@ + 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)) +-- +2.27.0 + diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm index f5b484dc2b..cc31cd6a36 100644 --- a/gnu/packages/telephony.scm +++ b/gnu/packages/telephony.scm @@ -731,6 +731,10 @@ your calls and messages.") (base32 "1aklicpgwc88578k03i5d5cm5h8mfm7hmx8vfprchbmaa2p8f4z0")) (modules '((guix build utils))) + ;; The patches upstream status can be tracked at: + ;; https://github.com/pjsip/pjproject/pull/2501. + (patches (search-patches "pjproject-correct-the-cflags-field.patch" + "pjproject-fix-pkg-config-ldflags.patch")) (snippet '(begin ;; Remove bundled libraries. |