Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i3status-rust: parameterise optional features (pulseaudio, notmuch) #99973

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 20 additions & 3 deletions pkgs/applications/window-managers/i3/status-rust.nix
@@ -1,4 +1,11 @@
{ stdenv, rustPlatform, fetchFromGitHub, pkgconfig, dbus, libpulseaudio }:
{ lib, rustPlatform, fetchFromGitHub, pkgconfig, dbus
, withPulseaudio ? true, libpulseaudio ? null
, withNotmuch ? false, notmuch ? null }:

assert withPulseaudio -> libpulseaudio != null;
assert withNotmuch -> notmuch != null;

with lib;

rustPlatform.buildRustPackage rec {
pname = "i3status-rust";
Expand All @@ -13,14 +20,24 @@ rustPlatform.buildRustPackage rec {

cargoSha256 = "0jmmxld4rsjj6p5nazi3d8j1hh7r34q6kyfqq4wv0sjc77gcpaxd";

cargoBuildFlags = [
"--no-default-features"
"--features" (escapeShellArg (concatStringsSep " " (
optional withPulseaudio "pulseaudio" ++
optional withNotmuch "notmuch"
)))
];

nativeBuildInputs = [ pkgconfig ];

buildInputs = [ dbus libpulseaudio ];
buildInputs = [ dbus ]
++ optional withPulseaudio libpulseaudio
++ optional withNotmuch notmuch;

# Currently no tests are implemented, so we avoid building the package twice
doCheck = false;

meta = with stdenv.lib; {
meta = {
description = "Very resource-friendly and feature-rich replacement for i3status";
homepage = "https://github.com/greshake/i3status-rust";
license = licenses.gpl3;
Expand Down