Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

82 lines
1.7 KiB
Nix

{
callPackage,
lib,
stdenv,
pname ? "telegram-desktop",
unwrapped ? callPackage ./unwrapped.nix { inherit stdenv; },
qtbase,
qtimageformats,
qtsvg,
qtwayland,
kimageformats,
libavif,
libheif,
libjxl,
wrapGAppsHook3,
wrapQtAppsHook,
glib-networking,
webkitgtk_4_1,
withWebkit ? true,
}:
stdenv.mkDerivation (finalAttrs: {
inherit pname;
inherit (finalAttrs.unwrapped) version meta passthru;
inherit unwrapped;
nativeBuildInputs = [
wrapQtAppsHook
]
++ lib.optionals withWebkit [
wrapGAppsHook3
];
buildInputs = [
qtbase
qtimageformats
qtsvg
]
++ lib.optionals stdenv.hostPlatform.isLinux [
kimageformats
qtwayland
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
libavif
libheif
libjxl
]
++ lib.optionals withWebkit [
glib-networking
];
qtWrapperArgs = lib.optionals (stdenv.hostPlatform.isLinux && withWebkit) [
"--prefix"
"LD_LIBRARY_PATH"
":"
(lib.makeLibraryPath [ webkitgtk_4_1 ])
];
dontUnpack = true;
dontWrapGApps = true;
dontWrapQtApps = stdenv.hostPlatform.isDarwin;
installPhase = ''
runHook preInstall
cp -r "$unwrapped" "$out"
runHook postInstall
'';
preFixup = lib.optionalString (stdenv.hostPlatform.isLinux && withWebkit) ''
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
postFixup =
lib.optionalString stdenv.hostPlatform.isDarwin ''
wrapQtApp "$out/Applications/${finalAttrs.meta.mainProgram}.app/Contents/MacOS/${finalAttrs.meta.mainProgram}"
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace $out/share/dbus-1/services/* \
--replace-fail "$unwrapped" "$out"
'';
})