From 3a42f32d68b2db4761dc99d78293359ec8a26c10 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 23 Oct 2023 22:03:36 +0200 Subject: [PATCH 1/3] cyme: init at 1.5.0 --- pkgs/by-name/cy/cyme/package.nix | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 pkgs/by-name/cy/cyme/package.nix diff --git a/pkgs/by-name/cy/cyme/package.nix b/pkgs/by-name/cy/cyme/package.nix new file mode 100644 index 000000000000..e113484ee054 --- /dev/null +++ b/pkgs/by-name/cy/cyme/package.nix @@ -0,0 +1,37 @@ +{ + lib +, fetchFromGitHub +, rustPlatform +, pkg-config +, libusb1 +, udev +, nix-update-script +}: + +rustPlatform.buildRustPackage rec { + pname = "cyme"; + version = "1.5.0"; + + src = fetchFromGitHub { + owner = "tuna-f1sh"; + repo = "cyme"; + rev = "v${version}"; + hash = "sha256-UXh97pHJ9wa/xSslHLB7WVDwLKJYvLPgmPX8RvKrsTI="; + }; + + cargoHash = "sha256-hSd53K50Y4K/fYGfsT2fHUaipVSpeYN6/EOFlv4ocuE="; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ libusb1 udev ]; + + passthru.updateScript = nix-update-script { }; + + meta = with lib; { + homepage = "https://github.com/tuna-f1sh/cyme"; + description = "A modern cross-platform lsusb"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ h7x4 ]; + platforms = platforms.unix; + mainProgram = "cyme"; + }; +} From 1310e498f7eeee3383a85f11c37cfa07ff66bf5f Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Wed, 25 Oct 2023 08:48:27 +0200 Subject: [PATCH 2/3] cyme: update meta --- pkgs/by-name/cy/cyme/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/cy/cyme/package.nix b/pkgs/by-name/cy/cyme/package.nix index e113484ee054..bf2eabff76f3 100644 --- a/pkgs/by-name/cy/cyme/package.nix +++ b/pkgs/by-name/cy/cyme/package.nix @@ -29,9 +29,9 @@ rustPlatform.buildRustPackage rec { meta = with lib; { homepage = "https://github.com/tuna-f1sh/cyme"; description = "A modern cross-platform lsusb"; - license = licenses.gpl3Only; + license = licenses.gpl3Plus; maintainers = with maintainers; [ h7x4 ]; - platforms = platforms.unix; + platforms = platforms.linux ++ platforms.darwin ++ platforms.windows; mainProgram = "cyme"; }; } From a3ba0010c0b244da076ec2c119987ea1e2835140 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Wed, 25 Oct 2023 08:49:01 +0200 Subject: [PATCH 3/3] cyme: add darwin support --- pkgs/by-name/cy/cyme/package.nix | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/cy/cyme/package.nix b/pkgs/by-name/cy/cyme/package.nix index bf2eabff76f3..3e32c22d2e41 100644 --- a/pkgs/by-name/cy/cyme/package.nix +++ b/pkgs/by-name/cy/cyme/package.nix @@ -3,6 +3,8 @@ , fetchFromGitHub , rustPlatform , pkg-config +, stdenv +, darwin , libusb1 , udev , nix-update-script @@ -21,8 +23,22 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-hSd53K50Y4K/fYGfsT2fHUaipVSpeYN6/EOFlv4ocuE="; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ libusb1 udev ]; + nativeBuildInputs = [ + pkg-config + ] ++ lib.optionals stdenv.isDarwin [ + darwin.DarwinTools + ]; + + buildInputs = [ + libusb1 + ] ++ lib.optionals stdenv.isLinux [ + udev + ]; + + checkFlags = lib.optionals stdenv.isDarwin [ + # system_profiler is not available in the sandbox + "--skip=test_run" + ]; passthru.updateScript = nix-update-script { };