naersk/test/fast/git-dep-by-branch-with-slash/default.nix
2022-05-03 12:41:13 +02:00

35 lines
727 B
Nix

{ naersk, pkgs, ... }:
let
dep = pkgs.runCommand "dep" {
buildInputs = [ pkgs.git ];
} ''
mkdir $out
cd $out
cp -ar ${./fixtures/dep}/* .
git init --initial-branch=with/slash
git add .
git config user.email 'someone'
git config user.name 'someone'
git commit -am 'Initial commit'
'';
app = pkgs.runCommand "app" {
buildInputs = [ pkgs.git ];
} ''
mkdir $out
cd $out
cp -ar ${./fixtures/app}/* .
depPath="${dep}"
depRev=$(cd ${dep} && git rev-parse HEAD)
sed "s:\$depPath:$depPath:" -is Cargo.*
sed "s:\$depRev:$depRev:" -is Cargo.*
'';
in
naersk.buildPackage {
src = app;
doCheck = true;
cargoOptions = (opts: opts ++ [ "--locked" ]);
}