2021-09-18 10:52:07 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, tzdata, fetchpatch, substituteAll }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-09-18 10:52:07 +00:00
|
|
|
pname = "howard-hinnant-date";
|
|
|
|
version = "3.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "HowardHinnant";
|
|
|
|
repo = "date";
|
2021-09-18 10:52:07 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1qk7pgnk0bpinja28104qha6f7r1xwh5dy3gra7vjkqwl0jdwa35";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2021-09-18 10:52:07 +00:00
|
|
|
# Add pkg-config file
|
|
|
|
# https://github.com/HowardHinnant/date/pull/538
|
2020-04-24 23:36:52 +00:00
|
|
|
(fetchpatch {
|
2021-09-18 10:52:07 +00:00
|
|
|
name = "output-date-pc-for-pkg-config.patch";
|
|
|
|
url = "https://git.alpinelinux.org/aports/plain/community/date/538-output-date-pc-for-pkg-config.patch?id=11f6b4d4206b0648182e7b41cd57dcc9ccea0728";
|
|
|
|
sha256 = "1ma0586jsd89jgwbmd2qlvlc8pshs1pc4zk5drgxi3qvp8ai1154";
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
2022-11-04 12:27:35 +00:00
|
|
|
# Fix CMake include directory path.
|
|
|
|
# https://github.com/HowardHinnant/date/pull/753
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-cmake-include-dir.patch";
|
|
|
|
url = "https://github.com/HowardHinnant/date/commit/8061b53c489b0c8676feedcb65049b27664327b5.patch";
|
|
|
|
hash = "sha256-weZUgu0SDad7EK7msUbVzk1zY4euI0Biafj/5jD4JV4=";
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
# Without this patch, this library will drop a `tzdata` directory into
|
|
|
|
# `~/Downloads` if it cannot find `/usr/share/zoneinfo`. Make the path it
|
|
|
|
# searches for `zoneinfo` be the one from the `tzdata` package.
|
|
|
|
(substituteAll {
|
|
|
|
src = ./make-zoneinfo-available.diff;
|
|
|
|
inherit tzdata;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_TZ_LIB=true"
|
|
|
|
"-DBUILD_SHARED_LIBS=true"
|
|
|
|
"-DUSE_SYSTEM_TZ_DB=true"
|
|
|
|
];
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
description = "A date and time library based on the C++11/14/17 <chrono> header";
|
|
|
|
homepage = "https://github.com/HowardHinnant/date";
|
|
|
|
platforms = platforms.linux;
|
2021-09-18 10:52:07 +00:00
|
|
|
maintainers = with maintainers; [ r-burns ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|