From bdfcdf2dce2077d32008dd67d78fca74ee0a65ab Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 3 Dec 2024 10:31:03 +0100 Subject: [PATCH 1/3] coinlive: refactor --- pkgs/tools/misc/coinlive/default.nix | 38 +++++++++++++++------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/pkgs/tools/misc/coinlive/default.nix b/pkgs/tools/misc/coinlive/default.nix index 564f19f85b97..498874ed5be9 100644 --- a/pkgs/tools/misc/coinlive/default.nix +++ b/pkgs/tools/misc/coinlive/default.nix @@ -1,10 +1,11 @@ -{ lib -, stdenv -, fetchFromGitHub -, openssl -, pkg-config -, rustPlatform -, Security +{ + lib, + stdenv, + fetchFromGitHub, + openssl, + pkg-config, + rustPlatform, + Security, }: rustPlatform.buildRustPackage rec { @@ -13,31 +14,32 @@ rustPlatform.buildRustPackage rec { src = fetchFromGitHub { owner = "mayeranalytics"; - repo = pname; - rev = "v${version}"; + repo = "coinlive"; + rev = "refs/tags/v${version}"; hash = "sha256-llw97jjfPsDd4nYi6lb9ug6sApPoD54WlzpJswvdbRs="; }; cargoHash = "sha256-T1TgwnohUDvfpn6GXNP4xJGHM3aenMK+ORxE3z3PPA4="; - nativeBuildInputs = [ - pkg-config - ]; + nativeBuildInputs = [ pkg-config ]; - buildInputs = [ - openssl - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - Security - ]; + buildInputs = + [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + Security + ]; checkFlags = [ - # requires network access + # Test requires network access "--skip=utils::test_get_infos" ]; meta = with lib; { description = "Live cryptocurrency prices CLI"; homepage = "https://github.com/mayeranalytics/coinlive"; + changelog = "https://github.com/mayeranalytics/coinlive/releases/tag/v${version}"; license = licenses.gpl3Only; maintainers = with maintainers; [ fab ]; mainProgram = "coinlive"; From c1ad9fc2f62e812058d4fb67c79d83ea820a3fdb Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 3 Dec 2024 10:33:50 +0100 Subject: [PATCH 2/3] coinlive: add versionCheckHook --- pkgs/tools/misc/coinlive/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/tools/misc/coinlive/default.nix b/pkgs/tools/misc/coinlive/default.nix index 498874ed5be9..a24ff65d45ca 100644 --- a/pkgs/tools/misc/coinlive/default.nix +++ b/pkgs/tools/misc/coinlive/default.nix @@ -6,6 +6,7 @@ pkg-config, rustPlatform, Security, + versionCheckHook, }: rustPlatform.buildRustPackage rec { @@ -31,11 +32,15 @@ rustPlatform.buildRustPackage rec { Security ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + checkFlags = [ # Test requires network access "--skip=utils::test_get_infos" ]; + doInstallCheck = true; + meta = with lib; { description = "Live cryptocurrency prices CLI"; homepage = "https://github.com/mayeranalytics/coinlive"; From 36f08301c23da885cb4c9e009d837527e09c78ae Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 3 Dec 2024 10:40:03 +0100 Subject: [PATCH 3/3] coinlive: move to pkgs/by-name --- .../coinlive/default.nix => by-name/co/coinlive/package.nix} | 4 ++-- pkgs/top-level/all-packages.nix | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) rename pkgs/{tools/misc/coinlive/default.nix => by-name/co/coinlive/package.nix} (95%) diff --git a/pkgs/tools/misc/coinlive/default.nix b/pkgs/by-name/co/coinlive/package.nix similarity index 95% rename from pkgs/tools/misc/coinlive/default.nix rename to pkgs/by-name/co/coinlive/package.nix index a24ff65d45ca..96c5fe8e4ef1 100644 --- a/pkgs/tools/misc/coinlive/default.nix +++ b/pkgs/by-name/co/coinlive/package.nix @@ -1,11 +1,11 @@ { lib, stdenv, + darwin, fetchFromGitHub, openssl, pkg-config, rustPlatform, - Security, versionCheckHook, }: @@ -29,7 +29,7 @@ rustPlatform.buildRustPackage rec { openssl ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - Security + darwin.apple_sdk.frameworks.Security ]; nativeInstallCheckInputs = [ versionCheckHook ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e6d18c1a3849..c23552649fa5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8946,10 +8946,6 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) OpenGL; }; - coinlive = callPackage ../tools/misc/coinlive { - inherit (darwin.apple_sdk.frameworks) Security; - }; - inherit (cosmopolitan) cosmocc; ctranslate2 = callPackage ../development/libraries/ctranslate2 rec {