From dd8423f86550ef7a63d704b220d361e977142b29 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Thu, 8 Oct 2020 16:20:39 +0200 Subject: [PATCH] solo5: init 0.6.7 --- pkgs/os-specific/solo5/default.nix | 58 ++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 60 insertions(+) create mode 100644 pkgs/os-specific/solo5/default.nix diff --git a/pkgs/os-specific/solo5/default.nix b/pkgs/os-specific/solo5/default.nix new file mode 100644 index 000000000000..689bc2f38579 --- /dev/null +++ b/pkgs/os-specific/solo5/default.nix @@ -0,0 +1,58 @@ +{ lib, stdenv, fetchurl, pkgconfig, libseccomp }: + +let version = "0.6.7"; +in stdenv.mkDerivation { + pname = "solo5"; + inherit version; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = lib.optional (stdenv.hostPlatform.isLinux) libseccomp; + + src = fetchurl { + url = + "https://github.com/Solo5/solo5/releases/download/v${version}/solo5-v${version}.tar.gz"; + sha256 = "05k9adg3440zk5baa6ry8z5dj8d8r8hvzafh2469pdgcnr6h45gr"; + }; + + 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; + checkPhase = if stdenv.hostPlatform.isLinux then + '' + patchShebangs tests + ./tests/bats-core/bats ./tests/tests.bats + '' + else + null; + + meta = with lib; { + description = "Sandboxed execution environment."; + homepage = "https://github.com/solo5/solo5"; + license = licenses.isc; + maintainers = [ maintainers.ehmry ]; + platforms = lib.crossLists (arch: os: "${arch}-${os}") [ + [ "aarch64" "x86_64" ] + [ "freebsd" "genode" "linux" "openbsd" ] + ]; + }; + +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bc1ab0f1c081..646c068ee701 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18553,6 +18553,8 @@ in smimesign = callPackage ../os-specific/darwin/smimesign { }; + solo5 = callPackage ../os-specific/solo5 { }; + speedometer = callPackage ../os-specific/linux/speedometer { }; statik = callPackage ../development/tools/statik { };