Skip to content

Commit

Permalink
uiua-unstable: init at 0.14.0-dev.6 (#362951)
Browse files Browse the repository at this point in the history
  • Loading branch information
cafkafk authored Dec 9, 2024
2 parents e4c9d40 + 3c1facf commit 977c9ef
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 16 deletions.
22 changes: 7 additions & 15 deletions pkgs/by-name/ui/uiua/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,39 @@
fetchFromGitHub,
pkg-config,

darwin,
audioSupport ? true,
alsa-lib,
webcamSupport ? false,

# passthru.tests.run
runCommand,
uiua,

unstable ? false,
}:

let
inherit (darwin.apple_sdk.frameworks) AppKit AudioUnit CoreServices;
versionInfo = import (if unstable then ./unstable.nix else ./stable.nix);
in
rustPlatform.buildRustPackage rec {
pname = "uiua";
version = "0.13.0";
inherit (versionInfo) version cargoHash;

src = fetchFromGitHub {
owner = "uiua-lang";
repo = "uiua";
rev = version;
hash = "sha256-5IqJ/lvozXzc7LRUzxpG04M3Nir+3h+GoL7dqTgC9J8=";
inherit (versionInfo) rev hash;
};

cargoHash = "sha256-0hbE2ZH7daw/VQLe51CxOIborABDF0x00kTyx9NCs9g=";

nativeBuildInputs =
lib.optionals (webcamSupport || stdenv.hostPlatform.isDarwin) [ rustPlatform.bindgenHook ]
++ lib.optionals audioSupport [ pkg-config ];

buildInputs =
lib.optionals stdenv.hostPlatform.isDarwin [
AppKit
CoreServices
]
++ lib.optionals (audioSupport && stdenv.hostPlatform.isDarwin) [ AudioUnit ]
++ lib.optionals (audioSupport && stdenv.hostPlatform.isLinux) [ alsa-lib ];
buildInputs = lib.optionals (audioSupport && stdenv.hostPlatform.isLinux) [ alsa-lib ];

buildFeatures = lib.optional audioSupport "audio" ++ lib.optional webcamSupport "webcam";

passthru.updateScript = ./update.sh;
passthru.updateScript = versionInfo.updateScript;
passthru.tests.run = runCommand "uiua-test-run" { nativeBuildInputs = [ uiua ]; } ''
uiua init
diff -U3 --color=auto <(uiua run main.ua) <(echo '"Hello, World!"')
Expand Down
7 changes: 7 additions & 0 deletions pkgs/by-name/ui/uiua/stable.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rec {
version = "0.13.0";
rev = version;
hash = "sha256-5IqJ/lvozXzc7LRUzxpG04M3Nir+3h+GoL7dqTgC9J8=";
cargoHash = "sha256-0hbE2ZH7daw/VQLe51CxOIborABDF0x00kTyx9NCs9g=";
updateScript = ./update-stable.sh;
}
7 changes: 7 additions & 0 deletions pkgs/by-name/ui/uiua/unstable.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rec {
version = "0.14.0-dev.6";
rev = version;
hash = "sha256-YRv4i014xD4d8YN5PuMsa06+7kZgISPBGkKrVLU5ZN0=";
cargoHash = "sha256-GYBHaYGmKcV0Gw1I4IWzfmecHwQtb2ys5bMguqfo8S0=";
updateScript = ./update-unstable.sh;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq nix-update common-updater-scripts

nix-update uiua
nix-update --override-filename pkgs/by-name/ui/uiua/stable.nix --version-regex '^(\d*\.\d*\.\d*)$' uiua

EXT_VER=$(curl https://raw.githubusercontent.com/uiua-lang/uiua-vscode/main/package.json | jq -r .version)
update-source-version vscode-extensions.uiua-lang.uiua-vscode $EXT_VER
4 changes: 4 additions & 0 deletions pkgs/by-name/ui/uiua/update-unstable.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix-update

nix-update --override-filename pkgs/by-name/ui/uiua/unstable.nix uiua-unstable
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7103,6 +7103,8 @@ with pkgs;
babashka-unwrapped = callPackage ../development/interpreters/babashka { };
babashka = callPackage ../development/interpreters/babashka/wrapped.nix { };

uiua-unstable = callPackage ../by-name/ui/uiua/package.nix { unstable = true; };

# BQN interpreters and compilers

mbqn = bqn;
Expand Down

0 comments on commit 977c9ef

Please sign in to comment.