From 96509bec476233de378fae3e724d0f945e5a263e Mon Sep 17 00:00:00 2001 From: Moritz Sanft <58110325+msanft@users.noreply.github.com> Date: Wed, 11 Sep 2024 13:09:51 +0200 Subject: [PATCH 1/2] gossip: add missing dependencies --- pkgs/by-name/go/gossip/package.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/go/gossip/package.nix b/pkgs/by-name/go/gossip/package.nix index e5588618369e..9144634d6358 100644 --- a/pkgs/by-name/go/gossip/package.nix +++ b/pkgs/by-name/go/gossip/package.nix @@ -13,6 +13,7 @@ , rustPlatform , stdenv , wayland +, wayland-scanner , xorg }: @@ -54,6 +55,8 @@ rustPlatform.buildRustPackage rec { git pkg-config rustPlatform.bindgenHook + ] ++ lib.optionals stdenv.isLinux [ + wayland-scanner ]; buildInputs = [ @@ -64,8 +67,11 @@ rustPlatform.buildRustPackage rec { 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 @@ -84,7 +90,7 @@ 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 ]} ''; From fa7001de6db29f6bf60094db30cb2dde47bf1745 Mon Sep 17 00:00:00 2001 From: Moritz Sanft <58110325+msanft@users.noreply.github.com> Date: Wed, 11 Sep 2024 13:52:32 +0200 Subject: [PATCH 2/2] gossip: format --- pkgs/by-name/go/gossip/package.nix | 115 +++++++++++++++++------------ 1 file changed, 67 insertions(+), 48 deletions(-) diff --git a/pkgs/by-name/go/gossip/package.nix b/pkgs/by-name/go/gossip/package.nix index 9144634d6358..f6c4927316d9 100644 --- a/pkgs/by-name/go/gossip/package.nix +++ b/pkgs/by-name/go/gossip/package.nix @@ -1,20 +1,21 @@ -{ cmake -, darwin -, fetchFromGitHub -, ffmpeg -, fontconfig -, git -, lib -, libGL -, libxkbcommon -, makeDesktopItem -, openssl -, pkg-config -, rustPlatform -, stdenv -, wayland -, wayland-scanner -, xorg +{ + cmake, + darwin, + fetchFromGitHub, + ffmpeg, + fontconfig, + git, + lib, + libGL, + libxkbcommon, + makeDesktopItem, + openssl, + pkg-config, + rustPlatform, + stdenv, + wayland, + wayland-scanner, + xorg, }: rustPlatform.buildRustPackage rec { @@ -48,37 +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 - ] ++ lib.optionals stdenv.isLinux [ - wayland-scanner + buildFeatures = [ + "video-ffmpeg" + "lang-cjk" ]; - 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 - ]; + 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; @@ -92,7 +101,13 @@ rustPlatform.buildRustPackage rec { postFixup = lib.optionalString (!stdenv.isDarwin) '' patchelf $out/bin/gossip \ - --add-rpath ${lib.makeLibraryPath [ libGL libxkbcommon wayland ]} + --add-rpath ${ + lib.makeLibraryPath [ + libGL + libxkbcommon + wayland + ] + } ''; desktopItems = [ @@ -102,7 +117,11 @@ rustPlatform.buildRustPackage rec { icon = "gossip"; comment = meta.description; desktopName = "Gossip"; - categories = [ "Chat" "Network" "InstantMessaging" ]; + categories = [ + "Chat" + "Network" + "InstantMessaging" + ]; startupWMClass = "gossip"; }) ];