mirror of
https://github.com/tdlib/telegram-bot-api
synced 2025-08-21 17:37:48 +00:00
Compare commits
3 Commits
287fd0a4ae
...
70c1be4951
Author | SHA1 | Date | |
---|---|---|---|
|
70c1be4951 | ||
|
6ba3d865ac | ||
|
e2c834103a |
50
build.html
50
build.html
@ -75,7 +75,7 @@
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
select, button {
|
||||
select, button, input {
|
||||
border: 1px solid var(--color-select-border);
|
||||
background-color: var(--background);
|
||||
color: var(--color);
|
||||
@ -201,8 +201,10 @@
|
||||
<option>Alpine</option>
|
||||
<option>CentOS 7</option>
|
||||
<option>CentOS 8</option>
|
||||
<option>CentOS Stream 9</option>
|
||||
<option>Debian 8/9</option>
|
||||
<option>Debian 10+</option>
|
||||
<option>Fedora 21+</option>
|
||||
<option>Ubuntu 14</option>
|
||||
<option>Ubuntu 16</option>
|
||||
<option>Ubuntu 18</option>
|
||||
@ -264,6 +266,14 @@
|
||||
<label><input type="checkbox" id="buildRootCheckbox" onchange="onOptionsChanged()"/>Build from root user (not recommended).</label>
|
||||
</div>
|
||||
|
||||
<div id="buildMultiCoreDiv" class="hide">
|
||||
<label><input type="checkbox" id="buildMultiCoreCheckbox" onchange="onOptionsChanged()"/>Build using mulitple cores<span class="hide" id="buildMultiCoreColon">:</span></label>
|
||||
|
||||
<div id="buildMultiCoreInputDiv" class="hide">
|
||||
<input type="number" id="buildMultiCoreInput" onchange="onOptionsChanged()" placeholder="Cores number" min="1" style="text-align: center;"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p></p>
|
||||
</div>
|
||||
|
||||
@ -352,9 +362,10 @@ function onOptionsChanged() {
|
||||
linux_distro = document.getElementById('linuxSelect').value;
|
||||
}
|
||||
document.getElementById('buildCommandsDiv').style.display = 'block';
|
||||
document.getElementById('buildMultiCoreDiv').style.display = 'block';
|
||||
|
||||
var use_clang = os_freebsd || os_openbsd;
|
||||
if (os_linux && linux_distro !== 'Alpine' && !linux_distro.includes('CentOS')) {
|
||||
if (os_linux && linux_distro !== 'Alpine' && !linux_distro.includes('CentOS') && !linux_distro.includes('Fedora')) {
|
||||
document.getElementById('buildCompilerDiv').style.display = 'block';
|
||||
use_clang = document.getElementById('buildCompilerRadioClang').checked;
|
||||
} else {
|
||||
@ -531,19 +542,31 @@ function onOptionsChanged() {
|
||||
commands.push(sudo + 'apk add ' + packages);
|
||||
break;
|
||||
case 'CentOS 7':
|
||||
case 'CentOS 8':
|
||||
commands.push(sudo + 'yum update -y');
|
||||
var packages = 'gcc-c++ make git zlib-devel openssl-devel';
|
||||
if (linux_distro === 'CentOS 7') {
|
||||
commands.push(sudo + 'yum install -y centos-release-scl-rh epel-release');
|
||||
commands.push(sudo + 'yum install -y devtoolset-9-gcc devtoolset-9-gcc-c++');
|
||||
cmake = 'cmake3';
|
||||
packages += ' gperf';
|
||||
} else {
|
||||
commands.push(sudo + 'yum install -y centos-release-scl-rh epel-release');
|
||||
commands.push(sudo + 'yum install -y devtoolset-9-gcc devtoolset-9-gcc-c++');
|
||||
cmake = 'cmake3';
|
||||
packages += ' gperf ' + cmake;
|
||||
commands.push(sudo + 'yum install -y ' + packages);
|
||||
break;
|
||||
case 'CentOS 8':
|
||||
case 'CentOS Stream 9':
|
||||
commands.push(sudo + 'dnf update -y');
|
||||
var packages = 'gcc-c++ make git zlib-devel openssl-devel';
|
||||
if (linux_distro === 'CentOS 8') {
|
||||
commands.push(sudo + 'dnf --enablerepo=powertools install gperf');
|
||||
} else {
|
||||
commands.push(sudo + 'dnf --enablerepo=crb install gperf');
|
||||
}
|
||||
packages += ' ' + cmake;
|
||||
commands.push(sudo + 'yum install -y ' + packages);
|
||||
commands.push(sudo + 'dnf install -y ' + packages);
|
||||
break;
|
||||
case 'Fedora 21+':
|
||||
commands.push(sudo + 'dnf update -y');
|
||||
var packages = 'gperf gcc-c++ make git zlib-devel openssl-devel';
|
||||
packages += ' ' + cmake;
|
||||
commands.push(sudo + 'dnf install -y ' + packages);
|
||||
break;
|
||||
case 'Debian 8/9':
|
||||
case 'Debian 10+':
|
||||
@ -675,6 +698,11 @@ function onOptionsChanged() {
|
||||
commands.push('cd ../build');
|
||||
}
|
||||
let build_command = cmake + ' --build . --target install';
|
||||
|
||||
if (document.getElementById('buildMultiCoreCheckbox').checked && document.getElementById('buildMultiCoreInput').value.toString().length > 0 && !(isNaN(document.getElementById('buildMultiCoreInput').value))) {
|
||||
build_command += ` -j ${ document.getElementById('buildMultiCoreInput').value }`;
|
||||
}
|
||||
|
||||
if (use_msvc) {
|
||||
if (!is_debug_build) {
|
||||
commands.push(build_command + ' --config Release');
|
||||
@ -693,6 +721,8 @@ function onOptionsChanged() {
|
||||
if (install_dir !== '/usr/local') {
|
||||
install_dir = 'telegram-bot-api';
|
||||
}
|
||||
document.getElementById('buildMultiCoreInputDiv').style.display = document.getElementById('buildMultiCoreCheckbox').checked ? 'block' : 'none';
|
||||
document.getElementById('buildMultiCoreColon').style.display = document.getElementById('buildMultiCoreCheckbox').checked ? 'inline' : 'none';
|
||||
commands.push((use_powershell ? 'dir ' : 'ls -l ') + install_dir + '/bin/telegram-bot-api*');
|
||||
document.getElementById('buildCommands').innerHTML = '<ul><li>' + commands.join('</li><li>') + '</li></ul>';
|
||||
document.getElementById('copyBuildCommandsButton').style.display = commands.includes('exit') ? 'none' : 'block';
|
||||
|
Loading…
x
Reference in New Issue
Block a user