mirror of
https://github.com/TheBinaryNinja/tvapp2.git
synced 2026-06-04 11:55:41 -04:00
build: push tvapp v2 docker files
This commit is contained in:
168
node_modules/playwright-core/lib/server/registry/browserFetcher.js
generated
vendored
Normal file
168
node_modules/playwright-core/lib/server/registry/browserFetcher.js
generated
vendored
Normal file
@@ -0,0 +1,168 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.downloadBrowserWithProgressBar = downloadBrowserWithProgressBar;
|
||||
exports.logPolitely = logPolitely;
|
||||
var _fs = _interopRequireDefault(require("fs"));
|
||||
var _os = _interopRequireDefault(require("os"));
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
var _child_process = _interopRequireDefault(require("child_process"));
|
||||
var _fileUtils = require("../../utils/fileUtils");
|
||||
var _debugLogger = require("../../utils/debugLogger");
|
||||
var _manualPromise = require("../../utils/manualPromise");
|
||||
var _utilsBundle = require("../../utilsBundle");
|
||||
var _ = require(".");
|
||||
var _userAgent = require("../../utils/userAgent");
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
/**
|
||||
* Copyright 2017 Google Inc. All rights reserved.
|
||||
* Modifications copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
async function downloadBrowserWithProgressBar(title, browserDirectory, executablePath, downloadURLs, downloadFileName, downloadConnectionTimeout) {
|
||||
if (await (0, _fileUtils.existsAsync)((0, _.browserDirectoryToMarkerFilePath)(browserDirectory))) {
|
||||
// Already downloaded.
|
||||
_debugLogger.debugLogger.log('install', `${title} is already downloaded.`);
|
||||
return false;
|
||||
}
|
||||
const zipPath = _path.default.join(_os.default.tmpdir(), downloadFileName);
|
||||
try {
|
||||
const retryCount = 3;
|
||||
for (let attempt = 1; attempt <= retryCount; ++attempt) {
|
||||
_debugLogger.debugLogger.log('install', `downloading ${title} - attempt #${attempt}`);
|
||||
const url = downloadURLs[(attempt - 1) % downloadURLs.length];
|
||||
logPolitely(`Downloading ${title}` + _utilsBundle.colors.dim(` from ${url}`));
|
||||
const {
|
||||
error
|
||||
} = await downloadBrowserWithProgressBarOutOfProcess(title, browserDirectory, url, zipPath, executablePath, downloadConnectionTimeout);
|
||||
if (!error) {
|
||||
_debugLogger.debugLogger.log('install', `SUCCESS installing ${title}`);
|
||||
break;
|
||||
}
|
||||
if (await (0, _fileUtils.existsAsync)(zipPath)) await _fs.default.promises.unlink(zipPath);
|
||||
if (await (0, _fileUtils.existsAsync)(browserDirectory)) await _fs.default.promises.rmdir(browserDirectory, {
|
||||
recursive: true
|
||||
});
|
||||
const errorMessage = (error === null || error === void 0 ? void 0 : error.message) || '';
|
||||
_debugLogger.debugLogger.log('install', `attempt #${attempt} - ERROR: ${errorMessage}`);
|
||||
if (attempt >= retryCount) throw error;
|
||||
}
|
||||
} catch (e) {
|
||||
_debugLogger.debugLogger.log('install', `FAILED installation ${title} with error: ${e}`);
|
||||
process.exitCode = 1;
|
||||
throw e;
|
||||
} finally {
|
||||
if (await (0, _fileUtils.existsAsync)(zipPath)) await _fs.default.promises.unlink(zipPath);
|
||||
}
|
||||
logPolitely(`${title} downloaded to ${browserDirectory}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Node.js has a bug where the process can exit with 0 code even though there was an uncaught exception.
|
||||
* Thats why we execute it in a separate process and check manually if the destination file exists.
|
||||
* https://github.com/microsoft/playwright/issues/17394
|
||||
*/
|
||||
function downloadBrowserWithProgressBarOutOfProcess(title, browserDirectory, url, zipPath, executablePath, connectionTimeout) {
|
||||
const cp = _child_process.default.fork(_path.default.join(__dirname, 'oopDownloadBrowserMain.js'));
|
||||
const promise = new _manualPromise.ManualPromise();
|
||||
const progress = getDownloadProgress();
|
||||
cp.on('message', message => {
|
||||
if ((message === null || message === void 0 ? void 0 : message.method) === 'log') _debugLogger.debugLogger.log('install', message.params.message);
|
||||
if ((message === null || message === void 0 ? void 0 : message.method) === 'progress') progress(message.params.done, message.params.total);
|
||||
});
|
||||
cp.on('exit', code => {
|
||||
if (code !== 0) {
|
||||
promise.resolve({
|
||||
error: new Error(`Download failure, code=${code}`)
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!_fs.default.existsSync((0, _.browserDirectoryToMarkerFilePath)(browserDirectory))) promise.resolve({
|
||||
error: new Error(`Download failure, ${(0, _.browserDirectoryToMarkerFilePath)(browserDirectory)} does not exist`)
|
||||
});else promise.resolve({
|
||||
error: null
|
||||
});
|
||||
});
|
||||
cp.on('error', error => {
|
||||
promise.resolve({
|
||||
error
|
||||
});
|
||||
});
|
||||
_debugLogger.debugLogger.log('install', `running download:`);
|
||||
_debugLogger.debugLogger.log('install', `-- from url: ${url}`);
|
||||
_debugLogger.debugLogger.log('install', `-- to location: ${zipPath}`);
|
||||
const downloadParams = {
|
||||
title,
|
||||
browserDirectory,
|
||||
url,
|
||||
zipPath,
|
||||
executablePath,
|
||||
connectionTimeout,
|
||||
userAgent: (0, _userAgent.getUserAgent)()
|
||||
};
|
||||
cp.send({
|
||||
method: 'download',
|
||||
params: downloadParams
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
function logPolitely(toBeLogged) {
|
||||
const logLevel = process.env.npm_config_loglevel;
|
||||
const logLevelDisplay = ['silent', 'error', 'warn'].indexOf(logLevel || '') > -1;
|
||||
if (!logLevelDisplay) console.log(toBeLogged); // eslint-disable-line no-console
|
||||
}
|
||||
function getDownloadProgress() {
|
||||
if (process.stdout.isTTY) return getAnimatedDownloadProgress();
|
||||
return getBasicDownloadProgress();
|
||||
}
|
||||
function getAnimatedDownloadProgress() {
|
||||
let progressBar;
|
||||
let lastDownloadedBytes = 0;
|
||||
return (downloadedBytes, totalBytes) => {
|
||||
if (!progressBar) {
|
||||
progressBar = new _utilsBundle.progress(`${toMegabytes(totalBytes)} [:bar] :percent :etas`, {
|
||||
complete: '=',
|
||||
incomplete: ' ',
|
||||
width: 20,
|
||||
total: totalBytes
|
||||
});
|
||||
}
|
||||
const delta = downloadedBytes - lastDownloadedBytes;
|
||||
lastDownloadedBytes = downloadedBytes;
|
||||
progressBar.tick(delta);
|
||||
};
|
||||
}
|
||||
function getBasicDownloadProgress() {
|
||||
const totalRows = 10;
|
||||
const stepWidth = 8;
|
||||
let lastRow = -1;
|
||||
return (downloadedBytes, totalBytes) => {
|
||||
const percentage = downloadedBytes / totalBytes;
|
||||
const row = Math.floor(totalRows * percentage);
|
||||
if (row > lastRow) {
|
||||
lastRow = row;
|
||||
const percentageString = String(percentage * 100 | 0).padStart(3);
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`|${'■'.repeat(row * stepWidth)}${' '.repeat((totalRows - row) * stepWidth)}| ${percentageString}% of ${toMegabytes(totalBytes)}`);
|
||||
}
|
||||
};
|
||||
}
|
||||
function toMegabytes(bytes) {
|
||||
const mb = bytes / 1024 / 1024;
|
||||
return `${Math.round(mb * 10) / 10} MiB`;
|
||||
}
|
||||
322
node_modules/playwright-core/lib/server/registry/dependencies.js
generated
vendored
Normal file
322
node_modules/playwright-core/lib/server/registry/dependencies.js
generated
vendored
Normal file
@@ -0,0 +1,322 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.dockerVersion = dockerVersion;
|
||||
exports.installDependenciesLinux = installDependenciesLinux;
|
||||
exports.installDependenciesWindows = installDependenciesWindows;
|
||||
exports.readDockerVersionSync = readDockerVersionSync;
|
||||
exports.transformCommandsForRoot = transformCommandsForRoot;
|
||||
exports.validateDependenciesLinux = validateDependenciesLinux;
|
||||
exports.validateDependenciesWindows = validateDependenciesWindows;
|
||||
exports.writeDockerVersion = writeDockerVersion;
|
||||
var _fs = _interopRequireDefault(require("fs"));
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
var os = _interopRequireWildcard(require("os"));
|
||||
var _child_process = _interopRequireDefault(require("child_process"));
|
||||
var utils = _interopRequireWildcard(require("../../utils"));
|
||||
var _spawnAsync = require("../../utils/spawnAsync");
|
||||
var _hostPlatform = require("../../utils/hostPlatform");
|
||||
var _ = require(".");
|
||||
var _nativeDeps = require("./nativeDeps");
|
||||
var _userAgent = require("../../utils/userAgent");
|
||||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
||||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
/**
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const BIN_DIRECTORY = _path.default.join(__dirname, '..', '..', '..', 'bin');
|
||||
const languageBindingVersion = process.env.PW_CLI_DISPLAY_VERSION || require('../../../package.json').version;
|
||||
const dockerVersionFilePath = '/ms-playwright/.docker-info';
|
||||
async function writeDockerVersion(dockerImageNameTemplate) {
|
||||
await _fs.default.promises.mkdir(_path.default.dirname(dockerVersionFilePath), {
|
||||
recursive: true
|
||||
});
|
||||
await _fs.default.promises.writeFile(dockerVersionFilePath, JSON.stringify(dockerVersion(dockerImageNameTemplate), null, 2), 'utf8');
|
||||
// Make sure version file is globally accessible.
|
||||
await _fs.default.promises.chmod(dockerVersionFilePath, 0o777);
|
||||
}
|
||||
function dockerVersion(dockerImageNameTemplate) {
|
||||
return {
|
||||
driverVersion: languageBindingVersion,
|
||||
dockerImageName: dockerImageNameTemplate.replace('%version%', languageBindingVersion)
|
||||
};
|
||||
}
|
||||
function readDockerVersionSync() {
|
||||
try {
|
||||
const data = JSON.parse(_fs.default.readFileSync(dockerVersionFilePath, 'utf8'));
|
||||
return {
|
||||
...data,
|
||||
dockerImageNameTemplate: data.dockerImageName.replace(data.driverVersion, '%version%')
|
||||
};
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
const checkExecutable = filePath => {
|
||||
if (process.platform === 'win32') return filePath.endsWith('.exe');
|
||||
return _fs.default.promises.access(filePath, _fs.default.constants.X_OK).then(() => true).catch(() => false);
|
||||
};
|
||||
function isSupportedWindowsVersion() {
|
||||
if (os.platform() !== 'win32' || os.arch() !== 'x64') return false;
|
||||
const [major, minor] = os.release().split('.').map(token => parseInt(token, 10));
|
||||
// This is based on: https://stackoverflow.com/questions/42524606/how-to-get-windows-version-using-node-js/44916050#44916050
|
||||
// The table with versions is taken from: https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-osversioninfoexw#remarks
|
||||
// Windows 7 is not supported and is encoded as `6.1`.
|
||||
return major > 6 || major === 6 && minor > 1;
|
||||
}
|
||||
async function installDependenciesWindows(targets, dryRun) {
|
||||
if (targets.has('chromium')) {
|
||||
const command = 'powershell.exe';
|
||||
const args = ['-ExecutionPolicy', 'Bypass', '-File', _path.default.join(BIN_DIRECTORY, 'install_media_pack.ps1')];
|
||||
if (dryRun) {
|
||||
console.log(`${command} ${quoteProcessArgs(args).join(' ')}`); // eslint-disable-line no-console
|
||||
return;
|
||||
}
|
||||
const {
|
||||
code
|
||||
} = await (0, _spawnAsync.spawnAsync)(command, args, {
|
||||
cwd: BIN_DIRECTORY,
|
||||
stdio: 'inherit'
|
||||
});
|
||||
if (code !== 0) throw new Error('Failed to install windows dependencies!');
|
||||
}
|
||||
}
|
||||
async function installDependenciesLinux(targets, dryRun) {
|
||||
const libraries = [];
|
||||
const platform = _hostPlatform.hostPlatform;
|
||||
if (!_hostPlatform.isOfficiallySupportedPlatform) console.warn(`BEWARE: your OS is not officially supported by Playwright; installing dependencies for ${platform} as a fallback.`); // eslint-disable-line no-console
|
||||
for (const target of targets) {
|
||||
const info = _nativeDeps.deps[platform];
|
||||
if (!info) {
|
||||
console.warn(`Cannot install dependencies for ${platform}!`); // eslint-disable-line no-console
|
||||
return;
|
||||
}
|
||||
libraries.push(...info[target]);
|
||||
}
|
||||
const uniqueLibraries = Array.from(new Set(libraries));
|
||||
if (!dryRun) console.log(`Installing dependencies...`); // eslint-disable-line no-console
|
||||
const commands = [];
|
||||
commands.push('apt-get update');
|
||||
commands.push(['apt-get', 'install', '-y', '--no-install-recommends', ...uniqueLibraries].join(' '));
|
||||
const {
|
||||
command,
|
||||
args,
|
||||
elevatedPermissions
|
||||
} = await transformCommandsForRoot(commands);
|
||||
if (dryRun) {
|
||||
console.log(`${command} ${quoteProcessArgs(args).join(' ')}`); // eslint-disable-line no-console
|
||||
return;
|
||||
}
|
||||
if (elevatedPermissions) console.log('Switching to root user to install dependencies...'); // eslint-disable-line no-console
|
||||
const child = _child_process.default.spawn(command, args, {
|
||||
stdio: 'inherit'
|
||||
});
|
||||
await new Promise((resolve, reject) => {
|
||||
child.on('exit', code => code === 0 ? resolve() : reject(new Error(`Installation process exited with code: ${code}`)));
|
||||
child.on('error', reject);
|
||||
});
|
||||
}
|
||||
async function validateDependenciesWindows(windowsExeAndDllDirectories) {
|
||||
const directoryPaths = windowsExeAndDllDirectories;
|
||||
const lddPaths = [];
|
||||
for (const directoryPath of directoryPaths) lddPaths.push(...(await executablesOrSharedLibraries(directoryPath)));
|
||||
const allMissingDeps = await Promise.all(lddPaths.map(lddPath => missingFileDependenciesWindows(lddPath)));
|
||||
const missingDeps = new Set();
|
||||
for (const deps of allMissingDeps) {
|
||||
for (const dep of deps) missingDeps.add(dep);
|
||||
}
|
||||
if (!missingDeps.size) return;
|
||||
let isCrtMissing = false;
|
||||
let isMediaFoundationMissing = false;
|
||||
for (const dep of missingDeps) {
|
||||
if (dep.startsWith('api-ms-win-crt') || dep === 'vcruntime140.dll' || dep === 'vcruntime140_1.dll' || dep === 'msvcp140.dll') isCrtMissing = true;else if (dep === 'mf.dll' || dep === 'mfplat.dll' || dep === 'msmpeg2vdec.dll' || dep === 'evr.dll' || dep === 'avrt.dll') isMediaFoundationMissing = true;
|
||||
}
|
||||
const details = [];
|
||||
if (isCrtMissing) {
|
||||
details.push(`Some of the Universal C Runtime files cannot be found on the system. You can fix`, `that by installing Microsoft Visual C++ Redistributable for Visual Studio from:`, `https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads`, ``);
|
||||
}
|
||||
if (isMediaFoundationMissing) {
|
||||
details.push(`Some of the Media Foundation files cannot be found on the system. If you are`, `on Windows Server try fixing this by running the following command in PowerShell`, `as Administrator:`, ``, ` Install-WindowsFeature Server-Media-Foundation`, ``, `For Windows N editions visit:`, `https://support.microsoft.com/en-us/help/3145500/media-feature-pack-list-for-windows-n-editions`, ``);
|
||||
}
|
||||
details.push(`Full list of missing libraries:`, ` ${[...missingDeps].join('\n ')}`, ``);
|
||||
const message = `Host system is missing dependencies!\n\n${details.join('\n')}`;
|
||||
if (isSupportedWindowsVersion()) {
|
||||
throw new Error(message);
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`WARNING: running on unsupported windows version!`);
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(message);
|
||||
}
|
||||
}
|
||||
async function validateDependenciesLinux(sdkLanguage, linuxLddDirectories, dlOpenLibraries) {
|
||||
var _deps$hostPlatform, _process$getuid, _process;
|
||||
const directoryPaths = linuxLddDirectories;
|
||||
const lddPaths = [];
|
||||
for (const directoryPath of directoryPaths) lddPaths.push(...(await executablesOrSharedLibraries(directoryPath)));
|
||||
const missingDepsPerFile = await Promise.all(lddPaths.map(lddPath => missingFileDependencies(lddPath, directoryPaths)));
|
||||
const missingDeps = new Set();
|
||||
for (const deps of missingDepsPerFile) {
|
||||
for (const dep of deps) missingDeps.add(dep);
|
||||
}
|
||||
for (const dep of await missingDLOPENLibraries(dlOpenLibraries)) missingDeps.add(dep);
|
||||
if (!missingDeps.size) return;
|
||||
const allMissingDeps = new Set(missingDeps);
|
||||
// Check Ubuntu version.
|
||||
const missingPackages = new Set();
|
||||
const libraryToPackageNameMapping = _nativeDeps.deps[_hostPlatform.hostPlatform] ? {
|
||||
...(((_deps$hostPlatform = _nativeDeps.deps[_hostPlatform.hostPlatform]) === null || _deps$hostPlatform === void 0 ? void 0 : _deps$hostPlatform.lib2package) || {}),
|
||||
...MANUAL_LIBRARY_TO_PACKAGE_NAME_UBUNTU
|
||||
} : {};
|
||||
// Translate missing dependencies to package names to install with apt.
|
||||
for (const missingDep of missingDeps) {
|
||||
const packageName = libraryToPackageNameMapping[missingDep];
|
||||
if (packageName) {
|
||||
missingPackages.add(packageName);
|
||||
missingDeps.delete(missingDep);
|
||||
}
|
||||
}
|
||||
const maybeSudo = (_process$getuid = (_process = process).getuid) !== null && _process$getuid !== void 0 && _process$getuid.call(_process) && os.platform() !== 'win32' ? 'sudo ' : '';
|
||||
const dockerInfo = readDockerVersionSync();
|
||||
const errorLines = [`Host system is missing dependencies to run browsers.`];
|
||||
// Ignore patch versions when comparing docker container version and Playwright version:
|
||||
// we **NEVER** roll browsers in patch releases, so native dependencies do not change.
|
||||
if (dockerInfo && !dockerInfo.driverVersion.startsWith((0, _userAgent.getPlaywrightVersion)(true /* majorMinorOnly */) + '.')) {
|
||||
// We are running in a docker container with unmatching version.
|
||||
// In this case, we know how to install dependencies in it.
|
||||
const pwVersion = (0, _userAgent.getPlaywrightVersion)();
|
||||
const requiredDockerImage = dockerInfo.dockerImageName.replace(dockerInfo.driverVersion, pwVersion);
|
||||
errorLines.push(...[`This is most likely due to Docker image version not matching Playwright version:`, `- Playwright : ${pwVersion}`, `- Docker image: ${dockerInfo.driverVersion}`, ``, `Either:`, `- (recommended) use Docker image "${requiredDockerImage}"`, `- (alternative 1) run the following command inside Docker to install missing dependencies:`, ``, ` ${maybeSudo}${(0, _.buildPlaywrightCLICommand)(sdkLanguage, 'install-deps')}`, ``, `- (alternative 2) use apt inside Docker:`, ``, ` ${maybeSudo}apt-get install ${[...missingPackages].join('\\\n ')}`, ``, `<3 Playwright Team`]);
|
||||
} else if (missingPackages.size && !missingDeps.size) {
|
||||
// Only known dependencies are missing for browsers.
|
||||
// Suggest installation with a Playwright CLI.
|
||||
errorLines.push(...[`Please install them with the following command:`, ``, ` ${maybeSudo}${(0, _.buildPlaywrightCLICommand)(sdkLanguage, 'install-deps')}`, ``, `Alternatively, use apt:`, ` ${maybeSudo}apt-get install ${[...missingPackages].join('\\\n ')}`, ``, `<3 Playwright Team`]);
|
||||
} else {
|
||||
// Unhappy path: we either run on unknown distribution, or we failed to resolve all missing
|
||||
// libraries to package names.
|
||||
// Print missing libraries only:
|
||||
errorLines.push(...[`Missing libraries:`, ...[...allMissingDeps].map(dep => ' ' + dep)]);
|
||||
}
|
||||
throw new Error('\n' + utils.wrapInASCIIBox(errorLines.join('\n'), 1));
|
||||
}
|
||||
function isSharedLib(basename) {
|
||||
switch (os.platform()) {
|
||||
case 'linux':
|
||||
return basename.endsWith('.so') || basename.includes('.so.');
|
||||
case 'win32':
|
||||
return basename.endsWith('.dll');
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
async function executablesOrSharedLibraries(directoryPath) {
|
||||
if (!_fs.default.existsSync(directoryPath)) return [];
|
||||
const allPaths = (await _fs.default.promises.readdir(directoryPath)).map(file => _path.default.resolve(directoryPath, file));
|
||||
const allStats = await Promise.all(allPaths.map(aPath => _fs.default.promises.stat(aPath)));
|
||||
const filePaths = allPaths.filter((aPath, index) => allStats[index].isFile());
|
||||
const executablersOrLibraries = (await Promise.all(filePaths.map(async filePath => {
|
||||
const basename = _path.default.basename(filePath).toLowerCase();
|
||||
if (isSharedLib(basename)) return filePath;
|
||||
if (await checkExecutable(filePath)) return filePath;
|
||||
return false;
|
||||
}))).filter(Boolean);
|
||||
return executablersOrLibraries;
|
||||
}
|
||||
async function missingFileDependenciesWindows(filePath) {
|
||||
const executable = _path.default.join(__dirname, '..', '..', '..', 'bin', 'PrintDeps.exe');
|
||||
const dirname = _path.default.dirname(filePath);
|
||||
const {
|
||||
stdout,
|
||||
code
|
||||
} = await (0, _spawnAsync.spawnAsync)(executable, [filePath], {
|
||||
cwd: dirname,
|
||||
env: {
|
||||
...process.env,
|
||||
LD_LIBRARY_PATH: process.env.LD_LIBRARY_PATH ? `${process.env.LD_LIBRARY_PATH}:${dirname}` : dirname
|
||||
}
|
||||
});
|
||||
if (code !== 0) return [];
|
||||
const missingDeps = stdout.split('\n').map(line => line.trim()).filter(line => line.endsWith('not found') && line.includes('=>')).map(line => line.split('=>')[0].trim().toLowerCase());
|
||||
return missingDeps;
|
||||
}
|
||||
async function missingFileDependencies(filePath, extraLDPaths) {
|
||||
const dirname = _path.default.dirname(filePath);
|
||||
let LD_LIBRARY_PATH = extraLDPaths.join(':');
|
||||
if (process.env.LD_LIBRARY_PATH) LD_LIBRARY_PATH = `${process.env.LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}`;
|
||||
const {
|
||||
stdout,
|
||||
code
|
||||
} = await (0, _spawnAsync.spawnAsync)('ldd', [filePath], {
|
||||
cwd: dirname,
|
||||
env: {
|
||||
...process.env,
|
||||
LD_LIBRARY_PATH
|
||||
}
|
||||
});
|
||||
if (code !== 0) return [];
|
||||
const missingDeps = stdout.split('\n').map(line => line.trim()).filter(line => line.endsWith('not found') && line.includes('=>')).map(line => line.split('=>')[0].trim());
|
||||
return missingDeps;
|
||||
}
|
||||
async function missingDLOPENLibraries(libraries) {
|
||||
if (!libraries.length) return [];
|
||||
// NOTE: Using full-qualified path to `ldconfig` since `/sbin` is not part of the
|
||||
// default PATH in CRON.
|
||||
// @see https://github.com/microsoft/playwright/issues/3397
|
||||
const {
|
||||
stdout,
|
||||
code,
|
||||
error
|
||||
} = await (0, _spawnAsync.spawnAsync)('/sbin/ldconfig', ['-p'], {});
|
||||
if (code !== 0 || error) return [];
|
||||
const isLibraryAvailable = library => stdout.toLowerCase().includes(library.toLowerCase());
|
||||
return libraries.filter(library => !isLibraryAvailable(library));
|
||||
}
|
||||
const MANUAL_LIBRARY_TO_PACKAGE_NAME_UBUNTU = {
|
||||
// libgstlibav.so (the only actual library provided by gstreamer1.0-libav) is not
|
||||
// in the ldconfig cache, so we detect the actual library required for playing h.264
|
||||
// and if it's missing recommend installing missing gstreamer lib.
|
||||
// gstreamer1.0-libav -> libavcodec57 -> libx264-152
|
||||
'libx264.so': 'gstreamer1.0-libav'
|
||||
};
|
||||
function quoteProcessArgs(args) {
|
||||
return args.map(arg => {
|
||||
if (arg.includes(' ')) return `"${arg}"`;
|
||||
return arg;
|
||||
});
|
||||
}
|
||||
async function transformCommandsForRoot(commands) {
|
||||
var _process$getuid2, _process2;
|
||||
const isRoot = ((_process$getuid2 = (_process2 = process).getuid) === null || _process$getuid2 === void 0 ? void 0 : _process$getuid2.call(_process2)) === 0;
|
||||
if (isRoot) return {
|
||||
command: 'sh',
|
||||
args: ['-c', `${commands.join('&& ')}`],
|
||||
elevatedPermissions: false
|
||||
};
|
||||
const sudoExists = await (0, _spawnAsync.spawnAsync)('which', ['sudo']);
|
||||
if (sudoExists.code === 0) return {
|
||||
command: 'sudo',
|
||||
args: ['--', 'sh', '-c', `${commands.join('&& ')}`],
|
||||
elevatedPermissions: true
|
||||
};
|
||||
return {
|
||||
command: 'su',
|
||||
args: ['root', '-c', `${commands.join('&& ')}`],
|
||||
elevatedPermissions: true
|
||||
};
|
||||
}
|
||||
1052
node_modules/playwright-core/lib/server/registry/index.js
generated
vendored
Normal file
1052
node_modules/playwright-core/lib/server/registry/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
493
node_modules/playwright-core/lib/server/registry/nativeDeps.js
generated
vendored
Normal file
493
node_modules/playwright-core/lib/server/registry/nativeDeps.js
generated
vendored
Normal file
@@ -0,0 +1,493 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.deps = void 0;
|
||||
/**
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the 'License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// - This file is used to execute 'npx playwright install-deps'
|
||||
// - The reverse mappings "lib2package" are generated with the following script:
|
||||
// ./utils/linux-browser-dependencies/run.sh ubuntu:20.04
|
||||
|
||||
const deps = exports.deps = {
|
||||
'ubuntu20.04-x64': {
|
||||
tools: ['xvfb', 'fonts-noto-color-emoji', 'ttf-unifont', 'libfontconfig', 'libfreetype6', 'xfonts-cyrillic', 'xfonts-scalable', 'fonts-liberation', 'fonts-ipafont-gothic', 'fonts-wqy-zenhei', 'fonts-tlwg-loma-otf', 'ttf-ubuntu-font-family'],
|
||||
chromium: ['fonts-liberation', 'libasound2', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libatspi2.0-0', 'libcairo2', 'libcups2', 'libdbus-1-3', 'libdrm2', 'libegl1', 'libgbm1', 'libglib2.0-0', 'libgtk-3-0', 'libnspr4', 'libnss3', 'libpango-1.0-0', 'libx11-6', 'libx11-xcb1', 'libxcb1', 'libxcomposite1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxrandr2', 'libxshmfence1'],
|
||||
firefox: ['ffmpeg', 'libatk1.0-0', 'libcairo-gobject2', 'libcairo2', 'libdbus-1-3', 'libdbus-glib-1-2', 'libfontconfig1', 'libfreetype6', 'libgdk-pixbuf2.0-0', 'libglib2.0-0', 'libgtk-3-0', 'libpango-1.0-0', 'libpangocairo-1.0-0', 'libpangoft2-1.0-0', 'libx11-6', 'libx11-xcb1', 'libxcb-shm0', 'libxcb1', 'libxcomposite1', 'libxcursor1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxi6', 'libxrender1', 'libxt6', 'libxtst6'],
|
||||
webkit: ['libenchant-2-2', 'libflite1', 'libx264-155', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libcairo2', 'libegl1', 'libenchant1c2a', 'libepoxy0', 'libevdev2', 'libfontconfig1', 'libfreetype6', 'libgdk-pixbuf2.0-0', 'libgl1', 'libgles2', 'libglib2.0-0', 'libgtk-3-0', 'libgudev-1.0-0', 'libharfbuzz-icu0', 'libharfbuzz0b', 'libhyphen0', 'libicu66', 'libjpeg-turbo8', 'libnghttp2-14', 'libnotify4', 'libopengl0', 'libopenjp2-7', 'libopus0', 'libpango-1.0-0', 'libpng16-16', 'libsecret-1-0', 'libvpx6', 'libwayland-client0', 'libwayland-egl1', 'libwayland-server0', 'libwebp6', 'libwebpdemux2', 'libwoff1', 'libx11-6', 'libxcomposite1', 'libxdamage1', 'libxkbcommon0', 'libxml2', 'libxslt1.1', 'libatomic1', 'libevent-2.1-7'],
|
||||
lib2package: {
|
||||
'libflite.so.1': 'libflite1',
|
||||
'libflite_usenglish.so.1': 'libflite1',
|
||||
'libflite_cmu_grapheme_lang.so.1': 'libflite1',
|
||||
'libflite_cmu_grapheme_lex.so.1': 'libflite1',
|
||||
'libflite_cmu_indic_lang.so.1': 'libflite1',
|
||||
'libflite_cmu_indic_lex.so.1': 'libflite1',
|
||||
'libflite_cmulex.so.1': 'libflite1',
|
||||
'libflite_cmu_time_awb.so.1': 'libflite1',
|
||||
'libflite_cmu_us_awb.so.1': 'libflite1',
|
||||
'libflite_cmu_us_kal16.so.1': 'libflite1',
|
||||
'libflite_cmu_us_kal.so.1': 'libflite1',
|
||||
'libflite_cmu_us_rms.so.1': 'libflite1',
|
||||
'libflite_cmu_us_slt.so.1': 'libflite1',
|
||||
'libx264.so': 'libx264-155',
|
||||
'libasound.so.2': 'libasound2',
|
||||
'libatk-1.0.so.0': 'libatk1.0-0',
|
||||
'libatk-bridge-2.0.so.0': 'libatk-bridge2.0-0',
|
||||
'libatspi.so.0': 'libatspi2.0-0',
|
||||
'libcairo-gobject.so.2': 'libcairo-gobject2',
|
||||
'libcairo.so.2': 'libcairo2',
|
||||
'libcups.so.2': 'libcups2',
|
||||
'libdbus-1.so.3': 'libdbus-1-3',
|
||||
'libdbus-glib-1.so.2': 'libdbus-glib-1-2',
|
||||
'libdrm.so.2': 'libdrm2',
|
||||
'libEGL.so.1': 'libegl1',
|
||||
'libenchant.so.1': 'libenchant1c2a',
|
||||
'libevdev.so.2': 'libevdev2',
|
||||
'libepoxy.so.0': 'libepoxy0',
|
||||
'libfontconfig.so.1': 'libfontconfig1',
|
||||
'libfreetype.so.6': 'libfreetype6',
|
||||
'libgbm.so.1': 'libgbm1',
|
||||
'libgdk_pixbuf-2.0.so.0': 'libgdk-pixbuf2.0-0',
|
||||
'libgdk-3.so.0': 'libgtk-3-0',
|
||||
'libgdk-x11-2.0.so.0': 'libgtk2.0-0',
|
||||
'libgio-2.0.so.0': 'libglib2.0-0',
|
||||
'libGL.so.1': 'libgl1',
|
||||
'libGLESv2.so.2': 'libgles2',
|
||||
'libglib-2.0.so.0': 'libglib2.0-0',
|
||||
'libgmodule-2.0.so.0': 'libglib2.0-0',
|
||||
'libgobject-2.0.so.0': 'libglib2.0-0',
|
||||
'libgthread-2.0.so.0': 'libglib2.0-0',
|
||||
'libgtk-3.so.0': 'libgtk-3-0',
|
||||
'libgtk-x11-2.0.so.0': 'libgtk2.0-0',
|
||||
'libgudev-1.0.so.0': 'libgudev-1.0-0',
|
||||
'libharfbuzz-icu.so.0': 'libharfbuzz-icu0',
|
||||
'libharfbuzz.so.0': 'libharfbuzz0b',
|
||||
'libhyphen.so.0': 'libhyphen0',
|
||||
'libicui18n.so.66': 'libicu66',
|
||||
'libicuuc.so.66': 'libicu66',
|
||||
'libjpeg.so.8': 'libjpeg-turbo8',
|
||||
'libnotify.so.4': 'libnotify4',
|
||||
'libnspr4.so': 'libnspr4',
|
||||
'libnss3.so': 'libnss3',
|
||||
'libnssutil3.so': 'libnss3',
|
||||
'libOpenGL.so.0': 'libopengl0',
|
||||
'libopenjp2.so.7': 'libopenjp2-7',
|
||||
'libopus.so.0': 'libopus0',
|
||||
'libpango-1.0.so.0': 'libpango-1.0-0',
|
||||
'libpangocairo-1.0.so.0': 'libpangocairo-1.0-0',
|
||||
'libpangoft2-1.0.so.0': 'libpangoft2-1.0-0',
|
||||
'libpng16.so.16': 'libpng16-16',
|
||||
'libsecret-1.so.0': 'libsecret-1-0',
|
||||
'libsmime3.so': 'libnss3',
|
||||
'libvpx.so.6': 'libvpx6',
|
||||
'libwayland-client.so.0': 'libwayland-client0',
|
||||
'libwayland-egl.so.1': 'libwayland-egl1',
|
||||
'libwayland-server.so.0': 'libwayland-server0',
|
||||
'libwebp.so.6': 'libwebp6',
|
||||
'libwebpdemux.so.2': 'libwebpdemux2',
|
||||
'libwoff2dec.so.1.0.2': 'libwoff1',
|
||||
'libX11-xcb.so.1': 'libx11-xcb1',
|
||||
'libX11.so.6': 'libx11-6',
|
||||
'libxcb-dri3.so.0': 'libxcb-dri3-0',
|
||||
'libxcb-shm.so.0': 'libxcb-shm0',
|
||||
'libxcb.so.1': 'libxcb1',
|
||||
'libXcomposite.so.1': 'libxcomposite1',
|
||||
'libXcursor.so.1': 'libxcursor1',
|
||||
'libXdamage.so.1': 'libxdamage1',
|
||||
'libXext.so.6': 'libxext6',
|
||||
'libXfixes.so.3': 'libxfixes3',
|
||||
'libXi.so.6': 'libxi6',
|
||||
'libxkbcommon.so.0': 'libxkbcommon0',
|
||||
'libxml2.so.2': 'libxml2',
|
||||
'libXrandr.so.2': 'libxrandr2',
|
||||
'libXrender.so.1': 'libxrender1',
|
||||
'libxslt.so.1': 'libxslt1.1',
|
||||
'libXt.so.6': 'libxt6',
|
||||
'libXtst.so.6': 'libxtst6',
|
||||
'libxshmfence.so.1': 'libxshmfence1',
|
||||
'libatomic.so.1': 'libatomic1',
|
||||
'libenchant-2.so.2': 'libenchant-2-2',
|
||||
'libevent-2.1.so.7': 'libevent-2.1-7'
|
||||
}
|
||||
},
|
||||
'ubuntu22.04-x64': {
|
||||
tools: ['xvfb', 'fonts-noto-color-emoji', 'fonts-unifont', 'libfontconfig1', 'libfreetype6', 'xfonts-cyrillic', 'xfonts-scalable', 'fonts-liberation', 'fonts-ipafont-gothic', 'fonts-wqy-zenhei', 'fonts-tlwg-loma-otf', 'fonts-freefont-ttf'],
|
||||
chromium: ['libasound2', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libatspi2.0-0', 'libcairo2', 'libcups2', 'libdbus-1-3', 'libdrm2', 'libgbm1', 'libglib2.0-0', 'libnspr4', 'libnss3', 'libpango-1.0-0', 'libwayland-client0', 'libx11-6', 'libxcb1', 'libxcomposite1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxkbcommon0', 'libxrandr2'],
|
||||
firefox: ['ffmpeg', 'libasound2', 'libatk1.0-0', 'libcairo-gobject2', 'libcairo2', 'libdbus-1-3', 'libdbus-glib-1-2', 'libfontconfig1', 'libfreetype6', 'libgdk-pixbuf-2.0-0', 'libglib2.0-0', 'libgtk-3-0', 'libpango-1.0-0', 'libpangocairo-1.0-0', 'libx11-6', 'libx11-xcb1', 'libxcb-shm0', 'libxcb1', 'libxcomposite1', 'libxcursor1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxi6', 'libxrandr2', 'libxrender1', 'libxtst6'],
|
||||
webkit: ['libsoup-3.0-0', 'libenchant-2-2', 'gstreamer1.0-libav', 'gstreamer1.0-plugins-bad', 'gstreamer1.0-plugins-base', 'gstreamer1.0-plugins-good', 'libicu70', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libcairo2', 'libdbus-1-3', 'libdrm2', 'libegl1', 'libepoxy0', 'libevdev2', 'libffi7', 'libfontconfig1', 'libfreetype6', 'libgbm1', 'libgdk-pixbuf-2.0-0', 'libgles2', 'libglib2.0-0', 'libglx0', 'libgstreamer-gl1.0-0', 'libgstreamer-plugins-base1.0-0', 'libgstreamer1.0-0', 'libgtk-3-0', 'libgudev-1.0-0', 'libharfbuzz-icu0', 'libharfbuzz0b', 'libhyphen0', 'libjpeg-turbo8', 'liblcms2-2', 'libmanette-0.2-0', 'libnotify4', 'libopengl0', 'libopenjp2-7', 'libopus0', 'libpango-1.0-0', 'libpng16-16', 'libproxy1v5', 'libsecret-1-0', 'libwayland-client0', 'libwayland-egl1', 'libwayland-server0', 'libwebpdemux2', 'libwoff1', 'libx11-6', 'libxcomposite1', 'libxdamage1', 'libxkbcommon0', 'libxml2', 'libxslt1.1', 'libx264-163', 'libatomic1', 'libevent-2.1-7', 'libavif13'],
|
||||
lib2package: {
|
||||
'libavif.so.13': 'libavif13',
|
||||
'libsoup-3.0.so.0': 'libsoup-3.0-0',
|
||||
'libasound.so.2': 'libasound2',
|
||||
'libatk-1.0.so.0': 'libatk1.0-0',
|
||||
'libatk-bridge-2.0.so.0': 'libatk-bridge2.0-0',
|
||||
'libatspi.so.0': 'libatspi2.0-0',
|
||||
'libcairo-gobject.so.2': 'libcairo-gobject2',
|
||||
'libcairo.so.2': 'libcairo2',
|
||||
'libcups.so.2': 'libcups2',
|
||||
'libdbus-1.so.3': 'libdbus-1-3',
|
||||
'libdbus-glib-1.so.2': 'libdbus-glib-1-2',
|
||||
'libdrm.so.2': 'libdrm2',
|
||||
'libEGL.so.1': 'libegl1',
|
||||
'libepoxy.so.0': 'libepoxy0',
|
||||
'libevdev.so.2': 'libevdev2',
|
||||
'libffi.so.7': 'libffi7',
|
||||
'libfontconfig.so.1': 'libfontconfig1',
|
||||
'libfreetype.so.6': 'libfreetype6',
|
||||
'libgbm.so.1': 'libgbm1',
|
||||
'libgdk_pixbuf-2.0.so.0': 'libgdk-pixbuf-2.0-0',
|
||||
'libgdk-3.so.0': 'libgtk-3-0',
|
||||
'libgio-2.0.so.0': 'libglib2.0-0',
|
||||
'libGLESv2.so.2': 'libgles2',
|
||||
'libglib-2.0.so.0': 'libglib2.0-0',
|
||||
'libGLX.so.0': 'libglx0',
|
||||
'libgmodule-2.0.so.0': 'libglib2.0-0',
|
||||
'libgobject-2.0.so.0': 'libglib2.0-0',
|
||||
'libgstallocators-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstapp-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstaudio-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstbase-1.0.so.0': 'libgstreamer1.0-0',
|
||||
'libgstfft-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstgl-1.0.so.0': 'libgstreamer-gl1.0-0',
|
||||
'libgstpbutils-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstreamer-1.0.so.0': 'libgstreamer1.0-0',
|
||||
'libgsttag-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstvideo-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgtk-3.so.0': 'libgtk-3-0',
|
||||
'libgudev-1.0.so.0': 'libgudev-1.0-0',
|
||||
'libharfbuzz-icu.so.0': 'libharfbuzz-icu0',
|
||||
'libharfbuzz.so.0': 'libharfbuzz0b',
|
||||
'libhyphen.so.0': 'libhyphen0',
|
||||
'libjpeg.so.8': 'libjpeg-turbo8',
|
||||
'liblcms2.so.2': 'liblcms2-2',
|
||||
'libmanette-0.2.so.0': 'libmanette-0.2-0',
|
||||
'libnotify.so.4': 'libnotify4',
|
||||
'libnspr4.so': 'libnspr4',
|
||||
'libnss3.so': 'libnss3',
|
||||
'libnssutil3.so': 'libnss3',
|
||||
'libOpenGL.so.0': 'libopengl0',
|
||||
'libopenjp2.so.7': 'libopenjp2-7',
|
||||
'libopus.so.0': 'libopus0',
|
||||
'libpango-1.0.so.0': 'libpango-1.0-0',
|
||||
'libpangocairo-1.0.so.0': 'libpangocairo-1.0-0',
|
||||
'libpng16.so.16': 'libpng16-16',
|
||||
'libproxy.so.1': 'libproxy1v5',
|
||||
'libsecret-1.so.0': 'libsecret-1-0',
|
||||
'libsmime3.so': 'libnss3',
|
||||
'libwayland-client.so.0': 'libwayland-client0',
|
||||
'libwayland-egl.so.1': 'libwayland-egl1',
|
||||
'libwayland-server.so.0': 'libwayland-server0',
|
||||
'libwebpdemux.so.2': 'libwebpdemux2',
|
||||
'libwoff2dec.so.1.0.2': 'libwoff1',
|
||||
'libX11-xcb.so.1': 'libx11-xcb1',
|
||||
'libX11.so.6': 'libx11-6',
|
||||
'libxcb-shm.so.0': 'libxcb-shm0',
|
||||
'libxcb.so.1': 'libxcb1',
|
||||
'libXcomposite.so.1': 'libxcomposite1',
|
||||
'libXcursor.so.1': 'libxcursor1',
|
||||
'libXdamage.so.1': 'libxdamage1',
|
||||
'libXext.so.6': 'libxext6',
|
||||
'libXfixes.so.3': 'libxfixes3',
|
||||
'libXi.so.6': 'libxi6',
|
||||
'libxkbcommon.so.0': 'libxkbcommon0',
|
||||
'libxml2.so.2': 'libxml2',
|
||||
'libXrandr.so.2': 'libxrandr2',
|
||||
'libXrender.so.1': 'libxrender1',
|
||||
'libxslt.so.1': 'libxslt1.1',
|
||||
'libXtst.so.6': 'libxtst6',
|
||||
'libicui18n.so.60': 'libicu70',
|
||||
'libicuuc.so.66': 'libicu70',
|
||||
'libicui18n.so.66': 'libicu70',
|
||||
'libwebp.so.6': 'libwebp6',
|
||||
'libenchant-2.so.2': 'libenchant-2-2',
|
||||
'libx264.so': 'libx264-163',
|
||||
'libvpx.so.7': 'libvpx7',
|
||||
'libatomic.so.1': 'libatomic1',
|
||||
'libevent-2.1.so.7': 'libevent-2.1-7'
|
||||
}
|
||||
},
|
||||
'ubuntu24.04-x64': {
|
||||
tools: ['xvfb', 'fonts-noto-color-emoji', 'fonts-unifont', 'libfontconfig1', 'libfreetype6', 'xfonts-cyrillic', 'xfonts-scalable', 'fonts-liberation', 'fonts-ipafont-gothic', 'fonts-wqy-zenhei', 'fonts-tlwg-loma-otf', 'fonts-freefont-ttf'],
|
||||
chromium: ['libasound2t64', 'libatk-bridge2.0-0t64', 'libatk1.0-0t64', 'libatspi2.0-0t64', 'libcairo2', 'libcups2t64', 'libdbus-1-3', 'libdrm2', 'libgbm1', 'libglib2.0-0t64', 'libnspr4', 'libnss3', 'libpango-1.0-0', 'libx11-6', 'libxcb1', 'libxcomposite1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxkbcommon0', 'libxrandr2'],
|
||||
firefox: ['libasound2t64', 'libatk1.0-0t64', 'libcairo-gobject2', 'libcairo2', 'libdbus-1-3', 'libfontconfig1', 'libfreetype6', 'libgdk-pixbuf-2.0-0', 'libglib2.0-0t64', 'libgtk-3-0t64', 'libpango-1.0-0', 'libpangocairo-1.0-0', 'libx11-6', 'libx11-xcb1', 'libxcb-shm0', 'libxcb1', 'libxcomposite1', 'libxcursor1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxi6', 'libxrandr2', 'libxrender1'],
|
||||
webkit: ['gstreamer1.0-libav', 'gstreamer1.0-plugins-bad', 'gstreamer1.0-plugins-base', 'gstreamer1.0-plugins-good', 'libicu74', 'libatomic1', 'libatk-bridge2.0-0t64', 'libatk1.0-0t64', 'libcairo-gobject2', 'libcairo2', 'libdbus-1-3', 'libdrm2', 'libenchant-2-2', 'libepoxy0', 'libevent-2.1-7t64', 'libflite1', 'libfontconfig1', 'libfreetype6', 'libgbm1', 'libgdk-pixbuf-2.0-0', 'libgles2', 'libglib2.0-0t64', 'libgstreamer-gl1.0-0', 'libgstreamer-plugins-bad1.0-0', 'libgstreamer-plugins-base1.0-0', 'libgstreamer1.0-0', 'libgtk-3-0t64', 'libharfbuzz-icu0', 'libharfbuzz0b', 'libhyphen0', 'libicu74', 'libjpeg-turbo8', 'liblcms2-2', 'libmanette-0.2-0', 'libopus0', 'libpango-1.0-0', 'libpangocairo-1.0-0', 'libpng16-16t64', 'libsecret-1-0', 'libvpx9', 'libwayland-client0', 'libwayland-egl1', 'libwayland-server0', 'libwebp7', 'libwebpdemux2', 'libwoff1', 'libx11-6', 'libxkbcommon0', 'libxml2', 'libxslt1.1', 'libx264-164', 'libavif16'],
|
||||
lib2package: {
|
||||
'libavif.so.16': 'libavif16',
|
||||
'libasound.so.2': 'libasound2t64',
|
||||
'libatk-1.0.so.0': 'libatk1.0-0t64',
|
||||
'libatk-bridge-2.0.so.0': 'libatk-bridge2.0-0t64',
|
||||
'libatomic.so.1': 'libatomic1',
|
||||
'libatspi.so.0': 'libatspi2.0-0t64',
|
||||
'libcairo-gobject.so.2': 'libcairo-gobject2',
|
||||
'libcairo.so.2': 'libcairo2',
|
||||
'libcups.so.2': 'libcups2t64',
|
||||
'libdbus-1.so.3': 'libdbus-1-3',
|
||||
'libdrm.so.2': 'libdrm2',
|
||||
'libenchant-2.so.2': 'libenchant-2-2',
|
||||
'libepoxy.so.0': 'libepoxy0',
|
||||
'libevent-2.1.so.7': 'libevent-2.1-7t64',
|
||||
'libflite_cmu_grapheme_lang.so.1': 'libflite1',
|
||||
'libflite_cmu_grapheme_lex.so.1': 'libflite1',
|
||||
'libflite_cmu_indic_lang.so.1': 'libflite1',
|
||||
'libflite_cmu_indic_lex.so.1': 'libflite1',
|
||||
'libflite_cmu_time_awb.so.1': 'libflite1',
|
||||
'libflite_cmu_us_awb.so.1': 'libflite1',
|
||||
'libflite_cmu_us_kal.so.1': 'libflite1',
|
||||
'libflite_cmu_us_kal16.so.1': 'libflite1',
|
||||
'libflite_cmu_us_rms.so.1': 'libflite1',
|
||||
'libflite_cmu_us_slt.so.1': 'libflite1',
|
||||
'libflite_cmulex.so.1': 'libflite1',
|
||||
'libflite_usenglish.so.1': 'libflite1',
|
||||
'libflite.so.1': 'libflite1',
|
||||
'libfontconfig.so.1': 'libfontconfig1',
|
||||
'libfreetype.so.6': 'libfreetype6',
|
||||
'libgbm.so.1': 'libgbm1',
|
||||
'libgdk_pixbuf-2.0.so.0': 'libgdk-pixbuf-2.0-0',
|
||||
'libgdk-3.so.0': 'libgtk-3-0t64',
|
||||
'libgio-2.0.so.0': 'libglib2.0-0t64',
|
||||
'libGLESv2.so.2': 'libgles2',
|
||||
'libglib-2.0.so.0': 'libglib2.0-0t64',
|
||||
'libgmodule-2.0.so.0': 'libglib2.0-0t64',
|
||||
'libgobject-2.0.so.0': 'libglib2.0-0t64',
|
||||
'libgstallocators-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstapp-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstaudio-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstbase-1.0.so.0': 'libgstreamer1.0-0',
|
||||
'libgstcodecparsers-1.0.so.0': 'libgstreamer-plugins-bad1.0-0',
|
||||
'libgstfft-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstgl-1.0.so.0': 'libgstreamer-gl1.0-0',
|
||||
'libgstpbutils-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstreamer-1.0.so.0': 'libgstreamer1.0-0',
|
||||
'libgsttag-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstvideo-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgtk-3.so.0': 'libgtk-3-0t64',
|
||||
'libharfbuzz-icu.so.0': 'libharfbuzz-icu0',
|
||||
'libharfbuzz.so.0': 'libharfbuzz0b',
|
||||
'libhyphen.so.0': 'libhyphen0',
|
||||
'libicudata.so.74': 'libicu74',
|
||||
'libicui18n.so.74': 'libicu74',
|
||||
'libicuuc.so.74': 'libicu74',
|
||||
'libjpeg.so.8': 'libjpeg-turbo8',
|
||||
'liblcms2.so.2': 'liblcms2-2',
|
||||
'libmanette-0.2.so.0': 'libmanette-0.2-0',
|
||||
'libnspr4.so': 'libnspr4',
|
||||
'libnss3.so': 'libnss3',
|
||||
'libnssutil3.so': 'libnss3',
|
||||
'libopus.so.0': 'libopus0',
|
||||
'libpango-1.0.so.0': 'libpango-1.0-0',
|
||||
'libpangocairo-1.0.so.0': 'libpangocairo-1.0-0',
|
||||
'libpng16.so.16': 'libpng16-16t64',
|
||||
'libsecret-1.so.0': 'libsecret-1-0',
|
||||
'libsmime3.so': 'libnss3',
|
||||
'libsoup-3.0.so.0': 'libsoup-3.0-0',
|
||||
'libvpx.so.9': 'libvpx9',
|
||||
'libwayland-client.so.0': 'libwayland-client0',
|
||||
'libwayland-egl.so.1': 'libwayland-egl1',
|
||||
'libwayland-server.so.0': 'libwayland-server0',
|
||||
'libwebp.so.7': 'libwebp7',
|
||||
'libwebpdemux.so.2': 'libwebpdemux2',
|
||||
'libwoff2dec.so.1.0.2': 'libwoff1',
|
||||
'libX11-xcb.so.1': 'libx11-xcb1',
|
||||
'libX11.so.6': 'libx11-6',
|
||||
'libxcb-shm.so.0': 'libxcb-shm0',
|
||||
'libxcb.so.1': 'libxcb1',
|
||||
'libXcomposite.so.1': 'libxcomposite1',
|
||||
'libXcursor.so.1': 'libxcursor1',
|
||||
'libXdamage.so.1': 'libxdamage1',
|
||||
'libXext.so.6': 'libxext6',
|
||||
'libXfixes.so.3': 'libxfixes3',
|
||||
'libXi.so.6': 'libxi6',
|
||||
'libxkbcommon.so.0': 'libxkbcommon0',
|
||||
'libxml2.so.2': 'libxml2',
|
||||
'libXrandr.so.2': 'libxrandr2',
|
||||
'libXrender.so.1': 'libxrender1',
|
||||
'libxslt.so.1': 'libxslt1.1',
|
||||
'libx264.so': 'libx264-164'
|
||||
}
|
||||
},
|
||||
'debian11-x64': {
|
||||
tools: ['xvfb', 'fonts-noto-color-emoji', 'fonts-unifont', 'libfontconfig1', 'libfreetype6', 'xfonts-cyrillic', 'xfonts-scalable', 'fonts-liberation', 'fonts-ipafont-gothic', 'fonts-wqy-zenhei', 'fonts-tlwg-loma-otf', 'fonts-freefont-ttf'],
|
||||
chromium: ['libasound2', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libatspi2.0-0', 'libcairo2', 'libcups2', 'libdbus-1-3', 'libdrm2', 'libgbm1', 'libglib2.0-0', 'libnspr4', 'libnss3', 'libpango-1.0-0', 'libwayland-client0', 'libx11-6', 'libxcb1', 'libxcomposite1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxkbcommon0', 'libxrandr2'],
|
||||
firefox: ['libasound2', 'libatk1.0-0', 'libcairo-gobject2', 'libcairo2', 'libdbus-1-3', 'libdbus-glib-1-2', 'libfontconfig1', 'libfreetype6', 'libgdk-pixbuf-2.0-0', 'libglib2.0-0', 'libgtk-3-0', 'libharfbuzz0b', 'libpango-1.0-0', 'libpangocairo-1.0-0', 'libx11-6', 'libx11-xcb1', 'libxcb-shm0', 'libxcb1', 'libxcomposite1', 'libxcursor1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxi6', 'libxrandr2', 'libxrender1', 'libxtst6'],
|
||||
webkit: ['gstreamer1.0-libav', 'gstreamer1.0-plugins-bad', 'gstreamer1.0-plugins-base', 'gstreamer1.0-plugins-good', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libcairo2', 'libdbus-1-3', 'libdrm2', 'libegl1', 'libenchant-2-2', 'libepoxy0', 'libevdev2', 'libfontconfig1', 'libfreetype6', 'libgbm1', 'libgdk-pixbuf-2.0-0', 'libgles2', 'libglib2.0-0', 'libglx0', 'libgstreamer-gl1.0-0', 'libgstreamer-plugins-base1.0-0', 'libgstreamer1.0-0', 'libgtk-3-0', 'libgudev-1.0-0', 'libharfbuzz-icu0', 'libharfbuzz0b', 'libhyphen0', 'libicu67', 'libjpeg62-turbo', 'liblcms2-2', 'libmanette-0.2-0', 'libnghttp2-14', 'libnotify4', 'libopengl0', 'libopenjp2-7', 'libopus0', 'libpango-1.0-0', 'libpng16-16', 'libproxy1v5', 'libsecret-1-0', 'libwayland-client0', 'libwayland-egl1', 'libwayland-server0', 'libwebp6', 'libwebpdemux2', 'libwoff1', 'libx11-6', 'libxcomposite1', 'libxdamage1', 'libxkbcommon0', 'libxml2', 'libxslt1.1', 'libatomic1', 'libevent-2.1-7'],
|
||||
lib2package: {
|
||||
'libasound.so.2': 'libasound2',
|
||||
'libatk-1.0.so.0': 'libatk1.0-0',
|
||||
'libatk-bridge-2.0.so.0': 'libatk-bridge2.0-0',
|
||||
'libatspi.so.0': 'libatspi2.0-0',
|
||||
'libcairo-gobject.so.2': 'libcairo-gobject2',
|
||||
'libcairo.so.2': 'libcairo2',
|
||||
'libcups.so.2': 'libcups2',
|
||||
'libdbus-1.so.3': 'libdbus-1-3',
|
||||
'libdbus-glib-1.so.2': 'libdbus-glib-1-2',
|
||||
'libdrm.so.2': 'libdrm2',
|
||||
'libEGL.so.1': 'libegl1',
|
||||
'libenchant-2.so.2': 'libenchant-2-2',
|
||||
'libepoxy.so.0': 'libepoxy0',
|
||||
'libevdev.so.2': 'libevdev2',
|
||||
'libfontconfig.so.1': 'libfontconfig1',
|
||||
'libfreetype.so.6': 'libfreetype6',
|
||||
'libgbm.so.1': 'libgbm1',
|
||||
'libgdk_pixbuf-2.0.so.0': 'libgdk-pixbuf-2.0-0',
|
||||
'libgdk-3.so.0': 'libgtk-3-0',
|
||||
'libgio-2.0.so.0': 'libglib2.0-0',
|
||||
'libGLESv2.so.2': 'libgles2',
|
||||
'libglib-2.0.so.0': 'libglib2.0-0',
|
||||
'libGLX.so.0': 'libglx0',
|
||||
'libgmodule-2.0.so.0': 'libglib2.0-0',
|
||||
'libgobject-2.0.so.0': 'libglib2.0-0',
|
||||
'libgstallocators-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstapp-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstaudio-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstbase-1.0.so.0': 'libgstreamer1.0-0',
|
||||
'libgstfft-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstgl-1.0.so.0': 'libgstreamer-gl1.0-0',
|
||||
'libgstpbutils-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstreamer-1.0.so.0': 'libgstreamer1.0-0',
|
||||
'libgsttag-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgstvideo-1.0.so.0': 'libgstreamer-plugins-base1.0-0',
|
||||
'libgtk-3.so.0': 'libgtk-3-0',
|
||||
'libgudev-1.0.so.0': 'libgudev-1.0-0',
|
||||
'libharfbuzz-icu.so.0': 'libharfbuzz-icu0',
|
||||
'libharfbuzz.so.0': 'libharfbuzz0b',
|
||||
'libhyphen.so.0': 'libhyphen0',
|
||||
'libicui18n.so.67': 'libicu67',
|
||||
'libicuuc.so.67': 'libicu67',
|
||||
'libjpeg.so.62': 'libjpeg62-turbo',
|
||||
'liblcms2.so.2': 'liblcms2-2',
|
||||
'libmanette-0.2.so.0': 'libmanette-0.2-0',
|
||||
'libnotify.so.4': 'libnotify4',
|
||||
'libnspr4.so': 'libnspr4',
|
||||
'libnss3.so': 'libnss3',
|
||||
'libnssutil3.so': 'libnss3',
|
||||
'libOpenGL.so.0': 'libopengl0',
|
||||
'libopenjp2.so.7': 'libopenjp2-7',
|
||||
'libopus.so.0': 'libopus0',
|
||||
'libpango-1.0.so.0': 'libpango-1.0-0',
|
||||
'libpangocairo-1.0.so.0': 'libpangocairo-1.0-0',
|
||||
'libpng16.so.16': 'libpng16-16',
|
||||
'libproxy.so.1': 'libproxy1v5',
|
||||
'libsecret-1.so.0': 'libsecret-1-0',
|
||||
'libsmime3.so': 'libnss3',
|
||||
'libwayland-client.so.0': 'libwayland-client0',
|
||||
'libwayland-egl.so.1': 'libwayland-egl1',
|
||||
'libwayland-server.so.0': 'libwayland-server0',
|
||||
'libwebp.so.6': 'libwebp6',
|
||||
'libwebpdemux.so.2': 'libwebpdemux2',
|
||||
'libwoff2dec.so.1.0.2': 'libwoff1',
|
||||
'libX11-xcb.so.1': 'libx11-xcb1',
|
||||
'libX11.so.6': 'libx11-6',
|
||||
'libxcb-shm.so.0': 'libxcb-shm0',
|
||||
'libxcb.so.1': 'libxcb1',
|
||||
'libXcomposite.so.1': 'libxcomposite1',
|
||||
'libXcursor.so.1': 'libxcursor1',
|
||||
'libXdamage.so.1': 'libxdamage1',
|
||||
'libXext.so.6': 'libxext6',
|
||||
'libXfixes.so.3': 'libxfixes3',
|
||||
'libXi.so.6': 'libxi6',
|
||||
'libxkbcommon.so.0': 'libxkbcommon0',
|
||||
'libxml2.so.2': 'libxml2',
|
||||
'libXrandr.so.2': 'libxrandr2',
|
||||
'libXrender.so.1': 'libxrender1',
|
||||
'libxslt.so.1': 'libxslt1.1',
|
||||
'libXtst.so.6': 'libxtst6',
|
||||
'libatomic.so.1': 'libatomic1',
|
||||
'libevent-2.1.so.7': 'libevent-2.1-7'
|
||||
}
|
||||
},
|
||||
'debian12-x64': {
|
||||
tools: ['xvfb', 'fonts-noto-color-emoji', 'fonts-unifont', 'libfontconfig1', 'libfreetype6', 'xfonts-scalable', 'fonts-liberation', 'fonts-ipafont-gothic', 'fonts-wqy-zenhei', 'fonts-tlwg-loma-otf', 'fonts-freefont-ttf'],
|
||||
chromium: ['libasound2', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libatspi2.0-0', 'libcairo2', 'libcups2', 'libdbus-1-3', 'libdrm2', 'libgbm1', 'libglib2.0-0', 'libnspr4', 'libnss3', 'libpango-1.0-0', 'libx11-6', 'libxcb1', 'libxcomposite1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxkbcommon0', 'libxrandr2'],
|
||||
firefox: ['libasound2', 'libatk1.0-0', 'libcairo-gobject2', 'libcairo2', 'libdbus-1-3', 'libdbus-glib-1-2', 'libfontconfig1', 'libfreetype6', 'libgdk-pixbuf-2.0-0', 'libglib2.0-0', 'libgtk-3-0', 'libharfbuzz0b', 'libpango-1.0-0', 'libpangocairo-1.0-0', 'libx11-6', 'libx11-xcb1', 'libxcb-shm0', 'libxcb1', 'libxcomposite1', 'libxcursor1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxi6', 'libxrandr2', 'libxrender1', 'libxtst6'],
|
||||
webkit: ['libsoup-3.0-0', 'gstreamer1.0-libav', 'gstreamer1.0-plugins-bad', 'gstreamer1.0-plugins-base', 'gstreamer1.0-plugins-good', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libcairo2', 'libdbus-1-3', 'libdrm2', 'libegl1', 'libenchant-2-2', 'libepoxy0', 'libevdev2', 'libfontconfig1', 'libfreetype6', 'libgbm1', 'libgdk-pixbuf-2.0-0', 'libgles2', 'libglib2.0-0', 'libglx0', 'libgstreamer-gl1.0-0', 'libgstreamer-plugins-base1.0-0', 'libgstreamer1.0-0', 'libgtk-3-0', 'libgudev-1.0-0', 'libharfbuzz-icu0', 'libharfbuzz0b', 'libhyphen0', 'libicu72', 'libjpeg62-turbo', 'liblcms2-2', 'libmanette-0.2-0', 'libnotify4', 'libopengl0', 'libopenjp2-7', 'libopus0', 'libpango-1.0-0', 'libpng16-16', 'libproxy1v5', 'libsecret-1-0', 'libwayland-client0', 'libwayland-egl1', 'libwayland-server0', 'libwebp7', 'libwebpdemux2', 'libwoff1', 'libx11-6', 'libxcomposite1', 'libxdamage1', 'libxkbcommon0', 'libxml2', 'libxslt1.1', 'libatomic1', 'libevent-2.1-7', 'libavif15'],
|
||||
lib2package: {
|
||||
'libavif.so.15': 'libavif15',
|
||||
'libsoup-3.0.so.0': 'libsoup-3.0-0',
|
||||
'libasound.so.2': 'libasound2',
|
||||
'libatk-1.0.so.0': 'libatk1.0-0',
|
||||
'libatk-bridge-2.0.so.0': 'libatk-bridge2.0-0',
|
||||
'libatspi.so.0': 'libatspi2.0-0',
|
||||
'libcairo.so.2': 'libcairo2',
|
||||
'libcups.so.2': 'libcups2',
|
||||
'libdbus-1.so.3': 'libdbus-1-3',
|
||||
'libdrm.so.2': 'libdrm2',
|
||||
'libgbm.so.1': 'libgbm1',
|
||||
'libgio-2.0.so.0': 'libglib2.0-0',
|
||||
'libglib-2.0.so.0': 'libglib2.0-0',
|
||||
'libgobject-2.0.so.0': 'libglib2.0-0',
|
||||
'libnspr4.so': 'libnspr4',
|
||||
'libnss3.so': 'libnss3',
|
||||
'libnssutil3.so': 'libnss3',
|
||||
'libpango-1.0.so.0': 'libpango-1.0-0',
|
||||
'libsmime3.so': 'libnss3',
|
||||
'libX11.so.6': 'libx11-6',
|
||||
'libxcb.so.1': 'libxcb1',
|
||||
'libXcomposite.so.1': 'libxcomposite1',
|
||||
'libXdamage.so.1': 'libxdamage1',
|
||||
'libXext.so.6': 'libxext6',
|
||||
'libXfixes.so.3': 'libxfixes3',
|
||||
'libxkbcommon.so.0': 'libxkbcommon0',
|
||||
'libXrandr.so.2': 'libxrandr2'
|
||||
}
|
||||
}
|
||||
};
|
||||
deps['ubuntu20.04-arm64'] = {
|
||||
tools: [...deps['ubuntu20.04-x64'].tools],
|
||||
chromium: [...deps['ubuntu20.04-x64'].chromium],
|
||||
firefox: [...deps['ubuntu20.04-x64'].firefox],
|
||||
webkit: [...deps['ubuntu20.04-x64'].webkit],
|
||||
lib2package: {
|
||||
...deps['ubuntu20.04-x64'].lib2package
|
||||
}
|
||||
};
|
||||
deps['ubuntu22.04-arm64'] = {
|
||||
tools: [...deps['ubuntu22.04-x64'].tools],
|
||||
chromium: [...deps['ubuntu22.04-x64'].chromium],
|
||||
firefox: [...deps['ubuntu22.04-x64'].firefox],
|
||||
webkit: [...deps['ubuntu22.04-x64'].webkit],
|
||||
lib2package: {
|
||||
...deps['ubuntu22.04-x64'].lib2package
|
||||
}
|
||||
};
|
||||
deps['ubuntu24.04-arm64'] = {
|
||||
tools: [...deps['ubuntu24.04-x64'].tools],
|
||||
chromium: [...deps['ubuntu24.04-x64'].chromium],
|
||||
firefox: [...deps['ubuntu24.04-x64'].firefox],
|
||||
webkit: [...deps['ubuntu24.04-x64'].webkit],
|
||||
lib2package: {
|
||||
...deps['ubuntu24.04-x64'].lib2package
|
||||
}
|
||||
};
|
||||
deps['debian11-arm64'] = {
|
||||
tools: [...deps['debian11-x64'].tools],
|
||||
chromium: [...deps['debian11-x64'].chromium],
|
||||
firefox: [...deps['debian11-x64'].firefox],
|
||||
webkit: [...deps['debian11-x64'].webkit],
|
||||
lib2package: {
|
||||
...deps['debian11-x64'].lib2package
|
||||
}
|
||||
};
|
||||
deps['debian12-arm64'] = {
|
||||
tools: [...deps['debian12-x64'].tools],
|
||||
chromium: [...deps['debian12-x64'].chromium],
|
||||
firefox: [...deps['debian12-x64'].firefox],
|
||||
webkit: [...deps['debian12-x64'].webkit],
|
||||
lib2package: {
|
||||
...deps['debian12-x64'].lib2package
|
||||
}
|
||||
};
|
||||
138
node_modules/playwright-core/lib/server/registry/oopDownloadBrowserMain.js
generated
vendored
Normal file
138
node_modules/playwright-core/lib/server/registry/oopDownloadBrowserMain.js
generated
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
"use strict";
|
||||
|
||||
var _fs = _interopRequireDefault(require("fs"));
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
var _network = require("../../utils/network");
|
||||
var _manualPromise = require("../../utils/manualPromise");
|
||||
var _zipBundle = require("../../zipBundle");
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
/**
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
function log(message) {
|
||||
var _process$send, _process;
|
||||
(_process$send = (_process = process).send) === null || _process$send === void 0 || _process$send.call(_process, {
|
||||
method: 'log',
|
||||
params: {
|
||||
message
|
||||
}
|
||||
});
|
||||
}
|
||||
function progress(done, total) {
|
||||
var _process$send2, _process2;
|
||||
(_process$send2 = (_process2 = process).send) === null || _process$send2 === void 0 || _process$send2.call(_process2, {
|
||||
method: 'progress',
|
||||
params: {
|
||||
done,
|
||||
total
|
||||
}
|
||||
});
|
||||
}
|
||||
function browserDirectoryToMarkerFilePath(browserDirectory) {
|
||||
return _path.default.join(browserDirectory, 'INSTALLATION_COMPLETE');
|
||||
}
|
||||
function downloadFile(options) {
|
||||
let downloadedBytes = 0;
|
||||
let totalBytes = 0;
|
||||
const promise = new _manualPromise.ManualPromise();
|
||||
(0, _network.httpRequest)({
|
||||
url: options.url,
|
||||
headers: {
|
||||
'User-Agent': options.userAgent
|
||||
},
|
||||
timeout: options.connectionTimeout
|
||||
}, response => {
|
||||
log(`-- response status code: ${response.statusCode}`);
|
||||
if (response.statusCode !== 200) {
|
||||
let content = '';
|
||||
const handleError = () => {
|
||||
const error = new Error(`Download failed: server returned code ${response.statusCode} body '${content}'. URL: ${options.url}`);
|
||||
// consume response data to free up memory
|
||||
response.resume();
|
||||
promise.reject(error);
|
||||
};
|
||||
response.on('data', chunk => content += chunk).on('end', handleError).on('error', handleError);
|
||||
return;
|
||||
}
|
||||
totalBytes = parseInt(response.headers['content-length'] || '0', 10);
|
||||
log(`-- total bytes: ${totalBytes}`);
|
||||
const file = _fs.default.createWriteStream(options.zipPath);
|
||||
file.on('finish', () => {
|
||||
if (downloadedBytes !== totalBytes) {
|
||||
log(`-- download failed, size mismatch: ${downloadedBytes} != ${totalBytes}`);
|
||||
promise.reject(new Error(`Download failed: size mismatch, file size: ${downloadedBytes}, expected size: ${totalBytes} URL: ${options.url}`));
|
||||
} else {
|
||||
log(`-- download complete, size: ${downloadedBytes}`);
|
||||
promise.resolve();
|
||||
}
|
||||
});
|
||||
file.on('error', error => promise.reject(error));
|
||||
response.pipe(file);
|
||||
response.on('data', onData);
|
||||
response.on('error', error => {
|
||||
file.close();
|
||||
if ((error === null || error === void 0 ? void 0 : error.code) === 'ECONNRESET') {
|
||||
log(`-- download failed, server closed connection`);
|
||||
promise.reject(new Error(`Download failed: server closed connection. URL: ${options.url}`));
|
||||
} else {
|
||||
var _error$message;
|
||||
log(`-- download failed, unexpected error`);
|
||||
promise.reject(new Error(`Download failed: ${(_error$message = error === null || error === void 0 ? void 0 : error.message) !== null && _error$message !== void 0 ? _error$message : error}. URL: ${options.url}`));
|
||||
}
|
||||
});
|
||||
}, error => promise.reject(error));
|
||||
return promise;
|
||||
function onData(chunk) {
|
||||
downloadedBytes += chunk.length;
|
||||
progress(downloadedBytes, totalBytes);
|
||||
}
|
||||
}
|
||||
async function main(options) {
|
||||
await downloadFile(options);
|
||||
log(`SUCCESS downloading ${options.title}`);
|
||||
log(`extracting archive`);
|
||||
await (0, _zipBundle.extract)(options.zipPath, {
|
||||
dir: options.browserDirectory
|
||||
});
|
||||
if (options.executablePath) {
|
||||
log(`fixing permissions at ${options.executablePath}`);
|
||||
await _fs.default.promises.chmod(options.executablePath, 0o755);
|
||||
}
|
||||
await _fs.default.promises.writeFile(browserDirectoryToMarkerFilePath(options.browserDirectory), '');
|
||||
}
|
||||
process.on('message', async message => {
|
||||
const {
|
||||
method,
|
||||
params
|
||||
} = message;
|
||||
if (method === 'download') {
|
||||
try {
|
||||
await main(params);
|
||||
// eslint-disable-next-line no-restricted-properties
|
||||
process.exit(0);
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(e);
|
||||
// eslint-disable-next-line no-restricted-properties
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// eslint-disable-next-line no-restricted-properties
|
||||
process.on('disconnect', () => {
|
||||
process.exit(0);
|
||||
});
|
||||
Reference in New Issue
Block a user