Skip to content

Commit 16287b2

Browse files
illdefinedJohnRTitor
authored andcommitted
hdr10plus_tool: update hdr10tool library on update
1 parent 9558cbd commit 16287b2

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

pkgs/by-name/hd/hdr10plus_tool/package.nix

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
pkg-config,
66
fontconfig,
77
writableTmpDirAsHomeHook,
8-
nix-update-script,
8+
writeShellApplication,
9+
hdr10plus,
10+
nixVersions,
11+
nix-update,
12+
tomlq,
913
}:
1014

1115
rustPlatform.buildRustPackage (finalAttrs: {
@@ -31,9 +35,21 @@ rustPlatform.buildRustPackage (finalAttrs: {
3135
export FONTCONFIG_FILE="${fontconfig.out}/etc/fonts/fonts.conf";
3236
'';
3337

34-
passthru = {
35-
updateScript = nix-update-script { };
36-
};
38+
passthru.updateScript = lib.getExe (writeShellApplication {
39+
name = "update-${finalAttrs.pname}";
40+
runtimeInputs = [
41+
nixVersions.latest
42+
nix-update
43+
tomlq
44+
];
45+
46+
text = ''
47+
nix-update ${finalAttrs.pname}
48+
src="$(nix eval -f . --raw ${finalAttrs.pname}.src)"
49+
libver="$(tq -f "$src/hdr10plus/Cargo.toml" package.version)"
50+
nix-update ${hdr10plus.pname} --version "$libver"
51+
'';
52+
});
3753

3854
meta = {
3955
description = "CLI utility to work with HDR10+ in HEVC files.";

0 commit comments

Comments
 (0)