aboutsummaryrefslogtreecommitdiff
path: root/devel/hhdate
diff options
context:
space:
mode:
authorMichael Gmelin <grembo@FreeBSD.org>2017-03-27 22:35:20 +0000
committerMichael Gmelin <grembo@FreeBSD.org>2017-03-27 22:35:20 +0000
commit1805c522714557eaac42239390289f7d9a35e2e4 (patch)
tree90d87355270b0ec30f6abb78d1bc0287da9df65d /devel/hhdate
parenta8c77abf6a8ab6344257cf29986a4859bc97cd54 (diff)
downloadports-1805c522714557eaac42239390289f7d9a35e2e4.tar.gz
ports-1805c522714557eaac42239390289f7d9a35e2e4.zip
Add hhdate 2.1.0.35, date and time library based on the C++11 (and
beyond) <chrono> header. PR: 218030 Submitted by: Andreas Sommer <andreas.sommer87@googlemail.com>
Notes
Notes: svn path=/head/; revision=437089
Diffstat (limited to 'devel/hhdate')
-rw-r--r--devel/hhdate/Makefile47
-rw-r--r--devel/hhdate/distinfo3
-rw-r--r--devel/hhdate/files/Makefile.in8
-rw-r--r--devel/hhdate/files/test-minimal.cpp21
-rw-r--r--devel/hhdate/pkg-descr3
5 files changed, 82 insertions, 0 deletions
diff --git a/devel/hhdate/Makefile b/devel/hhdate/Makefile
new file mode 100644
index 000000000000..010541a5daed
--- /dev/null
+++ b/devel/hhdate/Makefile
@@ -0,0 +1,47 @@
+# Created by: Andreas Sommer <andreas.sommer87@googlemail.com>
+# $FreeBSD$
+
+PORTNAME= hhdate
+# New versions aren't released often, so using the number of commits since
+# last release as a.b.c.NUMCOMMITS (see `git describe --tags ${GH_TAGNAME}`).
+# 35 = commit a little after 2.1.0 to have LICENSE file and fixed unit tests.
+PORTVERSION= 2.1.0.35
+CATEGORIES= devel
+
+MAINTAINER= andreas.sommer87@googlemail.com
+COMMENT= Date and time library based on the C++11 (and beyond) <chrono> header
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE.txt
+
+USE_GITHUB= yes
+GH_ACCOUNT= HowardHinnant
+GH_PROJECT= date
+GH_TAGNAME= 3ab6510cab764c1a20926b1e8442af4c9e8a16b2
+
+NO_ARCH= yes
+NO_BUILD= yes
+
+PLIST_FILES= include/hhdate/date.h
+
+# TODO add timezone support when interest grows
+OPTIONS_DEFINE= TEST
+TEST_DESC= Build with minimal tests
+TEST_ENV= ${MAKE_ENV} WRKDIR=${WRKDIR}
+TEST_USES= compiler:c++11-lib
+TEST_TEST_TARGET= test
+USE_CXXSTD= c++11
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MTEST}
+post-extract:
+ ${INSTALL_DATA} ${FILESDIR}/Makefile.in ${WRKSRC}/Makefile
+ ${INSTALL_DATA} ${FILESDIR}/test-minimal.cpp ${WRKSRC}/test/test-minimal.cpp
+.endif
+
+do-install:
+ @${MKDIR} ${STAGEDIR}${PREFIX}/include/hhdate
+ ${INSTALL_DATA} ${WRKSRC}/date.h ${STAGEDIR}${PREFIX}/include/hhdate/
+
+.include <bsd.port.mk>
diff --git a/devel/hhdate/distinfo b/devel/hhdate/distinfo
new file mode 100644
index 000000000000..0e7c318dc463
--- /dev/null
+++ b/devel/hhdate/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1490643114
+SHA256 (HowardHinnant-date-2.1.0.35-3ab6510cab764c1a20926b1e8442af4c9e8a16b2_GH0.tar.gz) = 3b0e98ec702a2e53dda919b3fb77fa094c262829c2cda99813fe8cea43c79126
+SIZE (HowardHinnant-date-2.1.0.35-3ab6510cab764c1a20926b1e8442af4c9e8a16b2_GH0.tar.gz) = 776175
diff --git a/devel/hhdate/files/Makefile.in b/devel/hhdate/files/Makefile.in
new file mode 100644
index 000000000000..f64c4066b7b4
--- /dev/null
+++ b/devel/hhdate/files/Makefile.in
@@ -0,0 +1,8 @@
+# $FreeBSD$
+test:
+ @echo "Compiler in C++11 mode should compile minimal example"
+ ${CXX} ${CXXFLAGS} test/test-minimal.cpp \
+ -o ${WRKDIR}/test-minimal && \
+ ${WRKDIR}/test-minimal >/dev/null
+
+.PHONY: test
diff --git a/devel/hhdate/files/test-minimal.cpp b/devel/hhdate/files/test-minimal.cpp
new file mode 100644
index 000000000000..347a68524a89
--- /dev/null
+++ b/devel/hhdate/files/test-minimal.cpp
@@ -0,0 +1,21 @@
+// Small example taken from https://howardhinnant.github.io/date/date.html.
+// Only for testing installed header shortly.
+#include <iostream>
+
+#include "../date.h"
+
+int main()
+{
+ using namespace std;
+ using namespace date;
+ for (auto m = 1; m <= 12; ++m)
+ {
+ auto meet = year_month_day{m/fri[1]/2015};
+ cout << meet << '\n';
+ meet = meet.year()/meet.month()/(meet.day()+weeks{2});
+ cout << meet << '\n';
+ meet = meet.year()/meet.month()/(meet.day()+weeks{2});
+ if (meet.ok())
+ cout << meet << '\n';
+ }
+}
diff --git a/devel/hhdate/pkg-descr b/devel/hhdate/pkg-descr
new file mode 100644
index 000000000000..bda98e96b87c
--- /dev/null
+++ b/devel/hhdate/pkg-descr
@@ -0,0 +1,3 @@
+A date and time library based on the C++11 (and beyond) <chrono> header.
+
+WWW: https://github.com/HowardHinnant/date