nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5}:
6
7stdenv.mkDerivation rec {
8 pname = "cctz";
9 version = "2.5";
10
11 src = fetchFromGitHub {
12 owner = "google";
13 repo = "cctz";
14 rev = "v${version}";
15 sha256 = "sha256-YCE0DXuOT5tCOfLlemMH7I2F8c7HEK1NEUJvtfqnCg8=";
16 };
17
18 env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-framework CoreFoundation";
19
20 makeFlags = [ "PREFIX=$(out)" ];
21
22 installTargets = [
23 "install_hdrs"
24 ]
25 ++ lib.optional (!stdenv.hostPlatform.isStatic) "install_shared_lib"
26 ++ lib.optional stdenv.hostPlatform.isStatic "install_lib";
27
28 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
29 install_name_tool -id $out/lib/libcctz.so $out/lib/libcctz.so
30 '';
31
32 enableParallelBuilding = true;
33
34 meta = with lib; {
35 homepage = "https://github.com/google/cctz";
36 description = "C++ library for translating between absolute and civil times";
37 license = licenses.asl20;
38 maintainers = with maintainers; [ orivej ];
39 platforms = platforms.all;
40 };
41}