nixpkgs/pkgs/applications/networking/instant-messengers/qq/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

117 lines
2.6 KiB
Nix
Raw Normal View History

2022-12-28 09:36:26 +00:00
{ alsa-lib
, cups
, dpkg
, fetchurl
, glib
, gtk3
, lib
2023-05-17 13:44:10 +00:00
, libayatana-appindicator
2022-12-28 09:36:26 +00:00
, libdrm
, libgcrypt
, libkrb5
2023-12-06 13:05:11 +00:00
, libnotify
2022-12-28 09:36:26 +00:00
, mesa # for libgbm
, libGL
2022-12-28 09:36:26 +00:00
, nss
, xorg
, systemd
, stdenv
2023-04-20 10:27:52 +00:00
, vips
2022-12-28 09:36:26 +00:00
, at-spi2-core
, autoPatchelfHook
, makeShellWrapper
, wrapGAppsHook
2024-04-13 19:15:54 +00:00
, commandLineArgs ? ""
2022-12-28 09:36:26 +00:00
}:
let
2023-07-24 17:18:12 +00:00
sources = import ./sources.nix;
2022-12-28 09:36:26 +00:00
srcs = {
x86_64-linux = fetchurl {
2024-04-27 07:19:31 +00:00
url = sources.amd64_url;
2023-07-24 17:18:12 +00:00
hash = sources.amd64_hash;
2022-12-28 09:36:26 +00:00
};
aarch64-linux = fetchurl {
2024-04-27 07:19:31 +00:00
url = sources.arm64_url;
2023-07-24 17:18:12 +00:00
hash = sources.arm64_hash;
2022-12-28 09:36:26 +00:00
};
};
src = srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
in
stdenv.mkDerivation {
pname = "qq";
2023-07-24 17:18:12 +00:00
version = sources.version;
inherit src;
2022-12-28 09:36:26 +00:00
nativeBuildInputs = [
autoPatchelfHook
makeShellWrapper
wrapGAppsHook
2022-12-28 09:36:26 +00:00
dpkg
];
buildInputs = [
alsa-lib
at-spi2-core
cups
glib
2023-04-20 10:27:52 +00:00
gtk3
2022-12-28 09:36:26 +00:00
libdrm
libgcrypt
libkrb5
mesa
nss
2023-04-20 10:27:52 +00:00
vips
2022-12-28 09:36:26 +00:00
xorg.libXdamage
];
dontWrapGApps = true;
2023-04-20 10:27:52 +00:00
runtimeDependencies = map lib.getLib [
systemd
2022-12-28 09:36:26 +00:00
];
installPhase = ''
runHook preInstall
2023-01-01 10:28:22 +00:00
mkdir -p $out/bin
cp -r opt $out/opt
cp -r usr/share $out/share
substituteInPlace $out/share/applications/qq.desktop \
--replace "/opt/QQ/qq" "$out/bin/qq" \
--replace "/usr/share" "$out/share"
makeShellWrapper $out/opt/QQ/qq $out/bin/qq \
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libGL ]}" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
2024-04-13 19:15:54 +00:00
--add-flags ${lib.escapeShellArg commandLineArgs} \
"''${gappsWrapperArgs[@]}"
2022-12-28 09:36:26 +00:00
2023-04-20 10:27:52 +00:00
# Remove bundled libraries
rm -r $out/opt/QQ/resources/app/sharp-lib
2023-08-07 08:49:35 +00:00
# https://aur.archlinux.org/cgit/aur.git/commit/?h=linuxqq&id=f7644776ee62fa20e5eb30d0b1ba832513c77793
rm -r $out/opt/QQ/resources/app/libssh2.so.1
2023-05-17 13:44:10 +00:00
# https://github.com/microcai/gentoo-zh/commit/06ad5e702327adfe5604c276635ae8a373f7d29e
ln -s ${libayatana-appindicator}/lib/libayatana-appindicator3.so \
$out/opt/QQ/libappindicator3.so
2023-12-06 13:05:11 +00:00
ln -s ${libnotify}/lib/libnotify.so \
$out/opt/QQ/libnotify.so
2022-12-28 09:36:26 +00:00
runHook postInstall
'';
2023-07-24 17:18:12 +00:00
passthru.updateScript = ./update.sh;
2022-12-28 09:36:26 +00:00
meta = with lib; {
homepage = "https://im.qq.com/linuxqq/";
description = "Messaging app";
platforms = [ "x86_64-linux" "aarch64-linux" ];
license = licenses.unfree;
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
maintainers = with lib.maintainers; [ fee1-dead ];
};
}