From b98d314b4a449a40677de813f353d60b5c4ab170 Mon Sep 17 00:00:00 2001 From: Ian McFarlane Date: Tue, 21 Mar 2023 08:37:24 -0400 Subject: [PATCH 1/3] spotifywm: make behave as patch instead of separate package --- pkgs/applications/audio/spotifywm/default.nix | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/audio/spotifywm/default.nix b/pkgs/applications/audio/spotifywm/default.nix index 0d03e74b623a..7a37efe80aca 100644 --- a/pkgs/applications/audio/spotifywm/default.nix +++ b/pkgs/applications/audio/spotifywm/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, spotify, xorg, runtimeShell }: +{ lib, stdenv, fetchFromGitHub, spotify, xorg, makeWrapper }: stdenv.mkDerivation { pname = "spotifywm-unstable"; version = "2022-10-26"; @@ -10,15 +10,25 @@ stdenv.mkDerivation { sha256 = "sha256-AsXqcoqUXUFxTG+G+31lm45gjP6qGohEnUSUtKypew0="; }; + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ xorg.libX11 ]; propagatedBuildInputs = [ spotify ]; installPhase = '' - echo "#!${runtimeShell}" > spotifywm - echo "LD_PRELOAD="$out/lib/spotifywm.so" ${spotify}/bin/spotify \$*" >> spotifywm - install -Dm644 spotifywm.so $out/lib/spotifywm.so - install -Dm755 spotifywm $out/bin/spotifywm + runHook preInstall + + mkdir -p $out/{bin,lib} + install -Dm644 spotifywm.so $out/lib/ + ln -sf ${spotify}/bin/spotify $out/bin/spotify + + # wrap spotify to use spotifywm.so + wrapProgram $out/bin/spotify --set LD_PRELOAD "$out/lib/spotifywm.so" + # backwards compatibility for people who are using the "spotifywm" binary + ln -sf $out/bin/spotify $out/bin/spotifywm + + runHook postInstall ''; meta = with lib; { From 78aa6738d03b049b2b5a9e889fdd047cb2f9a50e Mon Sep 17 00:00:00 2001 From: Ian McFarlane Date: Tue, 21 Mar 2023 08:37:49 -0400 Subject: [PATCH 2/3] spotifywm: add the-argus as maintainer --- pkgs/applications/audio/spotifywm/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/audio/spotifywm/default.nix b/pkgs/applications/audio/spotifywm/default.nix index 7a37efe80aca..356d43dacb1b 100644 --- a/pkgs/applications/audio/spotifywm/default.nix +++ b/pkgs/applications/audio/spotifywm/default.nix @@ -36,6 +36,6 @@ stdenv.mkDerivation { description = "Wrapper around Spotify that correctly sets class name before opening the window"; license = licenses.mit; platforms = platforms.linux; - maintainers = with maintainers; [ jqueiroz ]; + maintainers = with maintainers; [ jqueiroz the-argus ]; }; } From f3b780d933a6cc171afca42b5e95e4642d4e3692 Mon Sep 17 00:00:00 2001 From: Artturin Date: Mon, 8 May 2023 22:22:31 +0300 Subject: [PATCH 3/3] spotifywm: don't needlessly propagate spotify --- pkgs/applications/audio/spotifywm/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/applications/audio/spotifywm/default.nix b/pkgs/applications/audio/spotifywm/default.nix index 356d43dacb1b..c2248056834e 100644 --- a/pkgs/applications/audio/spotifywm/default.nix +++ b/pkgs/applications/audio/spotifywm/default.nix @@ -14,8 +14,6 @@ stdenv.mkDerivation { buildInputs = [ xorg.libX11 ]; - propagatedBuildInputs = [ spotify ]; - installPhase = '' runHook preInstall