gossip: add missing dependencies (#341182)

This commit is contained in:
Aleksana 2024-09-15 17:24:43 +08:00 committed by GitHub
commit 497239b401
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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