From 26501ed5145a319c46977265a7c488fa6bee71a3 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Sat, 20 Jun 2020 21:26:46 +0000 Subject: MFH: r539750 r539751 ports-mgmt/pkg: Respect liblzma.pc if available. ports-mgmt/pkg-devel: Respect liblzma.pc if available. Note that this is meant to be a temporary hack and will be reverted once the freebsd/pkg have solved this in the build infrastructure. PR: 200142 Approved by: portmgr (bapt over IRC) --- ports-mgmt/pkg-devel/Makefile | 12 ++++++++++++ ports-mgmt/pkg/Makefile | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/ports-mgmt/pkg-devel/Makefile b/ports-mgmt/pkg-devel/Makefile index 1a054c4a01a6..87d851210d83 100644 --- a/ports-mgmt/pkg-devel/Makefile +++ b/ports-mgmt/pkg-devel/Makefile @@ -2,6 +2,7 @@ PORTNAME= pkg DISTVERSION= 1.13.99.7 +PORTREVISION= 1 _PKG_VERSION= ${DISTVERSION} CATEGORIES= ports-mgmt PKGNAMESUFFIX= -devel @@ -35,6 +36,13 @@ EXTRA_PATCHES= ${FILESDIR}/extra-patch-docs_pkg.8 .include +.if !exists(/usr/libdata/pkgconfig/liblzma.pc) +LIBLZMA_LIBS= -llzma +.else +LIBLZMA_PC!= ${EGREP} ^Libs /usr/libdata/pkgconfig/liblzma.pc +LIBLZMA_LIBS= ${LIBLZMA_PC:M-l*} +.endif + .if defined(WITH_PKG) .if ${WITH_PKG} != devel . if !defined(PACKAGE_BUILDING) @@ -52,6 +60,10 @@ PKG_DEPENDS= PKG_BIN= ${WRKSRC}/src/pkg-static .endif +post-patch: + ${REINPLACE_CMD} -e "s|-llzma|${LIBLZMA_LIBS}|g" ${WRKSRC}/auto.def \ + ${WRKSRC}/src/Makefile.autosetup ${WRKSRC}/tests/Makefile.autosetup + post-install: @${MKDIR} ${STAGEDIR}${PREFIX}/lib/compat/pkg @${MKDIR} ${STAGEDIR}${DOCSDIR} diff --git a/ports-mgmt/pkg/Makefile b/ports-mgmt/pkg/Makefile index 0df3123d99b6..d290b5b85738 100644 --- a/ports-mgmt/pkg/Makefile +++ b/ports-mgmt/pkg/Makefile @@ -2,6 +2,7 @@ PORTNAME= pkg DISTVERSION= 1.13.2 +PORTREVISION= 1 _PKG_VERSION= ${DISTVERSION} CATEGORIES= ports-mgmt #MASTER_SITES= \ @@ -71,6 +72,13 @@ pre-everything:: .endif .endif +.if !exists(/usr/libdata/pkgconfig/liblzma.pc) +LIBLZMA_LIBS= -llzma +.else +LIBLZMA_PC!= ${EGREP} ^Libs /usr/libdata/pkgconfig/liblzma.pc +LIBLZMA_LIBS= ${LIBLZMA_PC:M-l*} +.endif + #define PKG_DEPENDS to nothing to avoid infinite loop looking for pkg :) PKG_DEPENDS= .undef INSTALLS_DEPENDS @@ -81,6 +89,10 @@ PKG_DEPENDS= PKG_BIN= ${WRKSRC}/src/pkg-static .endif +post-patch: + ${REINPLACE_CMD} -e "s|-llzma|${LIBLZMA_LIBS}|g" ${WRKSRC}/auto.def \ + ${WRKSRC}/src/Makefile.autosetup ${WRKSRC}/tests/Makefile.autosetup + post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/NEWS ${STAGEDIR}${DOCSDIR}/NEWS -- cgit v1.2.3