presenterm: refactor

This commit is contained in:
Sizhe Zhao
2025-06-21 17:07:22 +08:00
parent 481fe0b915
commit ee9ecc47d8
+7 -5
View File
@@ -9,7 +9,9 @@
versionCheckHook,
nix-update-script,
}:
let
inherit (stdenv.hostPlatform) isDarwin isx86_64;
in
rustPlatform.buildRustPackage (finalAttrs: {
pname = "presenterm";
version = "0.14.0";
@@ -22,10 +24,10 @@ rustPlatform.buildRustPackage (finalAttrs: {
};
nativeBuildInputs =
lib.optionals stdenv.hostPlatform.isDarwin [
lib.optionals isDarwin [
makeBinaryWrapper
]
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [
++ lib.optionals (isDarwin && isx86_64) [
lld
];
@@ -40,7 +42,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
useFetchCargoVendor = true;
cargoHash = "sha256-u0wOWKAfzi1Fxmx6x2ckrIv/PKgtqKrDiDauD4/BY24=";
env = lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) {
env = lib.optionalAttrs (isDarwin && isx86_64) {
NIX_CFLAGS_LINK = "-fuse-ld=lld";
};
@@ -54,7 +56,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
];
# sixel-sys is dynamically linked to libsixel
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
postInstall = lib.optionalString isDarwin ''
wrapProgram $out/bin/presenterm \
--prefix DYLD_LIBRARY_PATH : "${lib.makeLibraryPath [ libsixel ]}"
'';