diff --git a/pkgs/by-name/go/gossip/package.nix b/pkgs/by-name/go/gossip/package.nix index e5588618369e..f6c4927316d9 100644 --- a/pkgs/by-name/go/gossip/package.nix +++ b/pkgs/by-name/go/gossip/package.nix @@ -1,19 +1,21 @@ -{ cmake -, darwin -, fetchFromGitHub -, ffmpeg -, fontconfig -, git -, lib -, libGL -, libxkbcommon -, makeDesktopItem -, openssl -, pkg-config -, rustPlatform -, stdenv -, wayland -, xorg +{ + cmake, + darwin, + fetchFromGitHub, + ffmpeg, + fontconfig, + git, + lib, + libGL, + libxkbcommon, + makeDesktopItem, + openssl, + pkg-config, + rustPlatform, + stdenv, + wayland, + wayland-scanner, + xorg, }: rustPlatform.buildRustPackage rec { @@ -47,32 +49,45 @@ rustPlatform.buildRustPackage rec { RUSTFLAGS = "--cfg tokio_unstable"; # Some users might want to add "rustls-tls(-native)" for Rust TLS instead of OpenSSL. - buildFeatures = [ "video-ffmpeg" "lang-cjk" ]; - - nativeBuildInputs = [ - cmake - git - pkg-config - rustPlatform.bindgenHook + buildFeatures = [ + "video-ffmpeg" + "lang-cjk" ]; - buildInputs = [ - ffmpeg - fontconfig - libGL - libxkbcommon - openssl - ] ++ lib.optionals stdenv.isDarwin [ - darwin.apple_sdk.frameworks.AppKit - darwin.apple_sdk.frameworks.CoreGraphics - darwin.apple_sdk.frameworks.Foundation - ] ++ lib.optionals stdenv.isLinux [ - wayland - xorg.libX11 - xorg.libXcursor - xorg.libXi - xorg.libXrandr - ]; + nativeBuildInputs = + [ + cmake + git + pkg-config + rustPlatform.bindgenHook + ] + ++ lib.optionals stdenv.isLinux [ + wayland-scanner + ]; + + buildInputs = + [ + ffmpeg + fontconfig + libGL + libxkbcommon + openssl + ] + ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.AppKit + darwin.apple_sdk.frameworks.Cocoa + darwin.apple_sdk.frameworks.CoreGraphics + darwin.apple_sdk.frameworks.Foundation + darwin.apple_sdk.frameworks.ForceFeedback + darwin.apple_sdk.frameworks.AVFoundation + ] + ++ lib.optionals stdenv.isLinux [ + wayland + xorg.libX11 + xorg.libXcursor + xorg.libXi + xorg.libXrandr + ]; # Tests rely on local files, so disable them. (I'm too lazy to patch it.) doCheck = false; @@ -84,9 +99,15 @@ rustPlatform.buildRustPackage rec { ln -s $out/logo/gossip.png $out/share/icons/hicolor/128x128/apps/gossip.png ''; - postFixup = '' + postFixup = lib.optionalString (!stdenv.isDarwin) '' patchelf $out/bin/gossip \ - --add-rpath ${lib.makeLibraryPath [ libGL libxkbcommon wayland ]} + --add-rpath ${ + lib.makeLibraryPath [ + libGL + libxkbcommon + wayland + ] + } ''; desktopItems = [ @@ -96,7 +117,11 @@ rustPlatform.buildRustPackage rec { icon = "gossip"; comment = meta.description; desktopName = "Gossip"; - categories = [ "Chat" "Network" "InstantMessaging" ]; + categories = [ + "Chat" + "Network" + "InstantMessaging" + ]; startupWMClass = "gossip"; }) ];