Commit fb3a7863 authored by grembo's avatar grembo
Browse files

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>
parent 66599027
......@@ -852,6 +852,7 @@
SUBDIR += hgreviewboard
SUBDIR += hgsvn
SUBDIR += hgview
SUBDIR += hhdate
SUBDIR += highlighterkit
SUBDIR += hive
SUBDIR += horde-content
......
# 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>
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
# $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
// 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';
}
}
A date and time library based on the C++11 (and beyond) <chrono> header.
WWW: https://github.com/HowardHinnant/date
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment