nixpkgs/pkgs/by-name/ui/uiua/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.6 KiB
Nix
Raw Normal View History

2023-10-06 14:39:35 +03:00
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, pkg-config
, audioSupport ? true
, darwin
, alsa-lib
# passthru.tests.run
, runCommand
, uiua
}:
2023-10-06 14:39:35 +03:00
rustPlatform.buildRustPackage rec {
pname = "uiua";
version = "0.0.18";
src = fetchFromGitHub {
owner = "uiua-lang";
repo = "uiua";
2023-10-06 14:39:35 +03:00
rev = "refs/tags/${version}";
hash = "sha256-EXOBEvUAS0jCj9BAmy63dh0Dy30VOW0PBdsoa/2Jcx0=";
};
cargoHash = "sha256-8Cbks0oo8fgWj9Lxp0bwydYXkJD+fz3y+dZ7ne+RXdU=";
2023-09-29 09:52:30 +03:00
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 = with lib; {
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 = licenses.mit;
mainProgram = "uiua";
2023-10-06 14:39:35 +03:00
maintainers = with maintainers; [ cafkafk tomasajt ];
};
}