-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathunwrapped.nix
168 lines (151 loc) · 4.01 KB
/
unwrapped.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
{
lib,
stdenv,
fetchFromGitHub,
callPackage,
pkg-config,
cmake,
ninja,
clang,
python3,
libsForQt5,
qtimageformats,
qtsvg,
qtwayland,
kcoreaddons,
lz4,
xxHash,
ffmpeg_6,
protobuf,
openalSoft,
minizip,
libopus,
alsa-lib,
libpulseaudio,
range-v3,
tl-expected,
hunspell,
gobject-introspection,
jemalloc,
rnnoise,
microsoft-gsl,
boost,
ada,
libicns,
apple-sdk_15,
nix-update-script,
fetchpatch,
gitUpdater,
isDebug ? false,
tg_owt ? callPackage ./lib/tg_owt.nix { inherit stdenv; },
}:
stdenv.mkDerivation (finalAttrs: {
pname = "ayugram-desktop-unwrapped";
version = "5.12.3";
src = fetchFromGitHub {
owner = "AyuGram";
repo = "AyuGramDesktop";
rev = "v${finalAttrs.version}";
fetchSubmodules = true;
hash = "sha256-Zjik+9J0YtabVW1VEkJr/Bl3SIakVQ8EiTLYm28rEIk=";
};
patches = [
# Fixes linux builds
./patch/cstring.patch
(fetchpatch {
url = "https://github.com/AyuGram/AyuGramDesktop/pull/32/commits/15287ad6ed162c209d9772fc592e959d793f63b9.patch";
hash = "sha256-3yt502TsytJtpBn8iSJySN+UAQQ23c1hYNPIFLSogVA=";
})
];
postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp \
--replace-fail '"libasound.so.2"' '"${lib.getLib alsa-lib}/lib/libasound.so.2"'
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp \
--replace-fail '"libasound.so.2"' '"${lib.getLib alsa-lib}/lib/libasound.so.2"'
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp \
--replace-fail '"libpulse.so.0"' '"${lib.getLib libpulseaudio}/lib/libpulse.so.0"'
substituteInPlace lib/xdg/com.ayugram.desktop.desktop \
--replace-fail "DBusActivatable=true" ""
'';
dontWrapQtApps = true;
nativeBuildInputs =
[
pkg-config
cmake
ninja
python3
]
++ lib.optionals stdenv.hostPlatform.isLinux [
# to build bundled libdispatch
clang
gobject-introspection
];
buildInputs =
[
libsForQt5.qt5.qtbase
qtimageformats
qtsvg
lz4
xxHash
ffmpeg_6
openalSoft
minizip
libopus
range-v3
tl-expected
rnnoise
tg_owt
microsoft-gsl
boost
ada
]
++ lib.optionals stdenv.hostPlatform.isLinux [
protobuf
qtwayland
kcoreaddons
alsa-lib
libpulseaudio
hunspell
jemalloc
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_15
libicns
];
cmakeFlags = [
(lib.cmakeBool "DESKTOP_APP_DISABLE_AUTOUPDATE" true)
(lib.cmakeFeature "TDESKTOP_API_HASH" "b18441a1ff607e10a989891a5462e627")
(lib.cmakeFeature "TDESKTOP_API_ID" "2040")
(lib.cmakeFeature "CMAKE_BUILD_TYPE" (if isDebug then "Debug" else "Release"))
];
installPhase = lib.optionalString stdenv.hostPlatform.isDarwin ''
runHook preInstall
mkdir -p $out/Applications
cp -r ${finalAttrs.meta.mainProgram}.app $out/Applications
ln -sr $out/{Applications/${finalAttrs.meta.mainProgram}.app/Contents/MacOS,bin}
runHook postInstall
'';
passthru.updateScript = gitUpdater {
rev-prefix = "v";
url = "https://github.com/AyuGram/AyuGramDesktop.git";
};
meta = with lib; {
mainProgram = "ayugram-desktop";
# inherit from AyuGramDesktop
maintainers = with maintainers; [
kaeeraa
s0me1newithhand7s
];
platforms = lib.platforms.linux;
description = "Desktop Telegram client with good customization and Ghost mode.";
license = licenses.gpl3Only;
homepage = "https://ayugram.one";
downloadPage = "https://github.com/Ayugram/AyuGramDesktop/releases/tag/v${version}";
changelog = "https://github.com/Ayugram/AyuGramDesktop/releases/tag/v${version}";
longDescription = ''
AyuGram is a fork of Telegram Desktop with a focus on
customization. It includes features like a customizable
interface, Ghost mode, and more.
'';
};
})