You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6df8bf5
Browse filesBrowse the repository at this point in the historyBrowse files
Both were built from source as part of setting up a checkout. libvlc meant an 8.8 GB submodule,
Docker and the VideoLAN contrib toolchain; webrtc meant depot_tools, a ~1.5 hour sync, ~20 GB of
disk and a multi-hour build, ending in absolute paths to C:\webrtc hardcoded in two project
files. Both change about once a year.
They are vcpkg overlay ports now, downloading an archive for the architecture being built and
verifying it against a recorded SHA512. The sources, the scripts that produce the archives and
the patches they need moved to UnigramDev/deps, and the archives are published as releases there,
each naming the fork commit it was built from.
The libvlc port also has to place the plugin tree, which cannot be flattened: the plugins' paths
are recorded in the generated plugins.dat cache, so they reach the package as
plugins\<category>\<name>.dll through Content items rather than the flat copy the other
dependencies use.
VcpkgAutoLink is off. It put every .lib in the installed tree on every link line, which since
webrtc arrived meant Telegram.Native scanning a 339 MB static library it has no reference into.
Each project now names what it links, derived from what the binaries actually import.
tgcalls and Telegram.Native.Calls include libyuv by its full path. webrtc carries a patched copy
whose ConvertToI420 takes three extra parameters, and vcpkg's libyuv port supplies the stock one,
so a plain <libyuv.h> resolved to whichever include directory came first -- which was decided by
a hardcoded path that no longer exists. The three compiled files that used the ambiguous form now
say which library they mean.
Libraries/vlc and Libraries/webrtc are gone, submodule included. The VLC checkout the former held
is an ordinary clone of the fork now, kept outside the repository.
The instructions for building without WebRTC go too. Removing the project reference and the
ENABLE_CALLS directive still compiles, but webrtc is listed in vcpkg.json, so the restore installs
it for the triplet either way -- the download that section existed to avoid is spent before any
project is built. Making it work again means a manifest feature, not a set of manual edits.
duplicated-libraries.md records what the app now carries more than one copy of -- two ffmpeg
builds, and opus and libyuv both as DLLs and inside webrtc.lib -- with the measurements behind it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Condition="'$(UnigramUsesVcpkg)' == 'true' And '$(MSBuildProjectExtension)' == '.vcxproj' And Exists('$(VcpkgRoot)\scripts\buildsystems\msbuild\vcpkg.targets')" />
5
5
6
+
<!--
7
+
With VcpkgAutoLink off, each project names the libraries it links. The lists below were
8
+
derived from the imports of the binaries built with autolink on, so they are what the linker
9
+
actually resolved rather than what the manifest happens to contain:
Copy file name to clipboardExpand all lines: Documentation/Build-instructions.md
+14-66Lines changed: 14 additions & 66 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,9 +61,8 @@ Two things about that checkout matter:
61
61
```
62
62
The build checks this before doing anything and tells you the exact commands if it is behind.
63
63
64
-
That is the whole setup. There is no port to edit by hand, no patch to apply, and
65
-
**do not** run `vcpkg integrate install` — the repository disables the machine-wide
66
-
integration so that it always builds against its own pinned commit.
64
+
That is the whole setup. **Do not** run `vcpkg integrate install`: the repository disables the
65
+
machine-wide integration so that it always builds against its own pinned commit.
67
66
68
67
Everything else comes from `vcpkg.json` in the repository root, which is a
69
68
[manifest](https://learn.microsoft.com/vcpkg/consume/manifest-mode): it pins the vcpkg commit
@@ -99,72 +98,21 @@ The script picks up `VCPKG_ROOT` and builds against the manifest in the reposito
99
98
openssl and zlib are the same builds the app links. You can choose to build both `x64` and
100
99
`arm64` or just the architecture you need.
101
100
102
-
### LibVLC
103
-
Unigram uses LibVLC to play videos and audio in the app. We can't use the system provided media player doesn't meet the app quality expectations.
104
-
The app is currently using version `3.0.22-rc1` with some patches applied on top, and can be built by running the script `build.ps1` located in `Unigram repository\Libraries\vlc`.
101
+
### LibVLC and WebRTC
105
102
106
-
Building LibVLC requires [Docker](https://docs.docker.com/desktop/setup/install/windows-install/) to be installed and running.
103
+
LibVLC plays video and audio, and WebRTC backs calls and video chats. Both arrive as prebuilt
104
+
binaries through the same manifest as everything else, as overlay ports in
105
+
`Libraries\vcpkg-ports`. The build downloads an archive for the architecture it is building,
106
+
verifies it against a SHA512 recorded in the port, and caches it — so there is nothing to install
The script will automatically apply the needed patches to libvlc (that comes as a submodule when you clone the repository) and create a NuGet package inside the `Libraries` folder.
113
-
114
-
For reference, this is the list of VLC plugins currently needed by Unigram to properly work:
Unigram uses WebRTC for calls and video chats. Since WebRTC doesn't currently support UWP, you must use our fork to build it.
153
-
1. Click on Start Menu → Visual Studio 2022 → x64 Native Tools Command Prompt for VS 2022.
154
-
2. Navigate to .\Unigram\Libraries\webrtc
155
-
3. Execute `.\acquire.cmd`. This will clone WebRTC source code to `C:\webrtc`, and it will take a while (~1.5h)
156
-
4. Execute `.\build.cmd "$arch$" "$config$"`. Replace `$arch$` with either `x64`, `win32` or `arm64` depending on your build target. `$config$` can be set to either `release` or `debug`.
157
-
158
-
⚠️ Note that WebRTC build instructions are based on [WinRTC](https://github.com/microsoft/winrtc/tree/master/patches_for_WebRTC_org/m84).
159
-
160
-
### Building without WebRTC
161
-
Since compiling WebRTC is time and resources consuming, it is possible to build the app without calls support:
162
-
- Locate Telegram > References and remove `Telegram.Native.Calls` from the list.
163
-
- From Telegram > Properties > Build, remove `ENABLE_CALLS` directive.
0 commit comments