20 inherit (lib) optional makeLibraryPath;
22 wrapperScript = writeScript "glava" ''
26 # The binary would symlink it, which won't work in Nix because the
27 # garbage collector will eventually remove the original files after
29 echo "Nix wrapper: Copying glava config to ~/.config/glava"
30 cp -r --no-preserve=all @out@/etc/xdg/glava ~/.config/glava
33 exec @out@/bin/.glava-unwrapped "$@"
37 stdenv.mkDerivation rec {
41 src = fetchFromGitHub {
42 owner = "wacossusca34";
45 sha256 = "0kqkjxmpqkmgby05lsf6c6iwm45n33jk5qy6gi3zvjx4q4yzal1i";
55 ] ++ optional enableGlfw glfw;
62 for f in $(find -type f);do
63 substituteInPlace $f \
64 --replace /etc/xdg $out/etc/xdg
67 substituteInPlace Makefile \
68 --replace '$(DESTDIR)$(SHADERDIR)' '$(SHADERDIR)'
70 substituteInPlace Makefile \
71 --replace 'unknown' 'v${version}'
74 makeFlags = optional (!enableGlfw) "DISABLE_GLFW=1";
82 mv $out/usr/bin/glava $out/bin/.glava-unwrapped
86 --set-rpath "$(patchelf --print-rpath $out/bin/.glava-unwrapped):${makeLibraryPath [ libGL ]}" \
87 $out/bin/.glava-unwrapped
89 substitute ${wrapperScript} $out/bin/glava --subst-var out
90 chmod +x $out/bin/glava
95 OpenGL audio spectrum visualizer
97 mainProgram = "glava";
98 homepage = "https://github.com/wacossusca34/glava";
99 platforms = platforms.linux;
100 license = licenses.gpl3;
101 maintainers = with maintainers; [