Skip to content

Commit

Permalink
prebuilt-tdlib update
Browse files Browse the repository at this point in the history
- The minimum macOS version is now 11.0 (apple-sdk_11 is used)
- Split the macOS package into two separate ones for x86_64 and arm64
  instead of using universal binaries
- Changed the github action runner for the Windows binary to
  windows-2022 from windows-2019
  • Loading branch information
eilvelia committed Nov 17, 2024
1 parent 37cd3b0 commit cd0bd50
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 33 deletions.
37 changes: 11 additions & 26 deletions .github/workflows/prebuilt-tdlib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
with:
name: tdlib-linux-x86_64-glibc
path: ${{ env.TO_UPLOAD }}

build-linux-arm64:
name: 'Build TDLib / Linux arm64 glibc (cross)'
runs-on: ubuntu-22.04
Expand All @@ -51,6 +52,7 @@ jobs:
with:
name: tdlib-linux-arm64-glibc
path: ${{ env.TO_UPLOAD }}

build-macos-x86_64:
name: 'Build TDLib / macOS x86_64'
runs-on: macos-13
Expand All @@ -65,8 +67,9 @@ jobs:
./build-macos.sh ${{ inputs.tdlib }}
- uses: actions/upload-artifact@v4
with:
name: temp-macos-x86_64
name: tdlib-macos-x86_64
path: ${{ env.TO_UPLOAD }}

build-macos-arm64:
name: 'Build TDLib / macOS arm64'
runs-on: macos-14
Expand All @@ -83,31 +86,12 @@ jobs:
run: codesign -v ${{ env.TO_UPLOAD }}/libtdjson.dylib
- uses: actions/upload-artifact@v4
with:
name: temp-macos-arm64
name: tdlib-macos-arm64
path: ${{ env.TO_UPLOAD }}
build-macos:
name: Create universal macOS shared library
needs: [build-macos-x86_64, build-macos-arm64]
runs-on: macos-13
steps:
- uses: actions/download-artifact@v4
with:
pattern: temp-macos-*
- name: Combine shared libraries
run: |
mkdir -p to-upload
lipo temp-macos-x86_64/libtdjson.dylib temp-macos-arm64/libtdjson.dylib \
-output to-upload/libtdjson.dylib -create
cd to-upload
file libtdjson.dylib
otool -L libtdjson.dylib
- uses: actions/upload-artifact@v4
with:
name: tdlib-macos
path: to-upload

build-windows-x86_64:
name: 'Build TDLib / Windows x86_64'
runs-on: windows-2019
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -146,7 +130,8 @@ jobs:
name: 'Test / ${{ matrix.v.bin }} / ${{ matrix.v.os }}'
needs:
- build-linux-x86_64
- build-macos
- build-macos-x86_64
- build-macos-arm64
- build-windows-x86_64
runs-on: ${{ matrix.v.os }}
strategy:
Expand All @@ -156,9 +141,9 @@ jobs:
- os: ubuntu-latest
bin: tdlib-linux-x86_64-glibc
- os: macos-13
bin: tdlib-macos
bin: tdlib-macos-x86_64
- os: macos-14
bin: tdlib-macos
bin: tdlib-macos-arm64
- os: windows-latest
bin: tdlib-windows-x86_64
steps:
Expand Down
12 changes: 11 additions & 1 deletion packages/prebuilt-tdlib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using [npm publish --provenance][npm-provenance].

Supported systems:
- Linux x86_64, arm64 (requires glibc >= 2.22)
- macOS x86_64, arm64 (universal, requires macOS >= 10.12)
- macOS x86_64, arm64 (requires macOS >= 11.0)
- Windows x86_64

To install `prebuilt-tdlib` for the latest TDLib version that `prebuilt-tdlib`
Expand Down Expand Up @@ -117,6 +117,16 @@ package.json, see e.g. `npm info prebuilt-tdlib tdlib` (or `tdlib.commit`).

Changes to the building process of `prebuilt-tdlib` are noted below.

### 2024-11-17

First published as `[email protected]`.

- Minimum macOS version is now 11.0 instead of 10.12.
- The macOS package is split into `darwin-x64` and `darwin-arm64` instead of
using a universal binary.
- The Windows binary is built on the `windows-2022` GitHub Actions runner
instead of `windows-2019`.

### 2024-07-19

First published as `[email protected]`.
Expand Down
4 changes: 2 additions & 2 deletions packages/prebuilt-tdlib/ci/tdlib-macos.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ rev }:
let
pkgs = import <nixpkgs> {};
inherit (pkgs) lib stdenv;
inherit (pkgs) lib stdenv apple-sdk_11;
zlib = pkgs.zlib.override { static = true; shared = false; };
openssl = pkgs.openssl.override { static = true; };
in
Expand All @@ -12,7 +12,7 @@ stdenv.mkDerivation {

src = builtins.fetchTarball "https://github.com/tdlib/td/archive/${rev}.tar.gz";

buildInputs = [ openssl zlib ];
buildInputs = [ openssl zlib apple-sdk_11 ];
nativeBuildInputs = with pkgs; [ cmake gperf ];

cmakeFlags = [
Expand Down
19 changes: 15 additions & 4 deletions packages/prebuilt-tdlib/prebuild-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,23 @@ const prebuilds/*: PrebuildInfo[] */ = [
}
},
{
packageName: 'darwin',
prebuildDir: 'tdlib-macos',
packageName: 'darwin-x64',
prebuildDir: 'tdlib-macos-x86_64',
libfile: SHARED_MACOS,
descr: 'macOS (universal)',
descr: 'macOS x86_64',
requirements: {
os: ['darwin']
os: ['darwin'],
cpu: ['x64']
}
},
{
packageName: 'darwin-arm64',
prebuildDir: 'tdlib-macos-arm64',
libfile: SHARED_MACOS,
descr: 'macOS arm64',
requirements: {
os: ['darwin'],
cpu: ['arm64']
}
},
{
Expand Down

0 comments on commit cd0bd50

Please sign in to comment.