telegram-desktop: fix darwin build with Swift compilation

This commit is contained in:
r4v3n6101
2026-10-18 17:03:46 +03:00
committed by Nick Cao
parent 81c866b857
commit 1f45dce204
4 changed files with 22 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
fetchFromGitHub,
telegram-desktop,
withWebkit ? true,
@@ -23,6 +24,10 @@ telegram-desktop.override {
fetchSubmodules = true;
};
# Find the Swift SDK overlays needed by the translation provider.
# Remove after next release
env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-L/usr/lib/swift";
meta = {
description = "Kotatogram – experimental Telegram Desktop fork";
longDescription = ''

View File

@@ -37,6 +37,7 @@
libicns,
wallet-engine,
apple-sdk_15,
swift,
nix-update-script,
}:
@@ -68,6 +69,9 @@ stdenv.mkDerivation (finalAttrs: {
]
++ lib.optionals stdenv.hostPlatform.isLinux [
gobject-introspection
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
swift
];
buildInputs = [
@@ -111,8 +115,9 @@ stdenv.mkDerivation (finalAttrs: {
# We're allowed to used the API ID of the Snap package:
(lib.cmakeFeature "TDESKTOP_API_ID" "611335")
(lib.cmakeFeature "TDESKTOP_API_HASH" "d524b414d21f4d37f08684c1df41ac9c")
# swift 6 is not available in nixpkgs
(lib.cmakeBool "DESKTOP_APP_DISABLE_SWIFT6" true)
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
(lib.cmakeFeature "CMAKE_Swift_COMPILER_TARGET" stdenv.hostPlatform.swift.triple)
];
installPhase = lib.optionalString stdenv.hostPlatform.isDarwin ''

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
fetchFromGitHub,
telegram-desktop,
withWebkit ? true,
@@ -20,6 +21,10 @@ telegram-desktop.override {
fetchSubmodules = true;
};
# Find the Swift SDK overlays needed by the translation provider.
# Remove after next release
env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-L/usr/lib/swift";
meta = {
description = "Unofficial Telegram Desktop providing Windows 64bit build and extra features";
license = lib.licenses.gpl3Only;

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
fetchFromGitHub,
nix-update-script,
telegram-desktop,
@@ -22,6 +23,10 @@ telegram-desktop.override {
fetchSubmodules = true;
};
# Find the Swift SDK overlays needed by the translation provider.
# Remove after next release
env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-L/usr/lib/swift";
passthru.updateScript = nix-update-script { };
meta = previousAttrs.meta // {