2
0
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-30 01:23:03 +00:00
nixpkgs/pkgs/development/libraries/cctz/default.nix
maj0e fee7c83587 cctz: fix static build
The install targets were "install_hdrs"
and "install_shared_lib". The later is obviously not
correct for a static build and was changed to
"install_lib" (corresponds to libcctz.a) for that case.
2022-09-21 22:50:52 +02:00

36 lines
981 B
Nix

{ lib, stdenv, fetchFromGitHub, Foundation }:
stdenv.mkDerivation rec {
pname = "cctz";
version = "2.3";
src = fetchFromGitHub {
owner = "google";
repo = "cctz";
rev = "v${version}";
sha256 = "0254xfwscfkjc3fbvx6qgifr3pwkc2rb03z8pbvvqy098di9alhr";
};
makeFlags = [ "PREFIX=$(out)" ];
buildInputs = lib.optional stdenv.isDarwin Foundation;
installTargets = [ "install_hdrs" ]
++ lib.optional (!stdenv.targetPlatform.isStatic) "install_shared_lib"
++ lib.optional stdenv.targetPlatform.isStatic "install_lib";
postInstall = lib.optionalString stdenv.isDarwin ''
install_name_tool -id $out/lib/libcctz.so $out/lib/libcctz.so
'';
enableParallelBuilding = true;
meta = with lib; {
homepage = "https://github.com/google/cctz";
description = "C++ library for translating between absolute and civil times";
license = licenses.asl20;
maintainers = with maintainers; [ orivej ];
platforms = platforms.all;
};
}