From 205e32c7eabb1d16132f654d3de578a663df4c39 Mon Sep 17 00:00:00 2001 From: Toma <62384384+TomaSajt@users.noreply.github.com> Date: Sun, 6 Oct 2024 15:33:57 +0200 Subject: [PATCH] vyxal: init at 3.4.9 (#257860) --- pkgs/by-name/vy/vyxal/package.nix | 86 +++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 pkgs/by-name/vy/vyxal/package.nix diff --git a/pkgs/by-name/vy/vyxal/package.nix b/pkgs/by-name/vy/vyxal/package.nix new file mode 100644 index 000000000000..66b6d0a97b58 --- /dev/null +++ b/pkgs/by-name/vy/vyxal/package.nix @@ -0,0 +1,86 @@ +{ + lib, + stdenvNoCC, + clangStdenv, + fetchFromGitHub, + mill, + which, +}: + +let + # we need to lock the mill version, because an update will change the + # fetched internal dependencies, thus breaking the deps FOD + lockedMill = mill.overrideAttrs (oldAttrs: { + # should ideally match the version listed inside the `.mill-version` file of the source + version = "0.11.12"; + src = oldAttrs.src.overrideAttrs { + outputHash = "sha256-k4/oMHvtq5YXY8hRlX4gWN16ClfjXEAn6mRIoEBHNJo="; + }; + }); +in +clangStdenv.mkDerivation (finalAttrs: { + pname = "vyxal"; + version = "3.4.9"; + + src = fetchFromGitHub { + owner = "Vyxal"; + repo = "Vyxal"; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-8hA4u9zz8jm+tlSZ88z69/PUFNYk7+i3jtgUntgDgPE="; + }; + + # make sure to resolve all dependencies needed + deps = stdenvNoCC.mkDerivation { + name = "vyxal-${finalAttrs.version}-deps"; + inherit (finalAttrs) src; + + nativeBuildInputs = [ lockedMill ]; + + buildPhase = '' + runHook preBuild + + export JAVA_TOOL_OPTIONS="-Duser.home=$(mktemp -d)" + export COURSIER_CACHE=$out/.coursier + + mill native.prepareOffline --all + + runHook postBuild + ''; + + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + outputHash = "sha256-yXKzntb498b8ZLYq7w+s1Brj+pvPN9otdkdY8QGVHPs="; + }; + + nativeBuildInputs = [ + lockedMill + which + ]; + + buildPhase = '' + runHook preBuild + + export JAVA_TOOL_OPTIONS="-Duser.home=$(mktemp -d)" + export COURSIER_CACHE=${finalAttrs.deps}/.coursier + + mill native.nativeLink + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + install -Dm755 out/native/nativeLink.dest/out $out/bin/vyxal + runHook postInstall + ''; + + meta = { + changelog = "https://github.com/Vyxal/Vyxal/releases/tag/v${finalAttrs.version}"; + description = "Code-golfing language that has aspects of traditional programming languages"; + homepage = "https://github.com/Vyxal/Vyxal"; + license = lib.licenses.mit; + mainProgram = "vyxal"; + maintainers = with lib.maintainers; [ tomasajt ]; + platforms = lib.platforms.all; + }; +})