Add NetBSD build instructions generator.

GitOrigin-RevId: ad45d7152dea2b77ed539e572807ace8eb6724c9
This commit is contained in:
levlam 2019-08-02 21:32:58 +03:00
parent 1a100e1b0f
commit 2ca4a088b3
2 changed files with 24 additions and 7 deletions

View File

@ -19,7 +19,7 @@ TDLib (Telegram Database library) is a cross-platform library for building [Tele
`TDLib` has many advantages. Notably `TDLib` is:
* **Cross-platform**: `TDLib` can be used on Android, iOS, Windows, macOS, Linux, FreeBSD, OpenBSD, Windows Phone, WebAssembly, watchOS, tvOS, Tizen, Cygwin. It should also work on other *nix systems with or without minimal effort.
* **Cross-platform**: `TDLib` can be used on Android, iOS, Windows, macOS, Linux, FreeBSD, OpenBSD, NetBSD, Windows Phone, WebAssembly, watchOS, tvOS, Tizen, Cygwin. It should also work on other *nix systems with or without minimal effort.
* **Multilanguage**: `TDLib` can be easily used with any programming language that is able to execute C functions. Additionally it already has native Java (using `JNI`) bindings and .NET (using `C++/CLI` and `C++/CX`) bindings.
* **Easy to use**: `TDLib` takes care of all network implementation details, encryption and local data storage.
* **High-performance**: in the [Telegram Bot API](https://core.telegram.org/bots/api), each `TDLib` instance handles more than 24000 active bots simultaneously.

View File

@ -163,7 +163,7 @@ function getSupportedOs(language) {
case 'Choose a programming language:':
return [];
case 'JavaScript':
return ['Windows (Node.js)', 'Linux (Node.js)', 'macOS (Node.js)', 'FreeBSD (Node.js)', 'OpenBSD (Node.js)', 'Browser'];
return ['Windows (Node.js)', 'Linux (Node.js)', 'macOS (Node.js)', 'FreeBSD (Node.js)', 'OpenBSD (Node.js)', 'NetBSD (Node.js)', 'Browser'];
case 'Java':
return ['Windows', 'Linux', 'macOS', 'FreeBSD', 'OpenBSD', 'Android'];
case 'C#':
@ -172,7 +172,7 @@ function getSupportedOs(language) {
case 'Objective-C':
return ['Windows', 'Linux', 'macOS', 'iOS', 'tvOS', 'watchOS'];
default:
return ['Windows', 'Linux', 'macOS', 'FreeBSD', 'OpenBSD'];
return ['Windows', 'Linux', 'macOS', 'FreeBSD', 'OpenBSD', 'NetBSD'];
}
}
@ -342,6 +342,7 @@ function onOptionsChanged() {
var os_mac = os.includes('macOS');
var os_freebsd = os.includes('FreeBSD');
var os_openbsd = os.includes('OpenBSD');
var os_netbsd = os.includes('NetBSD');
var display_commands = 'block';
var linux_distro = 'none';
@ -365,7 +366,7 @@ function onOptionsChanged() {
}
var low_memory = false;
if (os_linux || os_freebsd || os_openbsd) {
if (os_linux || os_freebsd || os_openbsd || os_netbsd) {
low_memory = document.getElementById('buildLowMemoryCheckbox').checked;
document.getElementById('buildLowMemoryText').innerHTML = 'I have less than ' + (use_clang ? '1.5' : '3.5') +' GB of RAM.' +
(low_memory ? ' Now you will need only ' + (use_clang ? '0.5' : '1') +' GB of RAM to build TDLib.' : '');
@ -375,7 +376,7 @@ function onOptionsChanged() {
}
var use_root = false;
if (os_linux && linux_distro !== 'Other') {
if ((os_linux && linux_distro !== 'Other') || os_openbsd || os_netbsd) {
use_root = document.getElementById('buildRootCheckbox').checked;
document.getElementById('buildRootDiv').style.display = 'block';
} else {
@ -432,7 +433,7 @@ function onOptionsChanged() {
}
var sudo = 'sudo ';
if (use_root || linux_distro.includes('Debian') || os_freebsd || os_openbsd) {
if (use_root || linux_distro.includes('Debian') || os_freebsd || os_openbsd || os_netbsd) {
sudo = '';
}
@ -508,6 +509,9 @@ function onOptionsChanged() {
if (os_openbsd) {
pre_text.push('Note that following instruction is for OpenBSD 6.4 and default KSH shell.');
}
if (os_netbsd) {
pre_text.push('Note that following instruction is for NetBSD 8.0 and default SH shell.');
}
var terminal_name = (function () {
if (os_windows) {
@ -519,6 +523,9 @@ function onOptionsChanged() {
if (os_openbsd) {
return 'ksh';
}
if (os_netbsd) {
return 'sh';
}
if (use_csh) {
return 'tcsh/csh';
}
@ -639,6 +646,16 @@ function onOptionsChanged() {
}
php = "php-7.2";
} else if (os_netbsd) {
if (!use_root) {
commands.push('su -');
}
commands.push('export PKG_PATH=ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/8.0_2019Q2/All');
var packages = 'git gperf php-7.3.6 cmake openssl gcc5-libs';
commands.push('pkg_add ' + packages);
if (!use_root) {
commands.push('exit');
}
}
commands.push('git clone https://github.com/tdlib/td.git');
@ -812,7 +829,7 @@ function onOptionsChanged() {
if (os_freebsd) {
cmake_init_options.push('-DJAVA_HOME=/usr/local/openjdk7/');
}
var resolve_path = use_powershell ? 'Resolve-Path' : (os_mac ? 'greadlink -e' : (is_alpine || os_freebsd || os_openbsd ? 'readlink -f' : 'readlink -e'));
var resolve_path = use_powershell ? 'Resolve-Path' : (os_mac ? 'greadlink -e' : (is_alpine || os_freebsd || os_openbsd || os_netbsd ? 'readlink -f' : 'readlink -e'));
var resolved_path = resolve_path + ' ../td/lib/cmake/Td';
if (use_csh) {
cmake_init_options.push('-DTd_DIR:PATH=$td_dir');