Skip to content

Commit 8ab83a2

Browse files
authored
uiua{,-unstable}: add windowSupport option and refactor (#371040)
2 parents 3df3c47 + e75958d commit 8ab83a2

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

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

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@
66
rustPlatform,
77
fetchFromGitHub,
88
pkg-config,
9+
versionCheckHook,
910

1011
libffi,
1112
audioSupport ? true,
1213
alsa-lib,
1314
webcamSupport ? false,
15+
libGL,
16+
libxkbcommon,
17+
wayland,
18+
xorg,
19+
windowSupport ? false,
1420

1521
runCommand,
1622
}:
@@ -34,7 +40,7 @@ lib.fix (
3440
src = fetchFromGitHub {
3541
owner = "uiua-lang";
3642
repo = "uiua";
37-
inherit (versionInfo) rev hash;
43+
inherit (versionInfo) tag hash;
3844
};
3945

4046
nativeBuildInputs =
@@ -48,7 +54,28 @@ lib.fix (
4854
buildFeatures =
4955
[ "libffi/system" ] # force libffi to be linked dynamically instead of rebuilding it
5056
++ lib.optional audioSupport "audio"
51-
++ lib.optional webcamSupport "webcam";
57+
++ lib.optional webcamSupport "webcam"
58+
++ lib.optional windowSupport "window";
59+
60+
postFixup =
61+
let
62+
runtimeDependencies = lib.optionals windowSupport [
63+
libGL
64+
libxkbcommon
65+
wayland
66+
xorg.libX11
67+
xorg.libXcursor
68+
xorg.libXi
69+
xorg.libXrandr
70+
];
71+
in
72+
lib.optionalString (runtimeDependencies != [ ] && stdenv.hostPlatform.isLinux) ''
73+
patchelf --add-rpath ${lib.makeLibraryPath runtimeDependencies} $out/bin/uiua
74+
'';
75+
76+
nativeInstallCheckInputs = [ versionCheckHook ];
77+
versionCheckProgramArg = "--version";
78+
doInstallCheck = true;
5279

5380
passthru.updateScript = versionInfo.updateScript;
5481
passthru.tests.run = runCommand "uiua-test-run" { nativeBuildInputs = [ uiua ]; } ''

pkgs/by-name/ui/uiua/stable.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
rec {
22
version = "0.14.1";
3-
rev = version;
3+
tag = version;
44
hash = "sha256-+FiJYxB2Lb1B7l9QEuB/XzdEYgJZmYAQpKimRIhWwhc=";
55
cargoHash = "sha256-0ZK87aX3akEPEXIsFrbOvTfhW24TZCuCcSVp+j8ylyg=";
66
updateScript = ./update-stable.sh;

pkgs/by-name/ui/uiua/unstable.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
rec {
22
version = "0.14.1";
3-
rev = version;
3+
tag = version;
44
hash = "sha256-+FiJYxB2Lb1B7l9QEuB/XzdEYgJZmYAQpKimRIhWwhc=";
55
cargoHash = "sha256-0ZK87aX3akEPEXIsFrbOvTfhW24TZCuCcSVp+j8ylyg=";
66
updateScript = ./update-unstable.sh;

0 commit comments

Comments
 (0)