My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

39 lines
789 B

{ stdenv
, lib
, makeWrapper
, rakudo
}:
{ pname
, version
, src
, buildInputs ? []
, nativeBuildInputs ? []
, rakuPackages ? []
}:
let
pname' = "raku-${rakudo.version}-${pname}";
rakuPath = lib.concatMapStrings (p: "{p}/lib/perl6/site_perl/${p.pname}-${p.version},") rakuPackages;
in
stdenv.mkDerivation {
pname = pname';
inherit src version;
nativeBuildInputs = [ makeWrapper ] ++ nativeBuildInputs;
buildInputs = [ rakudo ] ++ buildInputs;
dontBuild = true;
doCheck = true;
installPhase = ''
mkdir -p $out/lib/perl6/site_perl/
cp -r bin/ $out/bin
for bin in $out/bin/*; do
wrapProgram $bin --set RAKUDOLIB ${rakuPath}$out/lib/perl6/site_perl/${pname}-${version}
done
cp -r lib/ $out/lib/perl6/site_perl/${pname}-${version}
'';
}