diff options
Diffstat (limited to 'pkgs/by-name/ui/uiua/package.nix')
-rw-r--r-- | pkgs/by-name/ui/uiua/package.nix | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/pkgs/by-name/ui/uiua/package.nix b/pkgs/by-name/ui/uiua/package.nix new file mode 100644 index 00000000000..1a6f8132544 --- /dev/null +++ b/pkgs/by-name/ui/uiua/package.nix @@ -0,0 +1,63 @@ +{ lib +, stdenv +, rustPlatform +, fetchFromGitHub +, pkg-config +, audioSupport ? true +, darwin +, alsa-lib + +# passthru.tests.run +, runCommand +, uiua +}: + +rustPlatform.buildRustPackage rec { + pname = "uiua"; + version = "0.2.0"; + + src = fetchFromGitHub { + owner = "uiua-lang"; + repo = "uiua"; + rev = version; + hash = "sha256-RAMQC9weEvTV44nAXjwMYv+4O5aSNNM5UOf/xBb4SBE="; + }; + + cargoHash = "sha256-ZBedAIHwbRiR9i6w0CWIiE+OJvTkmxiEihn7zLAV/Dg="; + + nativeBuildInputs = lib.optionals stdenv.isDarwin [ + rustPlatform.bindgenHook + ] ++ lib.optionals audioSupport [ + pkg-config + ]; + + buildInputs = lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.CoreServices + ] ++ lib.optionals (audioSupport && stdenv.isDarwin) [ + darwin.apple_sdk.frameworks.AudioUnit + ] ++ lib.optionals (audioSupport && stdenv.isLinux) [ + alsa-lib + ]; + + buildFeatures = lib.optional audioSupport "audio"; + + passthru.tests.run = runCommand "uiua-test-run" { nativeBuildInputs = [ uiua ]; } '' + uiua init; + diff -U3 --color=auto <(uiua run main.ua) <(echo '"Hello, World!"') + touch $out; + ''; + + meta = { + changelog = "https://github.com/uiua-lang/uiua/releases/tag/${src.rev}"; + description = "A stack-oriented array programming language with a focus on simplicity, beauty, and tacit code"; + longDescription = '' + Uiua combines the stack-oriented and array-oriented paradigms in a single + language. Combining these already terse paradigms results in code with a very + high information density and little syntactic noise. + ''; + homepage = "https://www.uiua.org/"; + license = lib.licenses.mit; + mainProgram = "uiua"; + maintainers = with lib.maintainers; [ cafkafk tomasajt ]; + }; +} |