about summary refs log tree commit diff
path: root/pkgs/by-name/sp
diff options
context:
space:
mode:
authorGerg-L <GregLeyda@proton.me>2023-10-16 17:23:59 -0400
committerGerg-L <GregLeyda@proton.me>2024-03-01 08:40:16 -0500
commit2b7b9cd91652ddbd96a86258f0d3457c53321706 (patch)
tree4c612d93a7e1cd2baf5a7cdb3b1e76d2000828f2 /pkgs/by-name/sp
parentd97875bc5f50389a931fa857691abba4127899b1 (diff)
spotifywm: ensure all files are propagated
Diffstat (limited to 'pkgs/by-name/sp')
-rw-r--r--pkgs/by-name/sp/spotifywm/package.nix46
1 files changed, 29 insertions, 17 deletions
diff --git a/pkgs/by-name/sp/spotifywm/package.nix b/pkgs/by-name/sp/spotifywm/package.nix
index c2248056834e5..b8a7db9a3d396 100644
--- a/pkgs/by-name/sp/spotifywm/package.nix
+++ b/pkgs/by-name/sp/spotifywm/package.nix
@@ -1,39 +1,51 @@
-{ lib, stdenv, fetchFromGitHub, spotify, xorg, makeWrapper }:
+{
+  lib,
+  stdenv,
+  fetchFromGitHub,
+  libX11,
+  lndir,
+  makeBinaryWrapper,
+  spotify,
+}:
 stdenv.mkDerivation {
-  pname = "spotifywm-unstable";
-  version = "2022-10-26";
+  pname = "spotifywm";
+  version = "0-unstable-2022-10-25";
 
   src = fetchFromGitHub {
     owner = "dasJ";
     repo = "spotifywm";
     rev = "8624f539549973c124ed18753881045968881745";
-    sha256 = "sha256-AsXqcoqUXUFxTG+G+31lm45gjP6qGohEnUSUtKypew0=";
+    hash = "sha256-AsXqcoqUXUFxTG+G+31lm45gjP6qGohEnUSUtKypew0=";
   };
 
-  nativeBuildInputs = [ makeWrapper ];
+  nativeBuildInputs = [
+    makeBinaryWrapper
+    lndir
+  ];
 
-  buildInputs = [ xorg.libX11 ];
+  buildInputs = [ libX11 ];
 
   installPhase = ''
     runHook preInstall
 
-    mkdir -p $out/{bin,lib}
-    install -Dm644 spotifywm.so $out/lib/
-    ln -sf ${spotify}/bin/spotify $out/bin/spotify
+    mkdir -p $out
 
-    # 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
+    lndir -silent ${spotify} $out
+
+    install -Dm644 spotifywm.so $out/lib/spotifywm.so
+
+    wrapProgram $out/bin/spotify \
+      --suffix LD_PRELOAD : "$out/lib/spotifywm.so"
 
     runHook postInstall
   '';
 
-  meta = with lib; {
+  meta = {
     homepage = "https://github.com/dasJ/spotifywm";
     description = "Wrapper around Spotify that correctly sets class name before opening the window";
-    license = licenses.mit;
-    platforms = platforms.linux;
-    maintainers = with maintainers; [ jqueiroz the-argus ];
+    license = lib.licenses.mit;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ jqueiroz the-argus ];
+    mainProgram = "spotify";
   };
 }