Merge pull request #260484 from vs49688/supersonic
supersonic: add darwin support
This commit is contained in:
commit
58d98b0742
1 changed files with 28 additions and 3 deletions
|
@ -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 ];
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue