-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prebuilt-tdlib workflow update: move to nix
The macOS and Linux builds are moved to nix. macOS packages on nixpkgs are automatically built with an old version of MACOSX_DEPLOYMENT_TARGET, which is convenient. The Linux build uses zig cc. The x86_64 Linux build is fixed now. Crosscompilation to aarch64 Linux is still planned.
- Loading branch information
Showing
12 changed files
with
308 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
prebuilds/tdlib-* | ||
prebuilds/*.json | ||
to-upload/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,8 @@ The shared libraries are statically linked against OpenSSL and zlib to prevent | |
compatibility issues in Node.js. | ||
|
||
Supported systems: | ||
- GNU/Linux x86_64 (requires glibc >= 2.17) | ||
- macOS x86_64, arm64 (universal, requires macOS >= 10.14) | ||
- Linux x86_64 (requires glibc >= 2.22) | ||
- macOS x86_64, arm64 (universal, requires macOS >= 10.12) | ||
- Windows x86_64 | ||
|
||
To install `prebuilt-tdlib` for the latest TDLib version that `prebuilt-tdlib` | ||
|
@@ -121,6 +121,15 @@ An incomplete list is available below (mostly exceptions or "notable" versions): | |
|
||
Changes to the building process of `prebuilt-tdlib` are noted below. | ||
|
||
### (unreleased) | ||
|
||
The building process of Linux and macOS builds is significantly changed. | ||
|
||
- on macOS, TDLib is built using macOS SDK from nixpkgs, and the minimal | ||
supported macOS version is now 10.12 instead of 10.14. | ||
- On Linux, TDLib is now built using zig. The minimal glibc version is 2.22 | ||
instead of 2.17. | ||
|
||
### 2024-05-08 | ||
|
||
First published as `[email protected]`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
_tdlib=$1 | ||
_target="${2:-x86_64-linux-gnu.2.22}" | ||
|
||
if [ -z "$_tdlib" ]; then | ||
echo "Not enough arguments: expected TDLib rev" | ||
exit 1 | ||
fi | ||
|
||
set -ex | ||
|
||
nix-build tdlib-linux.nix -v --argstr rev "$_tdlib" --argstr target "$_target" | ||
|
||
mkdir to-upload | ||
cp -L ./result/lib/libtdjson.so to-upload/libtdjson.so | ||
cd to-upload | ||
|
||
# Info | ||
ldd libtdjson.so | ||
|
||
if [ -z "$GITHUB_ENV" ]; then | ||
echo "Note: GITHUB_ENV not found" | ||
exit | ||
fi | ||
|
||
# Resulting directory | ||
echo "TO_UPLOAD=$(pwd)" >> $GITHUB_ENV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
_tdlib=$1 | ||
|
||
if [ -z "$_tdlib" ]; then | ||
echo "Not enough arguments: expected TDLib rev" | ||
exit 1 | ||
fi | ||
|
||
set -ex | ||
|
||
nix-build tdlib-macos.nix -v --argstr rev "$_tdlib" | ||
|
||
mkdir to-upload | ||
cp -L ./result/lib/libtdjson.dylib to-upload/libtdjson.dylib | ||
cd to-upload | ||
|
||
install_name_tool -id @rpath/libtdjson.dylib libtdjson.dylib | ||
install_name_tool -change \ | ||
"$(otool -L libtdjson.dylib | grep -o '/nix/store.*libc++.*.dylib')" \ | ||
'/usr/lib/libc++.1.dylib' \ | ||
libtdjson.dylib | ||
|
||
# Info | ||
otool -L libtdjson.dylib | ||
otool -l libtdjson.dylib | ||
|
||
if [ -z "$GITHUB_ENV" ]; then | ||
echo "Note: GITHUB_ENV not found" | ||
exit | ||
fi | ||
|
||
# Resulting directory | ||
echo "TO_UPLOAD=$(pwd)" >> $GITHUB_ENV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ openssl, zig-toolchain }: | ||
(openssl.override { static = true; }).overrideAttrs (final: prev: { | ||
preConfigure = zig-toolchain.env; | ||
doCheck = false; | ||
}) |
Oops, something went wrong.