From a5ac07cf83c644b8442dabb4c764cdd1c48e1545 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 24 Feb 2025 21:05:35 +0900 Subject: [PATCH 1/2] cyme: prefer versionCheckHook rather than testers.testVersion https://github.com/NixOS/nixpkgs/blob/bd352cd67834c983d69adf4080d225dbe28f99ba/doc/stdenv/passthru.chapter.md?plain=1#L84 --- pkgs/by-name/cy/cyme/package.nix | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/cy/cyme/package.nix b/pkgs/by-name/cy/cyme/package.nix index 19e9ed29a3fb..32920643c9c9 100644 --- a/pkgs/by-name/cy/cyme/package.nix +++ b/pkgs/by-name/cy/cyme/package.nix @@ -6,9 +6,8 @@ stdenv, darwin, libusb1, + versionCheckHook, nix-update-script, - testers, - cyme, }: rustPlatform.buildRustPackage rec { @@ -47,12 +46,14 @@ rustPlatform.buildRustPackage rec { "--skip=test_run" ]; - passthru = { - updateScript = nix-update-script { }; - tests.version = testers.testVersion { - package = cyme; - }; - }; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + doInstallCheck = true; + versionCheckProgram = "${placeholder "out"}/bin/${meta.mainProgram}"; + versionCheckProgramArg = [ "--version" ]; + + passthru.updateScript = nix-update-script { }; meta = with lib; { homepage = "https://github.com/tuna-f1sh/cyme"; From ff707f8bb03987578d03869dc4143cda20e6a6be Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 24 Feb 2025 21:21:24 +0900 Subject: [PATCH 2/2] cyme: 1.8.5 -> 2.1.2 Changelog: https://github.com/tuna-f1sh/cyme/blob/v2.1.2/CHANGELOG.md Diff: https://github.com/tuna-f1sh/cyme/compare/v1.8.5...v2.1.2 [libusb is an optional dependency since 2.0.0](https://github.com/tuna-f1sh/cyme/commit/9b60ec40e148941e19ecc08953052e499da721f2) --- pkgs/by-name/cy/cyme/package.nix | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/pkgs/by-name/cy/cyme/package.nix b/pkgs/by-name/cy/cyme/package.nix index 32920643c9c9..9b509bf9c63b 100644 --- a/pkgs/by-name/cy/cyme/package.nix +++ b/pkgs/by-name/cy/cyme/package.nix @@ -5,24 +5,23 @@ pkg-config, stdenv, darwin, - libusb1, versionCheckHook, nix-update-script, }: rustPlatform.buildRustPackage rec { pname = "cyme"; - version = "1.8.5"; + version = "2.1.2"; src = fetchFromGitHub { owner = "tuna-f1sh"; repo = "cyme"; rev = "v${version}"; - hash = "sha256-4lnW6p7MaAZdvyXddIoB8TuEQSCmBYOwyvOA1r2ZKxk="; + hash = "sha256-KAHCeM1rAPGi98PrcVJtzkhTWGWFwf37VuSQTjqXSEg="; }; useFetchCargoVendor = true; - cargoHash = "sha256-eUBhMI/ff99SEU76yYvCzEvyLHtQqXgk/bHqmxPQlnc="; + cargoHash = "sha256-LwBTDBrsigt8H6PFuuGndiMlj5d8v68dyHipVYOGKVk="; nativeBuildInputs = [ @@ -32,20 +31,14 @@ rustPlatform.buildRustPackage rec { darwin.DarwinTools ]; - buildInputs = [ - libusb1 + checkFlags = [ + # doctest that requires access outside sandbox + "--skip=udev::hwdb::get" + # - system_profiler is not available in the sandbox + # - workaround for "Io Error: No such file or directory" + "--skip=test_run" ]; - checkFlags = - [ - # doctest that requires access outside sandbox - "--skip=udev::hwdb::get" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # system_profiler is not available in the sandbox - "--skip=test_run" - ]; - nativeInstallCheckInputs = [ versionCheckHook ];