summaryrefslogtreecommitdiff
path: root/archivers/zstd/Makefile
diff options
context:
space:
mode:
authorDaniel Engberg <diizzy@FreeBSD.org>2023-04-05 08:12:08 +0200
committerDaniel Engberg <diizzy@FreeBSD.org>2023-04-05 08:12:14 +0200
commit72ad532057c9f9fb6fa370c80f663c005e9dd021 (patch)
treee4dc259e5457529f0e6cf7c4d4e0d91048df3466 /archivers/zstd/Makefile
parentsysutils/py-ansible-lint: update to 6.14.4 (diff)
archivers/zstd: Add CMake config files and adjust Makefile
- Use upstream's short test for "make test" - Use verbose output by default during build * Tweak Makefile to follow Porters Handbook more closely * Install CMake files (taken from CMake build framework) PR: 267652 Reported by: fluffy Approved by: portmgr (maintainer timeout, 1+ month)
Diffstat (limited to 'archivers/zstd/Makefile')
-rw-r--r--archivers/zstd/Makefile45
1 files changed, 36 insertions, 9 deletions
diff --git a/archivers/zstd/Makefile b/archivers/zstd/Makefile
index bd01c4aeeff0..40687a6a7855 100644
--- a/archivers/zstd/Makefile
+++ b/archivers/zstd/Makefile
@@ -1,7 +1,8 @@
PORTNAME= zstd
-PORTVERSION= 1.5.4
+DISTVERSION= 1.5.4
+PORTREVISION= 1
CATEGORIES= archivers
-MASTER_SITES= https://github.com/facebook/zstd/releases/download/v${PORTVERSION}/
+MASTER_SITES= https://github.com/facebook/zstd/releases/download/v${DISTVERSION}/
MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Fast real-time compression algorithm
@@ -16,27 +17,53 @@ LICENSE_FILE_GPLv2= ${WRKSRC}/COPYING
LIB_DEPENDS= liblz4.so:archivers/liblz4
USES= gmake localbase:ldflags tar:zst
+USE_LDCONFIG= yes
ALL_TARGET= default
+TEST_TARGET= shortest
BINARY_ALIAS= gmd5sum=md5sum
-TEST_TARGET= test
MAKE_ENV= INSTALL_DATA="${INSTALL_DATA}" \
INSTALL_MAN="${INSTALL_MAN}" \
INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
- INSTALL_SCRIPT="${INSTALL_SCRIPT}"
-USE_LDCONFIG= yes
+ INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
+ V=1
+
+.if defined(WITH_DEBUG)
+BUILD_TYPE= Debug
+.else
+BUILD_TYPE= Release
+.endif
-PLIST_SUB= PORTVERSION=${PORTVERSION}
+PLIST_SUB= DISTVERSION=${DISTVERSION} \
+ BUILD_TYPE=${BUILD_TYPE:tl}
OPTIONS_DEFINE= OPTIMIZED_CFLAGS
OPTIMIZED_CFLAGS_VARS= CFLAGS+=-O3
post-build:
- cd ${WRKSRC}/programs && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} zstd-frugal
+ cd ${BUILD_WRKSRC}/programs && ${DO_MAKE_BUILD} zstd-frugal
post-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/programs/zstd-frugal ${STAGEDIR}${PREFIX}/bin/zstd-frugal
- ${LN} -s zstd.1.gz ${STAGEDIR}${PREFIX}/man/man1/zstdmt.1.gz
+ ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/programs/zstd-frugal ${STAGEDIR}${PREFIX}/bin/zstd-frugal
+ ${MKDIR} ${STAGEDIR}${PREFIX}/lib/cmake/zstd
+ ${INSTALL_DATA} ${PATCHDIR}/zstdConfig.cmake.in \
+ ${STAGEDIR}${PREFIX}/lib/cmake/zstd/zstdConfig.cmake
+ ${INSTALL_DATA} ${PATCHDIR}/zstdConfigVersion.cmake.in \
+ ${STAGEDIR}${PREFIX}/lib/cmake/zstd/zstdConfigVersion.cmake
+ @${REINPLACE_CMD} -e 's|%%DISTVERSION%%|${DISTVERSION}|g' \
+ ${STAGEDIR}${PREFIX}/lib/cmake/zstd/zstdConfigVersion.cmake
+ ${INSTALL_DATA} ${PATCHDIR}/zstdTargets-BUILD_TYPE.cmake.in \
+ ${STAGEDIR}${PREFIX}/lib/cmake/zstd/zstdTargets-${BUILD_TYPE:tl}.cmake
+ @${REINPLACE_CMD} -e 's|%%BUILD_TYPE_CAPS%%|${BUILD_TYPE:tu}|g' \
+ ${STAGEDIR}${PREFIX}/lib/cmake/zstd/zstdTargets-${BUILD_TYPE:tl}.cmake
+ @${REINPLACE_CMD} -e 's|%%BUILD_TYPE_MIXED%%|${BUILD_TYPE}|g' \
+ ${STAGEDIR}${PREFIX}/lib/cmake/zstd/zstdTargets-${BUILD_TYPE:tl}.cmake
+ @${REINPLACE_CMD} -e 's|%%DISTVERSION%%|${DISTVERSION}|g' \
+ ${STAGEDIR}${PREFIX}/lib/cmake/zstd/zstdTargets-${BUILD_TYPE:tl}.cmake
+ ${INSTALL_DATA} ${PATCHDIR}/zstdTargets.cmake.in \
+ ${STAGEDIR}${PREFIX}/lib/cmake/zstd/zstdTargets.cmake
+ ${RM} ${STAGEDIR}${PREFIX}/lib/cmake/zstd/*.bak
+ ${RLN} zstd.1.gz ${STAGEDIR}${PREFIX}/man/man1/zstdmt.1.gz
.include <bsd.port.mk>