git: ee6e908efd7e - 2022Q2 - math/barvinok: Fix fetch by switching to git-based fetch

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Tue, 19 Apr 2022 06:13:30 UTC
The branch 2022Q2 has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ee6e908efd7ec2fcb09ad837b2fe151dbac27695

commit ee6e908efd7ec2fcb09ad837b2fe151dbac27695
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-04-19 00:53:29 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-04-19 06:13:25 +0000

    math/barvinok: Fix fetch by switching to git-based fetch
    
    Reported by:    fallout
    
    (cherry picked from commit b532e502c29cae5261365937ed64783b238e73d9)
---
 math/barvinok/Makefile | 20 ++++++++++++++++++--
 math/barvinok/distinfo |  6 +++---
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/math/barvinok/Makefile b/math/barvinok/Makefile
index aa203ed3f13f..489de7d63f7e 100644
--- a/math/barvinok/Makefile
+++ b/math/barvinok/Makefile
@@ -2,20 +2,21 @@ PORTNAME=	barvinok
 DISTVERSION=	0.41.5
 PORTREVISION=	1
 CATEGORIES=	math
-MASTER_SITES=	http://barvinok.gforge.inria.fr/
+#MASTER_SITES=	http://barvinok.gforge.inria.fr/ # unavailable as of April 2022
 
 MAINTAINER=	yuri@FreeBSD.org
 COMMENT=	Library for counting the number of integer points in polytopes
 
 LICENSE=	GPLv2
 
+FETCH_DEPENDS=	git:devel/git
 LIB_DEPENDS=	libglpk.so:math/glpk \
 		libgmp.so:math/gmp \
 		libisl.so:devel/isl \
 		libntl.so:math/ntl \
 		libpolylibgmp.so:math/polylib
 
-USES=		compiler:c11 gmake libtool localbase:ldflags pkgconfig
+USES=		autoreconf compiler:c11 gmake libtool localbase:ldflags pkgconfig
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--disable-static --enable-shared --enable-shared-barvinok \
 		--with-gmp=system --with-polylib=system --with-isl=system
@@ -23,4 +24,19 @@ USE_LDCONFIG=	yes
 
 INSTALL_TARGET=	install-strip
 
+GIT_URL=	https://repo.or.cz/barvinok.git
+GIT_HASH=	c58bec4907e26b9f91a734cf96c18615733ed565
+
+do-fetch:
+	@if [ "${FORCE_FETCH_ALL}" = "true" ] || ! [ -f "${DISTDIR}/${DIST_SUBDIR}/${DISTNAME}${EXTRACT_SUFX}" ]; then \
+	  ${MKDIR} ${DISTDIR}/${DIST_SUBDIR} && \
+	  cd ${DISTDIR}/${DIST_SUBDIR} && \
+	    git clone -q ${GIT_URL} ${PORTNAME}-${DISTVERSIONFULL} && \
+	    (cd ${PORTNAME}-${DISTVERSIONFULL} && git reset -q --hard ${GIT_HASH} && ${RM} -r .git) && \
+	    ${FIND} ${PORTNAME}-${DISTVERSIONFULL} -and -exec ${TOUCH} -h -d 1970-01-01T00:00:00Z {} \; && \
+	    ${FIND} ${PORTNAME}-${DISTVERSIONFULL} -print0 | LC_ALL=C ${SORT} -z | \
+	        ${TAR} czf ${PORTNAME}-${DISTVERSIONFULL}${EXTRACT_SUFX} --format=bsdtar --gid 0 --uid 0 --options gzip:!timestamp --no-recursion --null -T - && \
+	    ${RM} -r ${PORTNAME}-${DISTVERSIONFULL}; \
+	fi
+
 .include <bsd.port.mk>
diff --git a/math/barvinok/distinfo b/math/barvinok/distinfo
index f9eec62fe639..76d9df691af1 100644
--- a/math/barvinok/distinfo
+++ b/math/barvinok/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1620536385
-SHA256 (barvinok-0.41.5.tar.gz) = 6834ed7588fcc60f1d96743cf6e4c23c3174a0cdd72c128e1d0d9714957145c0
-SIZE (barvinok-0.41.5.tar.gz) = 6275461
+TIMESTAMP = 1650328299
+SHA256 (barvinok-0.41.5.tar.gz) = 41b1cd9346b042b7e24aa8e14e65cd08765343940594c08f3c6894442312f860
+SIZE (barvinok-0.41.5.tar.gz) = 953626