1{
2 lib,
3 buildGraalvmNativeImage,
4 fetchurl,
5}:
6
7buildGraalvmNativeImage (finalAttrs: {
8 pname = "yamlscript";
9 version = "0.2.4";
10
11 src = fetchurl {
12 url = "https://github.com/yaml/yamlscript/releases/download/${finalAttrs.version}/yamlscript.cli-${finalAttrs.version}-standalone.jar";
13 hash = "sha256-iNkHdKPrO0dgpvxGiRdvWIhnuh9yKySgYAcVNMUVQcU=";
14 };
15
16 extraNativeImageBuildArgs = [
17 "--native-image-info"
18 "--no-fallback"
19 "--initialize-at-build-time"
20 "--enable-preview"
21 "-H:+ReportExceptionStackTraces"
22 "-H:IncludeResources=SCI_VERSION"
23 "-H:Log=registerResource:"
24 "-J-Dclojure.spec.skip-macros=true"
25 "-J-Dclojure.compiler.direct-linking=true"
26 ];
27
28 doInstallCheck = true;
29
30 installCheckPhase = ''
31 runHook preInstallCheck
32
33 $out/bin/ys -e 'say: (+ 1 2)' | fgrep 3
34
35 runHook postInstallCheck
36 '';
37
38 meta = {
39 description = "Programming in YAML";
40 homepage = "https://github.com/yaml/yamlscript";
41 sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
42 license = lib.licenses.mit;
43 mainProgram = "ys";
44 maintainers = with lib.maintainers; [ sgo ];
45 };
46})