diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-12-17 17:49:39 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-12-24 17:23:52 +0000 |
commit | c76deaef9caa3156a25b2df2a036b4994f9ed7a7 (patch) | |
tree | 47d70d576a4f1e89150b0936de70fcf24b8d4153 /pkgs/applications/virtualization/crosvm/default.nix | |
parent | 0c62e73b37fa86b87ee28a10e2ca727419992436 (diff) | |
download | nixlib-c76deaef9caa3156a25b2df2a036b4994f9ed7a7.tar nixlib-c76deaef9caa3156a25b2df2a036b4994f9ed7a7.tar.gz nixlib-c76deaef9caa3156a25b2df2a036b4994f9ed7a7.tar.bz2 nixlib-c76deaef9caa3156a25b2df2a036b4994f9ed7a7.tar.lz nixlib-c76deaef9caa3156a25b2df2a036b4994f9ed7a7.tar.xz nixlib-c76deaef9caa3156a25b2df2a036b4994f9ed7a7.tar.zst nixlib-c76deaef9caa3156a25b2df2a036b4994f9ed7a7.zip |
crosvm: 77.12371.0.0-rc1 -> 79.12607.0.0-rc4
Replaced src munging with a custom unpackPhase because the previous approach couldn't handle a newly introduced path with a space, and this is cleaner anyway (but was impossible at the time due to unpackPhase not being forwarded to fetchcargo).
Diffstat (limited to 'pkgs/applications/virtualization/crosvm/default.nix')
-rw-r--r-- | pkgs/applications/virtualization/crosvm/default.nix | 67 |
1 files changed, 36 insertions, 31 deletions
diff --git a/pkgs/applications/virtualization/crosvm/default.nix b/pkgs/applications/virtualization/crosvm/default.nix index 5c10614e8569..5035b65f9818 100644 --- a/pkgs/applications/virtualization/crosvm/default.nix +++ b/pkgs/applications/virtualization/crosvm/default.nix @@ -11,32 +11,15 @@ let else if isx86_64 then "x86_64" else throw "no seccomp policy files available for host platform"; - # used to turn symlinks into real files because write permissions are necessary for the vendoring process - delink = src: runCommand "${src.name}-delinked" { - preferLocalBuild = true; - allowSubstitutes = false; - } '' - cp -prL --reflink=auto ${src} $out - ''; - - # used to place subtrees into the location they have in the Chromium monorepo - move = src: target: runCommand "moved-${src.name}" { - preferLocalBuild = true; - allowSubstitutes = false; - } '' - mkdir -p $(dirname $out/${target}) - ln -s ${src} $out/${target} - ''; - - # used to check out subtrees from the Chromium monorepo - chromiumSource = name: subtrees: delink (symlinkJoin { - inherit name; - paths = stdenv.lib.mapAttrsToList ( - location: { url, rev, sha256, fetchSubmodules, ... }: - move (fetchgit { - inherit url rev sha256 fetchSubmodules; - }) location) subtrees; - }); + crosvmSrc = fetchgit { + inherit (upstreamInfo.components."chromiumos/platform/crosvm") + url rev sha256 fetchSubmodules; + }; + + adhdSrc = fetchgit { + inherit (upstreamInfo.components."chromiumos/third_party/adhd") + url rev sha256 fetchSubmodules; + }; in @@ -44,15 +27,33 @@ in pname = "crosvm"; inherit (upstreamInfo) version; - src = chromiumSource "${pname}-sources" upstreamInfo.components; + unpackPhase = '' + runHook preUnpack + + mkdir -p chromiumos/platform chromiumos/third_party + + pushd chromiumos/platform + unpackFile ${crosvmSrc} + mv ${crosvmSrc.name} crosvm + popd + + pushd chromiumos/third_party + unpackFile ${adhdSrc} + mv ${adhdSrc.name} adhd + popd - sourceRoot = "${src.name}/chromiumos/platform/crosvm"; + chmod -R u+w -- "$sourceRoot" + + runHook postUnpack + ''; + + sourceRoot = "chromiumos/platform/crosvm"; patches = [ - ./default-seccomp-policy-dir.patch + ./default-seccomp-policy-dir.diff ]; - cargoSha256 = "16cfp79c13ng5jjcrvz00h3cg7cc9ywhjiq02vsm757knn9jgr1v"; + cargoSha256 = "1d7y07wkliy5qnlyx5zj6ni39avhs3s48sqgvwxm5g5zrahg2a85"; nativeBuildInputs = [ pkgconfig ]; @@ -72,7 +73,11 @@ in cp seccomp/${arch}/* $out/share/policy/ ''; - passthru.updateScript = ./update.py; + passthru = { + inherit adhdSrc; + src = crosvmSrc; + updateScript = ./update.py; + }; meta = with stdenv.lib; { description = "A secure virtual machine monitor for KVM"; |