about summary refs log tree commit diff
path: root/pkgs/by-name
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-10-12 23:05:28 +0200
committerGitHub <noreply@github.com>2023-10-12 23:05:28 +0200
commit58d98b0742b7818bf3f31179e10707f220a993a2 (patch)
treea02ed87e1232ec298ab45e0ed3dceee85dc89327 /pkgs/by-name
parent30e70aded1a399e13b515426ec8e17841b9a9f1d (diff)
parentb869f7d909562d04dd19183321fd84d8c9c17e4b (diff)
Merge pull request #260484 from vs49688/supersonic
supersonic: add darwin support
Diffstat (limited to 'pkgs/by-name')
-rw-r--r--pkgs/by-name/su/supersonic/package.nix31
1 files changed, 28 insertions, 3 deletions
diff --git a/pkgs/by-name/su/supersonic/package.nix b/pkgs/by-name/su/supersonic/package.nix
index 0c2f34cf5fee9..9b0fe4fd0634a 100644
--- a/pkgs/by-name/su/supersonic/package.nix
+++ b/pkgs/by-name/su/supersonic/package.nix
@@ -1,16 +1,23 @@
 { lib
+, stdenv
 , buildGoModule
 , fetchFromGitHub
 , makeDesktopItem
 , copyDesktopItems
 , pkg-config
+, desktopToDarwinBundle
 , xorg
+, wayland
+, wayland-protocols
+, libxkbcommon
 , libglvnd
 , mpv
-, glfw3
+, darwin
 , waylandSupport ? false
 }:
 
+assert waylandSupport -> stdenv.isLinux;
+
 buildGoModule rec {
   pname = "supersonic" + lib.optionalString waylandSupport "-wayland";
   version = "0.5.2";
@@ -27,6 +34,8 @@ buildGoModule rec {
   nativeBuildInputs = [
     copyDesktopItems
     pkg-config
+  ] ++ lib.optionals stdenv.isDarwin [
+    desktopToDarwinBundle
   ];
 
   # go-glfw doesn't support both X11 and Wayland in single build
@@ -35,9 +44,25 @@ buildGoModule rec {
   buildInputs = [
     libglvnd
     mpv
+  ] ++ lib.optionals stdenv.isLinux [
     xorg.libXxf86vm
     xorg.libX11
-  ] ++ (glfw3.override { inherit waylandSupport; }).buildInputs;
+  ] ++ lib.optionals (stdenv.isLinux && !waylandSupport) [
+    xorg.libXrandr
+    xorg.libXinerama
+    xorg.libXcursor
+    xorg.libXi
+    xorg.libXext
+  ] ++ lib.optionals (stdenv.isLinux && waylandSupport) [
+    wayland
+    wayland-protocols
+    libxkbcommon
+  ] ++ lib.optionals stdenv.isDarwin [
+    darwin.apple_sdk_11_0.frameworks.Cocoa
+    darwin.apple_sdk_11_0.frameworks.Kernel
+    darwin.apple_sdk_11_0.frameworks.OpenGL
+    darwin.apple_sdk_11_0.frameworks.UserNotifications
+  ];
 
   postInstall = ''
     for dimension in 128 256 512;do
@@ -66,7 +91,7 @@ buildGoModule rec {
     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;
+    platforms = platforms.linux ++ platforms.darwin;
     license = licenses.gpl3Plus;
     maintainers = with maintainers; [ zane sochotnicky ];
   };