2023-10-06 11:39:35 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, audioSupport ? true
|
|
|
|
, darwin
|
|
|
|
, alsa-lib
|
2023-10-08 08:01:37 +00:00
|
|
|
|
|
|
|
# passthru.tests.run
|
|
|
|
, runCommand
|
|
|
|
, uiua
|
2023-09-27 16:41:44 +00:00
|
|
|
}:
|
2023-10-06 11:39:35 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2023-09-27 16:41:44 +00:00
|
|
|
pname = "uiua";
|
2024-02-25 22:29:33 +00:00
|
|
|
version = "0.9.5";
|
2023-09-27 16:41:44 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "uiua-lang";
|
|
|
|
repo = "uiua";
|
2023-10-25 22:02:02 +00:00
|
|
|
rev = version;
|
2024-02-25 22:29:33 +00:00
|
|
|
hash = "sha256-629hJLSGf0LJ+P1j1b87RV6XGgsDaWif1a6+Eo3NmMw=";
|
2023-09-27 16:41:44 +00:00
|
|
|
};
|
|
|
|
|
2024-02-25 22:29:33 +00:00
|
|
|
cargoHash = "sha256-ZRiDlsSZ5jjTrOrB/bg2xOcOTsCNFdP0jY0SwZ1zwGU=";
|
2023-09-27 16:41:44 +00:00
|
|
|
|
2023-09-29 06:52:30 +00: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
|
|
|
|
];
|
|
|
|
|
2023-09-27 16:41:44 +00:00
|
|
|
buildFeatures = lib.optional audioSupport "audio";
|
|
|
|
|
2023-10-25 22:02:02 +00:00
|
|
|
passthru.tests.run = runCommand "uiua-test-run" { nativeBuildInputs = [ uiua ]; } ''
|
2024-01-31 17:19:23 +00:00
|
|
|
uiua init
|
2023-10-08 08:01:37 +00:00
|
|
|
diff -U3 --color=auto <(uiua run main.ua) <(echo '"Hello, World!"')
|
2024-01-31 17:19:23 +00:00
|
|
|
touch $out
|
2023-10-08 08:01:37 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-25 22:02:02 +00:00
|
|
|
meta = {
|
2023-12-16 08:40:51 +00:00
|
|
|
changelog = "https://github.com/uiua-lang/uiua/blob/${src.rev}/changelog.md";
|
2023-09-27 16:41:44 +00:00
|
|
|
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/";
|
2023-10-25 22:02:02 +00:00
|
|
|
license = lib.licenses.mit;
|
2023-09-27 16:41:44 +00:00
|
|
|
mainProgram = "uiua";
|
2023-11-19 23:07:11 +00:00
|
|
|
maintainers = with lib.maintainers; [ cafkafk tomasajt defelo ];
|
2023-09-27 16:41:44 +00:00
|
|
|
};
|
|
|
|
}
|