1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 rakudo,
6 makeBinaryWrapper,
7}:
8
9stdenv.mkDerivation (finalAttrs: {
10 pname = "zef";
11 version = "1.0.0";
12
13 src = fetchFromGitHub {
14 owner = "ugexe";
15 repo = "zef";
16 rev = "v${finalAttrs.version}";
17 hash = "sha256-TUsEevaxB8DYMNhAsF8qFf1owv5ML8xSyGS9C0IkfbI=";
18 };
19
20 nativeBuildInputs = [
21 makeBinaryWrapper
22 ];
23
24 buildInputs = [
25 rakudo
26 ];
27
28 installPhase = ''
29 runHook preInstall
30
31 mkdir -p "$out"
32 # TODO: Find better solution. zef stores cache stuff in $HOME with the
33 # default config.
34 env HOME=$TMPDIR ${rakudo}/bin/raku -I. ./bin/zef --/depends --/test-depends --/build-depends --install-to=$out install .
35
36 runHook postInstall
37 '';
38
39 postFixup = ''
40 wrapProgram $out/bin/zef --prefix RAKUDOLIB , "inst#$out"
41 '';
42
43 meta = {
44 description = "Raku / Perl6 Module Management";
45 homepage = "https://github.com/ugexe/zef";
46 license = lib.licenses.artistic2;
47 mainProgram = "zef";
48 maintainers = with lib.maintainers; [ sgo ];
49 platforms = lib.platforms.unix;
50 };
51})