libs/xmlrpc-c: fix pkg-config files
authorYegor Yefremov <yegorslists@googlemail.com>
Tue, 2 Jan 2024 17:20:03 +0000 (18:20 +0100)
committerRosen Penev <rosenp@gmail.com>
Sat, 6 Jan 2024 21:49:22 +0000 (13:49 -0800)
Add an upstream patch that uses conventional variables in
pkg-config files so they can be overridden at pkg-config time.

This patch was created using the following upstream revisions:

- https://sourceforge.net/p/xmlrpc-c/code/3203/
- https://sourceforge.net/p/xmlrpc-c/code/3205/

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
libs/xmlrpc-c/patches/001-fix-pkg-config-files.patch [new file with mode: 0644]

diff --git a/libs/xmlrpc-c/patches/001-fix-pkg-config-files.patch b/libs/xmlrpc-c/patches/001-fix-pkg-config-files.patch
new file mode 100644 (file)
index 0000000..e52d11e
--- /dev/null
@@ -0,0 +1,299 @@
+--- a/lib/abyss/src/Makefile
++++ b/lib/abyss/src/Makefile
+@@ -131,13 +131,15 @@ SOCKLIB=$(SOCKETLIBOPT)
+ xmlrpc_abyss.pc:
+       rm -f $@
+       @echo "Echoes to '$@' suppressed here ..."
++      @echo -e '$(PKGCONFIG_VAR_SET)'                                    >>$@
++      @echo                                                              >>$@
+       @echo "Name:        xmlrpc_abyss"                                  >>$@
+       @echo "Description: Xmlrpc-c Abyss HTTP C library"                 >>$@
+       @echo "Version:     $(XMLRPC_VERSION_STRING)"                      >>$@
+       @echo                                                              >>$@
+       @echo "Requires: xmlrpc_util"                                      >>$@
+-      @echo "Libs:     -L$(LIBDESTDIR) -lxmlrpc_abyss $(SOCKLIB)"        >>$@
+-      @echo "Cflags:   -I$(HEADERDESTDIR)"                               >>$@
++      @echo 'Libs:     -L$${libdir} -lxmlrpc_abyss $(SOCKLIB)'           >>$@
++      @echo 'Cflags:   -I$${includedir}'                                 >>$@
+ # Need this dependency for those who don't use depend.mk.
+ # Without it, version.h doesn't get created.
+--- a/lib/abyss++/Makefile
++++ b/lib/abyss++/Makefile
+@@ -120,13 +120,15 @@ $(LIBXMLRPC_ABYSSPP_MODS:%=%.osh): \
+ xmlrpc_abyss++.pc:
+       rm -f $@
+       @echo "Echoes to '$@' suppressed here ..."
++      @echo -e '$(PKGCONFIG_VAR_SET)'                                    >>$@
++      @echo                                                              >>$@
+       @echo "Name:        xmlrpc_abyss++"                                >>$@
+       @echo "Description: Xmlrpc-c Abyss HTTP C++ library"               >>$@
+       @echo "Version:     $(XMLRPC_VERSION_STRING)"                      >>$@
+       @echo                                                              >>$@
+       @echo "Requires: xmlrpc_abyss xmlrpc_util++"                       >>$@
+-      @echo "Libs:     -L$(LIBDESTDIR) -lxmlrpc_abyss++"                 >>$@
+-      @echo "Cflags:   -I$(HEADERDESTDIR)"                               >>$@
++      @echo 'Libs:     -L$${libdir} -lxmlrpc_abyss++'                    >>$@
++      @echo 'Cflags:   -I$${includedir}'                                 >>$@
+ #-----------------------------------------------------------------------------
+ #  MISCELLANEOUS RULES
+--- a/lib/expat/Makefile
++++ b/lib/expat/Makefile
+@@ -34,13 +34,15 @@ xmltok/all: gennmtab/all
+ xmlrpc_expat.pc:
+       rm -f $@
+       @echo "Echoes to '$@' suppressed here ..."
++      @echo -e '$(PKGCONFIG_VAR_SET)'                                    >>$@
++      @echo                                                              >>$@
+       @echo "Name:        xmlrpc_expat"                                  >>$@
+       @echo "Description: Xmlrpc-c XML parsing library"                  >>$@
+       @echo "Version:     $(XMLRPC_VERSION_STRING)"                      >>$@
+       @echo                                                              >>$@
+       @echo "Requires: xmlrpc_util"                                      >>$@
+-      @echo "Libs:     -L$(LIBDESTDIR) -lxmlrpc_xmlparse -lxmlrpc_xmltok" >>$@
+-      @echo "Cflags:   -I$(HEADERDESTDIR)"                               >>$@
++      @echo 'Libs:     -L$${libdir} -lxmlrpc_xmlparse -lxmlrpc_xmltok'   >>$@
++      @echo 'Cflags:   -I$${includedir}'                                 >>$@
+ .PHONY: clean
+ clean: $(SUBDIRS:%=%/clean) clean-common
+--- a/lib/libutil/Makefile
++++ b/lib/libutil/Makefile
+@@ -112,13 +112,15 @@ libxmlrpc_util.a: LIBOBJECTS = $(TARGET_
+ xmlrpc_util.pc:
+       rm -f $@
+       @echo "Echoes to '$@' suppressed here ..."
++      @echo -e '$(PKGCONFIG_VAR_SET)'                                    >>$@
++      @echo                                                              >>$@
+       @echo "Name:        xmlrpc_util"                                   >>$@
+       @echo "Description: Xmlrpc-c utility functions library"            >>$@
+       @echo "Version:     $(XMLRPC_VERSION_STRING)"                      >>$@
+       @echo                                                              >>$@
+       @echo "Requires: "                                                 >>$@
+-      @echo "Libs:     -L$(LIBDESTDIR) -lxmlrpc_util"                    >>$@
+-      @echo "Cflags:   -I$(HEADERDESTDIR)"                               >>$@
++      @echo 'Libs:     -L$${libdir} -lxmlrpc_util'                       >>$@
++      @echo 'Cflags:   -I$${includedir}'                                 >>$@
+ .PHONY: install
+ install: install-common
+--- a/lib/libutil++/Makefile
++++ b/lib/libutil++/Makefile
+@@ -101,13 +101,15 @@ libxmlrpc_util++.a: LIBOBJECTS = $(LIBXM
+ xmlrpc_util++.pc:
+       rm -f $@
+       @echo "Echoes to '$@' suppressed here ..."
++      @echo -e '$(PKGCONFIG_VAR_SET)'                                    >>$@
++      @echo                                                              >>$@
+       @echo "Name:        xmlrpc_util++"                                 >>$@
+       @echo "Description: Xmlrpc-c C++ utility functions library"        >>$@
+       @echo "Version:     $(XMLRPC_VERSION_STRING)"                      >>$@
+       @echo                                                              >>$@
+       @echo "Requires: xmlrpc_util"                                      >>$@
+-      @echo "Libs:     -L$(LIBDESTDIR) -lxmlrpc_util++"                  >>$@
+-      @echo "Cflags:   -I$(HEADERDESTDIR)"                               >>$@
++      @echo 'Libs:     -L$${libdir} -lxmlrpc_util++'                     >>$@
++      @echo 'Cflags:   -I$${includedir}'                                 >>$@
+ #-----------------------------------------------------------------------------
+ #  MISCELLANEOUS RULES
+--- a/lib/openssl/Makefile
++++ b/lib/openssl/Makefile
+@@ -81,13 +81,15 @@ INCLUDES = \
+ xmlrpc_openssl.pc:
+       rm -f $@
+       @echo "Echoes to '$@' suppressed here ..."
++      @echo -e '$(PKGCONFIG_VAR_SET)'                                    >>$@
++      @echo                                                              >>$@
+       @echo "Name:        xmlrpc_openssl"                                >>$@
+       @echo "Description: Openssl convenience function from Xmlrpc-c package"                 >>$@
+       @echo "Version:     $(XMLRPC_VERSION_STRING)"                      >>$@
+       @echo                                                              >>$@
+       @echo "Requires: xmlrpc_util"                                      >>$@
+-      @echo "Libs:     -L$(LIBDESTDIR) -lxmlrpc_openssl"                 >>$@
+-      @echo "Cflags:   -I$(HEADERDESTDIR)"                               >>$@
++      @echo 'Libs:     -L$${libdir}  -lxmlrpc_openssl'                   >>$@
++      @echo 'Cflags:   -I$${includedir}'                                 >>$@
+ #-----------------------------------------------------------------------------
+ #  MISCELLANEOUS
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -333,57 +333,67 @@ libxmlrpc_client.ldflags:
+ xmlrpc.pc:
+       rm -f $@
+       @echo "Echoes to '$@' suppressed here ..."
+-      @echo "Name:        xmlrpc"                                        >>$@
+-      @echo "Description: Xmlrpc-c basic XML-RPC library"                >>$@
+-      @echo "Version:     $(XMLRPC_VERSION_STRING)"                      >>$@
++      @echo -e '$(PKGCONFIG_VAR_SET)'                                    >>$@
++      @echo                                                              >>$@
++      @echo 'Name:        xmlrpc'                                        >>$@
++      @echo 'Description: Xmlrpc-c basic XML-RPC library'                >>$@
++      @echo 'Version:     $(XMLRPC_VERSION_STRING)'                      >>$@
+       @echo                                                              >>$@
+-      @echo "Requires: xmlrpc_util $(XML_PKGCONFIG_REQ)"                 >>$@
+-      @echo "Libs:     -L$(LIBDESTDIR) -lxmlrpc"                         >>$@
+-      @echo "Cflags:   -I$(HEADERDESTDIR)"                               >>$@
++      @echo 'Requires: xmlrpc_util $(XML_PKGCONFIG_REQ)'                 >>$@
++      @echo 'Libs:     -L$${libdir} -lxmlrpc'                            >>$@
++      @echo 'Cflags:   -I$${includedir}'                                 >>$@
+ xmlrpc_client.pc:
+       rm -f $@
+       @echo "Echoes to '$@' suppressed here ..."
++      @echo -e '$(PKGCONFIG_VAR_SET)'                                    >>$@
++      @echo                                                              >>$@
+       @echo "Name:        xmlrpc_client"                                 >>$@
+       @echo "Description: Xmlrpc-c XML-RPC client library"               >>$@
+       @echo "Version:     $(XMLRPC_VERSION_STRING)"                      >>$@
+       @echo                                                              >>$@
+       @echo "Requires: xmlrpc xmlrpc_util"                               >>$@
+-      @echo "Libs:     -L$(LIBDESTDIR) -lxmlrpc_client"                  >>$@
+-      @echo "Cflags:   -I$(HEADERDESTDIR)"                               >>$@
++      @echo 'Libs:     -L$${libdir} -lxmlrpc_client'                     >>$@
++      @echo 'Cflags:   -I$${includedir}'                                 >>$@
+ xmlrpc_server.pc:
+       rm -f $@
+       @echo "Echoes to '$@' suppressed here ..."
++      @echo -e '$(PKGCONFIG_VAR_SET)'                                    >>$@
++      @echo                                                              >>$@
+       @echo "Name:        xmlrpc_server"                                 >>$@
+       @echo "Description: Xmlrpc-c XML-RPC server library"               >>$@
+       @echo "Version:     $(XMLRPC_VERSION_STRING)"                      >>$@
+       @echo                                                              >>$@
+       @echo "Requires: xmlrpc xmlrpc_util"                               >>$@
+-      @echo "Libs:     -L$(LIBDESTDIR) -lxmlrpc_server"                  >>$@
+-      @echo "Cflags:   -I$(HEADERDESTDIR)"                               >>$@
++      @echo 'Libs:     -L$${libdir} -lxmlrpc_server'                     >>$@
++      @echo 'Cflags:   -I$${includedir}'                                 >>$@
+ xmlrpc_server_abyss.pc:
+       rm -f $@
+       @echo "Echoes to '$@' suppressed here ..."
++      @echo -e '$(PKGCONFIG_VAR_SET)'                                    >>$@
++      @echo                                                              >>$@
+       @echo "Name:        xmlrpc_server_abyss"                           >>$@
+       @echo "Description: Xmlrpc-c Abyss XML-RPC server library"         >>$@
+       @echo "Version:     $(XMLRPC_VERSION_STRING)"                      >>$@
+       @echo                                                              >>$@
+       @echo "Requires: xmlrpc xmlrpc_server xmlrpc_abyss xmlrpc_util"    >>$@
+-      @echo "Libs:     -L$(LIBDESTDIR) -lxmlrpc_server_abyss"            >>$@
+-      @echo "Cflags:   -I$(HEADERDESTDIR)"                               >>$@
++      @echo 'Libs:     -L$${libdir} -lxmlrpc_server_abyss'               >>$@
++      @echo 'Cflags:   -I$${includedir}'                                 >>$@
+ xmlrpc_server_cgi.pc:
+       rm -f $@
+       @echo "Echoes to '$@' suppressed here ..."
++      @echo -e '$(PKGCONFIG_VAR_SET)'                                    >>$@
++      @echo                                                              >>$@
+       @echo "Name:        xmlrpc_server_cgi"                             >>$@
+       @echo "Description: Xmlrpc-c CGI XML-RPC server library"           >>$@
+       @echo "Version:     $(XMLRPC_VERSION_STRING)"                      >>$@
+       @echo                                                              >>$@
+       @echo "Requires: xmlrpc xmlrpc_server xmlrpc_util"                 >>$@
+-      @echo "Libs:     -L$(LIBDESTDIR) -lxmlrpc_server_cgi"              >>$@
+-      @echo "Cflags:   -I$(HEADERDESTDIR)"                               >>$@
++      @echo 'Libs:     -L$${libdir} -lxmlrpc_server_cgi'                 >>$@
++      @echo 'Cflags:   -I$${includedir}'                                 >>$@
+ .PHONY: check
+ check:
+--- a/src/cpp/Makefile
++++ b/src/cpp/Makefile
+@@ -355,57 +355,67 @@ $(TRANSPORT_CONFIG_USERS:%=%.o) $(TRANSP
+ xmlrpc++.pc:
+       rm -f $@
+       @echo "Echoes to '$@' suppressed here ..."
++      @echo -e '$(PKGCONFIG_VAR_SET)'                                    >>$@
++      @echo                                                              >>$@
+       @echo "Name:        xmlrpc++"                                      >>$@
+       @echo "Description: Xmlrpc-c basic XML-RPC C++ library"            >>$@
+       @echo "Version:     $(XMLRPC_VERSION_STRING)"                      >>$@
+       @echo                                                              >>$@
+       @echo "Requires: xmlrpc xmlrpc_util"                               >>$@
+-      @echo "Libs:     -L$(LIBDESTDIR) -lxmlrpc++"                       >>$@
+-      @echo "Cflags:   -I$(HEADERDESTDIR)"                               >>$@
++      @echo 'Libs:     -L$${libdir} -lxmlrpc++'                          >>$@
++      @echo 'Cflags:   -I$${includedir}'                                 >>$@
+ xmlrpc_client++.pc:
+       rm -f $@
+       @echo "Echoes to '$@' suppressed here ..."
++      @echo -e '$(PKGCONFIG_VAR_SET)'                                    >>$@
++      @echo                                                              >>$@
+       @echo "Name:        xmlrpc_client++"                               >>$@
+       @echo "Description: Xmlrpc-c XML-RPC client C++ library"           >>$@
+       @echo "Version:     $(XMLRPC_VERSION_STRING)"                      >>$@
+       @echo                                                              >>$@
+       @echo "Requires: xmlrpc++ xmlrpc_client xmlrpc_util++ xmlrpc_util" >>$@
+-      @echo "Libs:     -L$(LIBDESTDIR) -lxmlrpc_client++"                >>$@
+-      @echo "Cflags:   -I$(HEADERDESTDIR)"                               >>$@
++      @echo 'Libs:     -L$${libdir} -lxmlrpc_client++'                   >>$@
++      @echo 'Cflags:   -I$${includedir}'                                 >>$@
+ xmlrpc_server++.pc:
+       rm -f $@
+       @echo "Echoes to '$@' suppressed here ..."
++      @echo -e '$(PKGCONFIG_VAR_SET)'                                    >>$@
++      @echo                                                              >>$@
+       @echo "Name:        xmlrpc_server++"                               >>$@
+       @echo "Description: Xmlrpc-c XML-RPC server C++ library"           >>$@
+       @echo "Version:     $(XMLRPC_VERSION_STRING)"                      >>$@
+       @echo                                                              >>$@
+       @echo "Requires: xmlrpc++ xmlrpc xmlrpc_server xmlrpc_util++ xmlrpc_util" >>$@
+-      @echo "Libs:     -L$(LIBDESTDIR) -lxmlrpc_server++"                >>$@
+-      @echo "Cflags:   -I$(HEADERDESTDIR)"                               >>$@
++      @echo 'Libs:     -L$${libdir} -lxmlrpc_server++'                   >>$@
++      @echo 'Cflags:   -I$${includedir}'                                 >>$@
+ xmlrpc_server_abyss++.pc:
+       rm -f $@
+       @echo "Echoes to '$@' suppressed here ..."
++      @echo -e '$(PKGCONFIG_VAR_SET)'                                    >>$@
++      @echo                                                              >>$@
+       @echo "Name:        xmlrpc_server_abyss++"                         >>$@
+       @echo "Description: Xmlrpc-c Abyss XML-RPC server C++ library"     >>$@
+       @echo "Version:     $(XMLRPC_VERSION_STRING)"                      >>$@
+       @echo                                                              >>$@
+       @echo "Requires: xmlrpc++ xmlrpc xmlrpc_server++ xmlrpc_abyss xmlrpc_util++ xmlrpc_util"    >>$@
+-      @echo "Libs:     -L$(LIBDESTDIR) -lxmlrpc_server_abyss"            >>$@
+-      @echo "Cflags:   -I$(HEADERDESTDIR)"                               >>$@
++      @echo 'Libs:     -L$${libdir} -lxmlrpc_server_abyss++'             >>$@
++      @echo 'Cflags:   -I$${includedir}'                                 >>$@
+ xmlrpc_server_pstream++.pc:
+       rm -f $@
+       @echo "Echoes to '$@' suppressed here ..."
++      @echo -e '$(PKGCONFIG_VAR_SET)'                                    >>$@
++      @echo                                                              >>$@
+       @echo "Name:        xmlrpc_server_pstream"                         >>$@
+       @echo "Description: Xmlrpc-c packet stream XML-RPC server library" >>$@
+       @echo "Version:     $(XMLRPC_VERSION_STRING)"                      >>$@
+       @echo                                                              >>$@
+-      @echo "Requires: xmlrpc++ xmlrpc xmlrpc_server++ xmlrpc_util++ xmlrpc_util"                 >>$@
+-      @echo "Libs:     -L$(LIBDESTDIR) -lxmlrpc_server_pstream++ -lxmlrpc_packetsocket"              >>$@
+-      @echo "Cflags:   -I$(HEADERDESTDIR)"                               >>$@
++      @echo "Requires: xmlrpc++ xmlrpc xmlrpc_server++ xmlrpc_util++ xmlrpc_util" >>$@
++      @echo 'Libs:     -L$${libdir} -lxmlrpc_server_pstream++' -lxmlrpc_packetsocket >>$@
++      @echo 'Cflags:   -I$${includedir}'                                 >>$@
+ #-----------------------------------------------------------------------------
+ #  MISCELLANEOUS RULES
+--- a/common.mk
++++ b/common.mk
+@@ -584,6 +584,11 @@ PROGRAMDESTDIR   = $(DESTDIR)$(PROGRAMIN
+ MANDESTDIR       = $(DESTDIR)$(MANINST_DIR)
+ PKGCONFIGDESTDIR = $(DESTDIR)$(PKGCONFIGINST_DIR)
++# The following value, in a pkg-config file, sets the conventional pkg-config
++# variables that the pkg-config user can override at pkg-config time.
++PKGCONFIG_VAR_SET = \
++  prefix=$(PREFIX)\nexec_prefix=$${prefix}\nincludedir=$${prefix}/include\nlibdir=$${exec_prefix}/lib
++
+ ##############################################################################
+ #                           INSTALL RULES                                    #