1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 13:41:26 +00:00
nixpkgs/pkgs/os-specific/solo5/default.nix

61 lines
1.5 KiB
Nix
Raw Normal View History

2021-01-24 11:17:26 +00:00
{ lib, stdenv, fetchurl, pkg-config, libseccomp, util-linux, qemu }:
2020-10-08 15:20:39 +01:00
2021-02-06 19:20:57 +00:00
let version = "0.6.8";
2020-10-08 15:20:39 +01:00
in stdenv.mkDerivation {
pname = "solo5";
inherit version;
nativeBuildInputs = [ pkg-config ];
2020-10-08 15:20:39 +01:00
buildInputs = lib.optional (stdenv.hostPlatform.isLinux) libseccomp;
src = fetchurl {
url =
"https://github.com/Solo5/solo5/releases/download/v${version}/solo5-v${version}.tar.gz";
2021-02-06 19:20:57 +00:00
sha256 = "sha256-zrxNCXJIuEbtE3YNRK8Bxu2koHsQkcF+xItoIyhj9Uc=";
2020-10-08 15:20:39 +01:00
};
hardeningEnable = [ "pie" ];
configurePhase = ''
runHook preConfigure
sh configure.sh
runHook postConfigure
'';
enableParallelBuilding = true;
installPhase = ''
runHook preInstall
export DESTDIR=$out
export PREFIX=$out
make install-tools
${lib.optionalString stdenv.hostPlatform.isLinux "make ${
(lib.concatMapStringsSep " " (x: "install-opam-${x}") [ "hvt" "spt" ])
}"}
runHook postInstall
'';
doCheck = true;
2021-01-24 11:17:26 +00:00
checkInputs = [ util-linux qemu ];
2020-10-08 15:20:39 +01:00
checkPhase = if stdenv.hostPlatform.isLinux then
''
patchShebangs tests
./tests/bats-core/bats ./tests/tests.bats
''
else
null;
meta = with lib; {
description = "Sandboxed execution environment";
2020-10-08 15:20:39 +01:00
homepage = "https://github.com/solo5/solo5";
license = licenses.isc;
maintainers = [ maintainers.ehmry ];
platforms = builtins.map ({arch, os}: "${arch}-${os}")
(cartesianProductOfSets {
arch = [ "aarch64" "x86_64" ];
os = [ "freebsd" "genode" "linux" "openbsd" ];
});
2020-10-08 15:20:39 +01:00
};
}