nixexprs/liberty-master.nix

57 lines
1019 B
Nix
Raw Normal View History

2023-06-29 02:31:03 +02:00
{ pkgs ? import <nixpkgs> { }
, local ? false
, full ? true
}:
pkgs.stdenv.mkDerivation rec {
pname = "liberty";
version = "master";
nativeBuildInputs = with pkgs; [
cmake
pkg-config
go
nodejs
2023-07-06 06:42:48 +02:00
] ++ lib.optionals stdenv.isDarwin [
# This was broken on Linux.
2023-06-29 02:31:03 +02:00
swift
];
buildInputs = with pkgs; [
openssl
];
src = if local then
builtins.path {
path = ../${pname}/git;
name = "${pname}";
}
else
fetchGit {
url = "https://git.janouch.name/p/${pname}.git";
submodules = true;
ref = "master";
};
doCheck = true;
# "go vet" creates a build cache within HOME.
checkPhase = ''
runHook preCheck
HOME=$(pwd) ctest --force-new-ctest-process
runHook postCheck
'';
# There is no installation target thus far, don't let nix-build fail.
installPhase = ''
mkdir -p $out
'';
meta = with pkgs.lib; {
description = "Core header libraries and utilities";
homepage = "https://git.janouch.name/p/${pname}";
platforms = platforms.all;
license = licenses.bsd0;
};
}