diff mbox series

[OpenWrt-Devel,v2] zlib: Use relative paths in pkg-configmetadata file

Message ID 20190515143024.13070-1-jeffery.to@gmail.com
State Accepted
Delegated to: Petr Štetiar
Headers show
Series [OpenWrt-Devel,v2] zlib: Use relative paths in pkg-configmetadata file | expand

Commit Message

Jeffery To May 15, 2019, 2:30 p.m. UTC
The buildroot pkg-config (in staging_dir/host/bin) overrides the prefix
and exec_prefix variables in *.pc files, to supply the correct
(buildroot) paths for callers. If other variables are not defined
relative to prefix and exec_prefix, then the returned values will be
incorrect.

The default zlib.pc file generated by cmake contains absolute paths.
This patches the file to use relative paths (relative to ${prefix} and
${exec_prefix}).

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
---
v2: expanded commit message

 package/libs/zlib/Makefile                         |  2 +-
 .../patches/004-relative-pkg-config-paths.patch    | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 package/libs/zlib/patches/004-relative-pkg-config-paths.patch
diff mbox series

Patch

diff --git a/package/libs/zlib/Makefile b/package/libs/zlib/Makefile
index 4a2a0e53b0..c7a8415c79 100644
--- a/package/libs/zlib/Makefile
+++ b/package/libs/zlib/Makefile
@@ -9,7 +9,7 @@  include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zlib
 PKG_VERSION:=1.2.11
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@SF/libpng http://www.zlib.net
diff --git a/package/libs/zlib/patches/004-relative-pkg-config-paths.patch b/package/libs/zlib/patches/004-relative-pkg-config-paths.patch
new file mode 100644
index 0000000000..c86d19b412
--- /dev/null
+++ b/package/libs/zlib/patches/004-relative-pkg-config-paths.patch
@@ -0,0 +1,14 @@ 
+--- a/zlib.pc.cmakein
++++ b/zlib.pc.cmakein
+@@ -1,8 +1,8 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=@CMAKE_INSTALL_PREFIX@
+-libdir=@INSTALL_LIB_DIR@
+-sharedlibdir=@INSTALL_LIB_DIR@
+-includedir=@INSTALL_INC_DIR@
++libdir=${exec_prefix}/lib
++sharedlibdir=${exec_prefix}/lib
++includedir=${prefix}/include
+ 
+ Name: zlib
+ Description: zlib compression library