Merge pull request #260484 from vs49688/supersonic

supersonic: add darwin support

authored by

Weijia Wang and committed by
GitHub
58d98b07 30e70ade

+28 -3
+28 -3
pkgs/by-name/su/supersonic/package.nix
··· 1 1 { lib 2 + , stdenv 2 3 , buildGoModule 3 4 , fetchFromGitHub 4 5 , makeDesktopItem 5 6 , copyDesktopItems 6 7 , pkg-config 8 + , desktopToDarwinBundle 7 9 , xorg 10 + , wayland 11 + , wayland-protocols 12 + , libxkbcommon 8 13 , libglvnd 9 14 , mpv 10 - , glfw3 15 + , darwin 11 16 , waylandSupport ? false 12 17 }: 13 18 19 + assert waylandSupport -> stdenv.isLinux; 20 + 14 21 buildGoModule rec { 15 22 pname = "supersonic" + lib.optionalString waylandSupport "-wayland"; 16 23 version = "0.5.2"; ··· 27 34 nativeBuildInputs = [ 28 35 copyDesktopItems 29 36 pkg-config 37 + ] ++ lib.optionals stdenv.isDarwin [ 38 + desktopToDarwinBundle 30 39 ]; 31 40 32 41 # go-glfw doesn't support both X11 and Wayland in single build ··· 35 44 buildInputs = [ 36 45 libglvnd 37 46 mpv 47 + ] ++ lib.optionals stdenv.isLinux [ 38 48 xorg.libXxf86vm 39 49 xorg.libX11 40 - ] ++ (glfw3.override { inherit waylandSupport; }).buildInputs; 50 + ] ++ lib.optionals (stdenv.isLinux && !waylandSupport) [ 51 + xorg.libXrandr 52 + xorg.libXinerama 53 + xorg.libXcursor 54 + xorg.libXi 55 + xorg.libXext 56 + ] ++ lib.optionals (stdenv.isLinux && waylandSupport) [ 57 + wayland 58 + wayland-protocols 59 + libxkbcommon 60 + ] ++ lib.optionals stdenv.isDarwin [ 61 + darwin.apple_sdk_11_0.frameworks.Cocoa 62 + darwin.apple_sdk_11_0.frameworks.Kernel 63 + darwin.apple_sdk_11_0.frameworks.OpenGL 64 + darwin.apple_sdk_11_0.frameworks.UserNotifications 65 + ]; 41 66 42 67 postInstall = '' 43 68 for dimension in 128 256 512;do ··· 66 91 mainProgram = "supersonic" + lib.optionalString waylandSupport "-wayland"; 67 92 description = "A lightweight cross-platform desktop client for Subsonic music servers"; 68 93 homepage = "https://github.com/dweymouth/supersonic"; 69 - platforms = platforms.linux; 94 + platforms = platforms.linux ++ platforms.darwin; 70 95 license = licenses.gpl3Plus; 71 96 maintainers = with maintainers; [ zane sochotnicky ]; 72 97 };