prebuilt-tdlib
Advanced tools
Comparing version 0.1008012.0 to 0.1008014.0
20
index.js
@@ -6,2 +6,3 @@ // @flow | ||
// For now, the `Options` object is present for forward compatibility. | ||
// TODO: Add an option like "fallback"? | ||
/*:: | ||
@@ -11,3 +12,4 @@ export type Options = { | ||
libc: 'glibc' | ||
} */ | ||
} | ||
*/ | ||
@@ -20,10 +22,10 @@ function prebuild (pathcomps/*: string[] */) { | ||
function getTdjson (options/*:: ?: Options */)/*: string */ { | ||
if (process.arch !== 'x64') | ||
throw new Error(`The ${process.arch} architecture is not supported`) | ||
switch (process.platform) { | ||
case 'win32': return prebuild(['tdlib-windows-x64', 'tdjson.dll']) | ||
case 'darwin': return prebuild(['tdlib-macos-x64', 'libtdjson.dylib']) | ||
case 'linux': return prebuild(['tdlib-linux-x64', 'libtdjson.so']) | ||
case 'android': return prebuild(['tdlib-linux-x64', 'libtdjson.so']) | ||
default: throw new Error(`The ${process.platform} OS is not supported`) | ||
const platform = process.platform + '-' + process.arch | ||
switch (platform) { | ||
case 'win32-x64': return prebuild(['tdlib-windows-x64', 'tdjson.dll']) | ||
case 'darwin-x64': return prebuild(['tdlib-macos', 'libtdjson.dylib']) | ||
case 'darwin-arm64': return prebuild(['tdlib-macos', 'libtdjson.dylib']) | ||
case 'linux-x64': return prebuild(['tdlib-linux-x64', 'libtdjson.so']) | ||
case 'android-x64': return prebuild(['tdlib-linux-x64', 'libtdjson.so']) | ||
default: throw new Error(`The ${platform} platform is not supported`) | ||
} | ||
@@ -30,0 +32,0 @@ } |
{ | ||
"name": "prebuilt-tdlib", | ||
"version": "0.1008012.0", | ||
"version": "0.1008014.0", | ||
"description": "Prebuilt TDLib libraries", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
## Prebuilt TDLib | ||
# Prebuilt TDLib | ||
@@ -13,23 +13,23 @@ This package distributes pre-built [TDLib][] shared libraries through npm. | ||
Supported systems: | ||
- GNU/Linux x86_64 | ||
- macOS x86_64 | ||
- GNU/Linux x86_64 (requires glibc >= 2.17) | ||
- macOS x86_64, arm64 (universal, requires macOS >= 10.14) | ||
- Windows x86_64 | ||
On Linux, TDLib is built on Ubuntu 20.04 and requires glibc version >= 2.31 to | ||
be installed on your system. | ||
To install `prebuilt-tdlib` for e.g. TDLib v1.8.14, run: | ||
Note that Apple silicon Macs (including M1) are not yet supported. | ||
To install `prebuilt-tdlib` for e.g. TDLib v1.8.12, run: | ||
```console | ||
$ npm install prebuilt-tdlib@td-1.8.12 | ||
$ npm install prebuilt-tdlib@td-1.8.14 | ||
``` | ||
`prebuilt-tdlib` can be installed for other TDLib versions, see the "npm tags" | ||
section below or `$ npm info prebuilt-tdlib` to get the list of available | ||
versions. | ||
`prebuilt-tdlib` can be installed for other TDLib versions, run | ||
`$ npm info prebuilt-tdlib dist-tags` to get the list of available versions | ||
(or see the "npm tags" section below). | ||
### Usage | ||
> **Note**: Before `prebuilt-tdlib@td-1.8.14`, the Linux binary was built on | ||
> Ubuntu 20.04 requiring glibc >= 2.31, and macOS arm64 was not supported. | ||
> Currently, the Linux build environment is based on CentOS 7. | ||
> The macOS arm64 binary isn't tested in the CI. | ||
## Usage | ||
The `prebuilt-tdlib` package exports a single function `getTdjson`, which | ||
@@ -46,3 +46,3 @@ returns the path to the `tdjson` shared library. | ||
This package can be used with, for example, [`tdl`][tdl]. You can pass the | ||
path to the `TDLib` constructor: | ||
path to `tdl.configure` (since tdl v7.3.0): | ||
@@ -52,10 +52,14 @@ [tdl]: https://github.com/Bannerets/tdl | ||
```javascript | ||
const { TDLib } = require('tdl-tdlib-addon') | ||
const tdl = require('tdl') | ||
const { getTdjson } = require('prebuilt-tdlib') | ||
/* ... */ new TDLib(getTdjson()) /* ... */ | ||
tdl.configure({ tdjson: getTdjson() }) | ||
// ... | ||
``` | ||
### Versioning | ||
## Versioning conventions | ||
Because TDLib does not follow Semver, to not require the users to manually | ||
> **Note**: This information is mostly for maintaining `prebuilt-tdlib`, it | ||
> isn't necessary for using this package. | ||
Because TDLib does not follow SemVer, not to require the users to manually | ||
specify the exact version of `prebuilt-tdlib` in their `package.json`, the TDLib | ||
@@ -73,3 +77,3 @@ version is packed into a single minor version. | ||
E.g. the npm release for TDLib `v1.8.5` is `0.1008005.0`. | ||
Example: the npm release for TDLib `v1.8.5` is `0.1008005.0`. | ||
@@ -86,9 +90,14 @@ For convenience, `td-X` dist-tags are available. To install `prebuilt-tdlib` for | ||
### npm tags | ||
## npm tags | ||
- [![npm](https://img.shields.io/npm/v/prebuilt-tdlib/latest.svg)](https://www.npmjs.com/package/prebuilt-tdlib) | ||
- [![npm](https://img.shields.io/npm/v/prebuilt-tdlib/beta.svg)](https://www.npmjs.com/package/prebuilt-tdlib) | ||
- [![npm](https://img.shields.io/npm/v/prebuilt-tdlib/td-1.8.12.svg)](https://www.npmjs.com/package/prebuilt-tdlib/v/td-1.8.12) (tdlib commit [70bee089d492437ce931aa78446d89af3da182fc](https://github.com/tdlib/td/commit/70bee089d492437ce931aa78446d89af3da182fc) | ||
- [![npm](https://img.shields.io/npm/v/prebuilt-tdlib/td-1.8.7.svg)](https://www.npmjs.com/package/prebuilt-tdlib/v/td-1.8.7) (tdlib commit [de5379f00b6af7686f197037ca3b494e6277e523](https://github.com/tdlib/td/commit/de5379f00b6af7686f197037ca3b494e6277e523) | ||
- [![npm](https://img.shields.io/npm/v/prebuilt-tdlib/td-1.8.5.svg)](https://www.npmjs.com/package/prebuilt-tdlib/v/td-1.8.5) (tdlib commit [d9cfcf88fe4ad06dae1716ce8f66bbeb7f9491d9](https://github.com/tdlib/td/commit/d9cfcf88fe4ad06dae1716ce8f66bbeb7f9491d9)) | ||
- [![npm](https://img.shields.io/npm/v/prebuilt-tdlib/stable.svg)](https://www.npmjs.com/package/prebuilt-tdlib) | ||
<!-- Add new versions below --> | ||
- [![npm](https://img.shields.io/npm/v/prebuilt-tdlib/td-1.8.14.svg)](https://www.npmjs.com/package/prebuilt-tdlib/v/td-1.8.14) tdlib [66234ae2537a99ec0eaf7b0857245a6e5c2d2bc9](https://github.com/tdlib/td/commit/66234ae2537a99ec0eaf7b0857245a6e5c2d2bc9) | ||
- [![npm](https://img.shields.io/npm/v/prebuilt-tdlib/td-1.8.12.svg)](https://www.npmjs.com/package/prebuilt-tdlib/v/td-1.8.12) tdlib [70bee089d492437ce931aa78446d89af3da182fc](https://github.com/tdlib/td/commit/70bee089d492437ce931aa78446d89af3da182fc) | ||
- [![npm](https://img.shields.io/npm/v/prebuilt-tdlib/td-1.8.7.svg)](https://www.npmjs.com/package/prebuilt-tdlib/v/td-1.8.7) tdlib [de5379f00b6af7686f197037ca3b494e6277e523](https://github.com/tdlib/td/commit/de5379f00b6af7686f197037ca3b494e6277e523) | ||
- [![npm](https://img.shields.io/npm/v/prebuilt-tdlib/td-1.8.5.svg)](https://www.npmjs.com/package/prebuilt-tdlib/v/td-1.8.5) tdlib [d9cfcf88fe4ad06dae1716ce8f66bbeb7f9491d9](https://github.com/tdlib/td/commit/d9cfcf88fe4ad06dae1716ce8f66bbeb7f9491d9) | ||
- [![npm](https://img.shields.io/npm/v/prebuilt-tdlib/td-1.8.0.svg)](https://www.npmjs.com/package/prebuilt-tdlib/v/td-1.8.0) | ||
- [![npm](https://img.shields.io/npm/v/prebuilt-tdlib/td-1.7.0.svg)](https://www.npmjs.com/package/prebuilt-tdlib/v/td-1.7.0) | ||
- [![npm](https://img.shields.io/npm/v/prebuilt-tdlib/td-1.6.0.svg)](https://www.npmjs.com/package/prebuilt-tdlib/v/td-1.6.0) | ||
- [![npm](https://img.shields.io/npm/v/prebuilt-tdlib/td-1.5.0.svg)](https://www.npmjs.com/package/prebuilt-tdlib/v/td-1.5.0) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87882121
12
30
99