diff options
author | Luca Weiss <luca@z3ntu.xyz> | 2020-09-06 21:44:23 +0200 |
---|---|---|
committer | Leo <thinkabit.ukim@gmail.com> | 2020-09-07 02:34:51 +0000 |
commit | 470d6920a175f591cd9ba087a90daba022415ece (patch) | |
tree | b0fce574cc389e166c2230e96f934ec4701e4a31 | |
parent | 0ed516feaee0403528c3ebc5829cf49e76f703a1 (diff) |
community/date: new aport
-rw-r--r-- | community/date/538-output-date-pc-for-pkg-config.patch | 60 | ||||
-rw-r--r-- | community/date/APKBUILD | 38 |
2 files changed, 98 insertions, 0 deletions
diff --git a/community/date/538-output-date-pc-for-pkg-config.patch b/community/date/538-output-date-pc-for-pkg-config.patch new file mode 100644 index 00000000000..d20af66b16d --- /dev/null +++ b/community/date/538-output-date-pc-for-pkg-config.patch @@ -0,0 +1,60 @@ +From e56b2dce7e89a92e1b9b35caa13b3e938c4cedea Mon Sep 17 00:00:00 2001 +From: Cole Mickens <cole.mickens@gmail.com> +Date: Sun, 26 Jan 2020 01:27:08 -0800 +Subject: [PATCH] CMakeLists.txt: output date.pc for pkg-config + +--- + CMakeLists.txt | 15 +++++++++++++++ + date.pc.in | 10 ++++++++++ + 2 files changed, 25 insertions(+) + create mode 100644 date.pc.in + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f30c473..fe778e8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -128,6 +128,15 @@ if( BUILD_TZ_LIB ) + endif( ) + endif( ) + ++if ( BUILD_TZ_LIB ) ++ # Cflags: -I${includedir} @TZ_COMPILE_DEFINITIONS@ ++ set( TZ_COMPILE_DEFINITIONS "$<IF:$<TARGET_EXISTS:date-tz>,-D$<JOIN:$<TARGET_PROPERTY:date-tz,INTERFACE_COMPILE_DEFINITIONS>, -D>,>" ) ++ configure_file(date.pc.in date.pc.cf @ONLY) ++ file( GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/date.pc" ++ INPUT "${CMAKE_CURRENT_BINARY_DIR}/date.pc.cf" ) ++ ++endif( ) ++ + #[===================================================================[ + installation + #]===================================================================] +@@ -171,6 +180,12 @@ install ( + FILES cmake/dateConfig.cmake "${version_config}" + DESTINATION ${CONFIG_LOC}) + ++if ( BUILD_TZ_LIB ) ++ install( ++ FILES ${CMAKE_BINARY_DIR}/date.pc ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) ++endif( ) ++ + #[===================================================================[ + testing + #]===================================================================] +diff --git a/date.pc.in b/date.pc.in +new file mode 100644 +index 0000000..b9c4623 +--- /dev/null ++++ b/date.pc.in +@@ -0,0 +1,10 @@ ++prefix=@CMAKE_INSTALL_PREFIX@ ++exec_prefix=@CMAKE_INSTALL_BINDIR@ ++libdir=@CMAKE_INSTALL_LIB@ ++includedir=@CMAKE_INSTALL_INCLUDE@ ++ ++Name: date ++Description: A date and time library based on the C++11/14/17 <chrono> header ++Version: @PACKAGE_VERSION@ ++Libs: -L${libdir} -ldate-tz ++Cflags: -I${includedir} @TZ_COMPILE_DEFINITIONS@ diff --git a/community/date/APKBUILD b/community/date/APKBUILD new file mode 100644 index 00000000000..0e20a9360f8 --- /dev/null +++ b/community/date/APKBUILD @@ -0,0 +1,38 @@ +# Maintainer: Luca Weiss <luca@z3ntu.xyz> +pkgname=date +pkgver=3.0.0 +pkgrel=0 +pkgdesc="Date and time library based on the C++11/14/17 <chrono> header" +arch="all" +url="https://howardhinnant.github.io/date/date.html" +license="MIT" +makedepends="cmake" +checkdepends="bash" +source="https://github.com/HowardHinnant/date/archive/v$pkgver/date-v$pkgver.tar.gz + 538-output-date-pc-for-pkg-config.patch + " +subpackages="$pkgname-dev" +options="!check" # Several tests fail - see also https://github.com/HowardHinnant/date/issues/334 + +build() { + cmake -B build \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DBUILD_SHARED_LIBS=true \ + -DBUILD_TZ_LIB=true \ + -DUSE_SYSTEM_TZ_DB=true \ + -DENABLE_DATE_TESTING=true \ + -Wno-dev + cmake --build build +} + +check() { + cmake --build build --target testit +} + +package() { + DESTDIR="$pkgdir" cmake --build build --target install +} +sha512sums="03ba0faef68e053aba888591b9350af1a043ef543825c80b1ca3f0dc0448697f56286e561f1a2a59e684680d7fc1e51fd24955c4cc222fe28db64f56037dc1aa date-v3.0.0.tar.gz +c92e9bc76554859687b0d1a7b0e09ab1044cc46a208e57ea112fcc87d5ed1e8fd21b195079dacbc17adf7830dd4e0b10deb67859263c26822f57225316c27e10 538-output-date-pc-for-pkg-config.patch" |