2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
rustPlatform,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pkg-config,
|
2024-10-23 06:41:50 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
darwin,
|
2024-10-23 06:41:50 +00:00
|
|
|
audioSupport ? true,
|
2024-05-15 15:35:15 +00:00
|
|
|
alsa-lib,
|
2024-10-23 06:41:50 +00:00
|
|
|
webcamSupport ? false,
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
# passthru.tests.run
|
|
|
|
runCommand,
|
|
|
|
uiua,
|
2023-10-09 19:29:22 +00:00
|
|
|
}:
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
let
|
|
|
|
inherit (darwin.apple_sdk.frameworks) AppKit AudioUnit CoreServices;
|
|
|
|
in
|
2023-10-09 19:29:22 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "uiua";
|
2024-10-29 11:11:06 +00:00
|
|
|
version = "0.13.0";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "uiua-lang";
|
|
|
|
repo = "uiua";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = version;
|
2024-10-29 11:11:06 +00:00
|
|
|
hash = "sha256-5IqJ/lvozXzc7LRUzxpG04M3Nir+3h+GoL7dqTgC9J8=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
2024-10-29 11:11:06 +00:00
|
|
|
cargoHash = "sha256-0hbE2ZH7daw/VQLe51CxOIborABDF0x00kTyx9NCs9g=";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeBuildInputs =
|
2024-10-23 06:41:50 +00:00
|
|
|
lib.optionals (webcamSupport || stdenv.hostPlatform.isDarwin) [ rustPlatform.bindgenHook ]
|
2024-05-15 15:35:15 +00:00
|
|
|
++ lib.optionals audioSupport [ pkg-config ];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
buildInputs =
|
2024-09-26 11:04:55 +00:00
|
|
|
lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-05-15 15:35:15 +00:00
|
|
|
AppKit
|
|
|
|
CoreServices
|
|
|
|
]
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optionals (audioSupport && stdenv.hostPlatform.isDarwin) [ AudioUnit ]
|
|
|
|
++ lib.optionals (audioSupport && stdenv.hostPlatform.isLinux) [ alsa-lib ];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-10-23 06:41:50 +00:00
|
|
|
buildFeatures = lib.optional audioSupport "audio" ++ lib.optional webcamSupport "webcam";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
2023-11-16 04:20:00 +00:00
|
|
|
passthru.tests.run = runCommand "uiua-test-run" { nativeBuildInputs = [ uiua ]; } ''
|
2024-02-07 01:22:34 +00:00
|
|
|
uiua init
|
2023-10-09 19:29:22 +00:00
|
|
|
diff -U3 --color=auto <(uiua run main.ua) <(echo '"Hello, World!"')
|
2024-02-07 01:22:34 +00:00
|
|
|
touch $out
|
2023-10-09 19:29:22 +00:00
|
|
|
'';
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
meta = {
|
2024-01-02 11:29:13 +00:00
|
|
|
changelog = "https://github.com/uiua-lang/uiua/blob/${src.rev}/changelog.md";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Stack-oriented array programming language with a focus on simplicity, beauty, and tacit code";
|
2023-10-09 19:29:22 +00:00
|
|
|
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-11-16 04:20:00 +00:00
|
|
|
license = lib.licenses.mit;
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "uiua";
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
cafkafk
|
|
|
|
tomasajt
|
|
|
|
defelo
|
|
|
|
];
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
}
|