From 0c1c00490849d49f5bf4a06f4269d4050e1be104 Mon Sep 17 00:00:00 2001 From: Zane van Iperen Date: Fri, 29 Sep 2023 23:27:17 +1000 Subject: [PATCH] supersonic: init at 0.5.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Stanislav Ochotnický --- pkgs/by-name/su/supersonic/package.nix | 73 ++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 2 files changed, 77 insertions(+) create mode 100644 pkgs/by-name/su/supersonic/package.nix diff --git a/pkgs/by-name/su/supersonic/package.nix b/pkgs/by-name/su/supersonic/package.nix new file mode 100644 index 000000000000..0c2f34cf5fee --- /dev/null +++ b/pkgs/by-name/su/supersonic/package.nix @@ -0,0 +1,73 @@ +{ lib +, buildGoModule +, fetchFromGitHub +, makeDesktopItem +, copyDesktopItems +, pkg-config +, xorg +, libglvnd +, mpv +, glfw3 +, waylandSupport ? false +}: + +buildGoModule rec { + pname = "supersonic" + lib.optionalString waylandSupport "-wayland"; + version = "0.5.2"; + + src = fetchFromGitHub { + owner = "dweymouth"; + repo = "supersonic"; + rev = "v${version}"; + hash = "sha256-4SLAUqLMoUxTSi4I/QeHqudO62Gmhpm1XbCGf+3rPlc="; + }; + + vendorHash = "sha256-6Yp5OoybFpoBuIKodbwnyX3crLCl8hJ2r4plzo0plsY="; + + nativeBuildInputs = [ + copyDesktopItems + pkg-config + ]; + + # go-glfw doesn't support both X11 and Wayland in single build + tags = lib.optionals waylandSupport [ "wayland" ]; + + buildInputs = [ + libglvnd + mpv + xorg.libXxf86vm + xorg.libX11 + ] ++ (glfw3.override { inherit waylandSupport; }).buildInputs; + + postInstall = '' + for dimension in 128 256 512;do + dimensions=''${dimension}x''${dimension} + mkdir -p $out/share/icons/hicolor/$dimensions/apps + cp res/appicon-$dimension.png $out/share/icons/hicolor/$dimensions/apps/${meta.mainProgram}.png + done + '' + lib.optionalString waylandSupport '' + mv $out/bin/supersonic $out/bin/${meta.mainProgram} + ''; + + desktopItems = [ + (makeDesktopItem { + name = meta.mainProgram; + exec = meta.mainProgram; + icon = meta.mainProgram; + desktopName = "Supersonic" + lib.optionalString waylandSupport " (Wayland)"; + genericName = "Subsonic Client"; + comment = meta.description; + type = "Application"; + categories = [ "Audio" "AudioVideo" ]; + }) + ]; + + meta = with lib; { + mainProgram = "supersonic" + lib.optionalString waylandSupport "-wayland"; + description = "A lightweight cross-platform desktop client for Subsonic music servers"; + homepage = "https://github.com/dweymouth/supersonic"; + platforms = platforms.linux; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ zane sochotnicky ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a4bd4110d378..74677164dcfd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -35801,6 +35801,10 @@ with pkgs; sunvox = callPackage ../applications/audio/sunvox { }; + supersonic-wayland = supersonic.override { + waylandSupport = true; + }; + svkbd = callPackage ../applications/accessibility/svkbd { }; swaglyrics = callPackage ../tools/misc/swaglyrics { };