aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2020-06-20 21:26:46 +0000
committerXin LI <delphij@FreeBSD.org>2020-06-20 21:26:46 +0000
commit26501ed5145a319c46977265a7c488fa6bee71a3 (patch)
treeb3bb819a235c5d20c5c0c6325e62ab95d4e561b4
parentb5927dc68478eb63a3dd48437d16f7c5223ad745 (diff)
downloadports-26501ed5145a319c46977265a7c488fa6bee71a3.tar.gz
ports-26501ed5145a319c46977265a7c488fa6bee71a3.zip
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)
Notes
Notes: svn path=/branches/2020Q2/; revision=539752
-rw-r--r--ports-mgmt/pkg-devel/Makefile12
-rw-r--r--ports-mgmt/pkg/Makefile12
2 files changed, 24 insertions, 0 deletions
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 <bsd.port.pre.mk>
+.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