From ca64dcbeef3c78d3cd0ed183038ac539c70e89d7 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 28 Jan 2025 12:03:36 +0100 Subject: [PATCH] bacon: 3.9.0 -> 3.9.1 Diff: https://github.com/Canop/bacon/compare/refs/tags/v3.9.0...v3.9.1 Changelog: https://github.com/Canop/bacon/blob/v3.9.1/CHANGELOG.md --- pkgs/by-name/ba/bacon/package.nix | 50 ++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/pkgs/by-name/ba/bacon/package.nix b/pkgs/by-name/ba/bacon/package.nix index 0e4b02fb8e06..c1845323e58b 100644 --- a/pkgs/by-name/ba/bacon/package.nix +++ b/pkgs/by-name/ba/bacon/package.nix @@ -6,27 +6,14 @@ pkg-config, alsa-lib, versionCheckHook, + bacon, nix-update-script, + + withSound ? false, }: -rustPlatform.buildRustPackage rec { - pname = "bacon"; - version = "3.9.0"; - - src = fetchFromGitHub { - owner = "Canop"; - repo = "bacon"; - tag = "v${version}"; - hash = "sha256-LnJlE4ostOl+pr+d7ZsAfKvG4C45qt4pedWpeiTchPU="; - }; - - cargoHash = "sha256-KS1SXrRqjvRom2zZOaaZZOMK2CRUwVmtXC2ilDfaEG0="; - - nativeBuildInputs = [ - pkg-config - ]; - - buildInputs = +let + soundDependencies = lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ] @@ -34,12 +21,39 @@ rustPlatform.buildRustPackage rec { # bindgenHook is only included on darwin as it is needed to build `coreaudio-sys`, a darwin-specific crate rustPlatform.bindgenHook ]; +in + +rustPlatform.buildRustPackage rec { + pname = "bacon"; + version = "3.9.1"; + + src = fetchFromGitHub { + owner = "Canop"; + repo = "bacon"; + tag = "v${version}"; + hash = "sha256-TniEPcY3mK5LO9CBXi5kgnUQkOeDwF9n1K0kSn4ucKk="; + }; + + cargoHash = "sha256-5pY43PH2I4L/QsNnJffBGiRtuZrnLVCxjo0YseLsEMc="; + + buildFeatures = lib.optionals withSound [ + "sound" + ]; + + nativeBuildInputs = lib.optionals withSound [ + pkg-config + ]; + + buildInputs = lib.optionals withSound soundDependencies; nativeInstallCheckInputs = [ versionCheckHook ]; versionCheckProgramArg = [ "--version" ]; doInstallCheck = true; passthru = { + tests = { + withSound = bacon.override { withSound = true; }; + }; updateScript = nix-update-script { }; };