uiua{,-unstable}: add windowSupport option and refactor (#371040)

This commit is contained in:
Christina Sørensen
2025-01-06 05:59:00 +01:00
committed by GitHub
3 changed files with 31 additions and 4 deletions
+29 -2
View File
@@ -6,11 +6,17 @@
rustPlatform,
fetchFromGitHub,
pkg-config,
versionCheckHook,
libffi,
audioSupport ? true,
alsa-lib,
webcamSupport ? false,
libGL,
libxkbcommon,
wayland,
xorg,
windowSupport ? false,
runCommand,
}:
@@ -34,7 +40,7 @@ lib.fix (
src = fetchFromGitHub {
owner = "uiua-lang";
repo = "uiua";
inherit (versionInfo) rev hash;
inherit (versionInfo) tag hash;
};
nativeBuildInputs =
@@ -48,7 +54,28 @@ lib.fix (
buildFeatures =
[ "libffi/system" ] # force libffi to be linked dynamically instead of rebuilding it
++ lib.optional audioSupport "audio"
++ lib.optional webcamSupport "webcam";
++ lib.optional webcamSupport "webcam"
++ lib.optional windowSupport "window";
postFixup =
let
runtimeDependencies = lib.optionals windowSupport [
libGL
libxkbcommon
wayland
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
];
in
lib.optionalString (runtimeDependencies != [ ] && stdenv.hostPlatform.isLinux) ''
patchelf --add-rpath ${lib.makeLibraryPath runtimeDependencies} $out/bin/uiua
'';
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
doInstallCheck = true;
passthru.updateScript = versionInfo.updateScript;
passthru.tests.run = runCommand "uiua-test-run" { nativeBuildInputs = [ uiua ]; } ''
+1 -1
View File
@@ -1,6 +1,6 @@
rec {
version = "0.14.1";
rev = version;
tag = version;
hash = "sha256-+FiJYxB2Lb1B7l9QEuB/XzdEYgJZmYAQpKimRIhWwhc=";
cargoHash = "sha256-0ZK87aX3akEPEXIsFrbOvTfhW24TZCuCcSVp+j8ylyg=";
updateScript = ./update-stable.sh;
+1 -1
View File
@@ -1,6 +1,6 @@
rec {
version = "0.14.1";
rev = version;
tag = version;
hash = "sha256-+FiJYxB2Lb1B7l9QEuB/XzdEYgJZmYAQpKimRIhWwhc=";
cargoHash = "sha256-0ZK87aX3akEPEXIsFrbOvTfhW24TZCuCcSVp+j8ylyg=";
updateScript = ./update-unstable.sh;