Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / sp / spotifywm / package.nix
blobb8a7db9a3d396f32a18e493ea7dc9ac76c40e770
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   libX11,
6   lndir,
7   makeBinaryWrapper,
8   spotify,
9 }:
10 stdenv.mkDerivation {
11   pname = "spotifywm";
12   version = "0-unstable-2022-10-25";
14   src = fetchFromGitHub {
15     owner = "dasJ";
16     repo = "spotifywm";
17     rev = "8624f539549973c124ed18753881045968881745";
18     hash = "sha256-AsXqcoqUXUFxTG+G+31lm45gjP6qGohEnUSUtKypew0=";
19   };
21   nativeBuildInputs = [
22     makeBinaryWrapper
23     lndir
24   ];
26   buildInputs = [ libX11 ];
28   installPhase = ''
29     runHook preInstall
31     mkdir -p $out
33     lndir -silent ${spotify} $out
35     install -Dm644 spotifywm.so $out/lib/spotifywm.so
37     wrapProgram $out/bin/spotify \
38       --suffix LD_PRELOAD : "$out/lib/spotifywm.so"
40     runHook postInstall
41   '';
43   meta = {
44     homepage = "https://github.com/dasJ/spotifywm";
45     description = "Wrapper around Spotify that correctly sets class name before opening the window";
46     license = lib.licenses.mit;
47     platforms = lib.platforms.linux;
48     maintainers = with lib.maintainers; [ jqueiroz the-argus ];
49     mainProgram = "spotify";
50   };