peertube: add peertube-runnerr utility

This commit is contained in:
Izorkin 2023-12-12 17:45:09 +03:00
parent 6e61227199
commit 1bdbfd5778
No known key found for this signature in database
GPG Key ID: 1436C1B3F3679F09
1 changed files with 19 additions and 2 deletions

View File

@ -69,7 +69,12 @@ stdenv.mkDerivation rec {
hash = "sha256-xsB71bnaPn/9/f1KHyU3TTwx+Q+1dLjWmNK2aVJgoRY=";
};
outputs = [ "out" "cli" ];
yarnOfflineCacheAppsRunner = fetchYarnDeps {
yarnLock = "${src}/apps/peertube-runner/yarn.lock";
hash = "sha256-9w3aLuiLs7SU00YwuE0ixfiD77gCakXT4YeRpfsgGz0=";
};
outputs = [ "out" "cli" "runner" ];
nativeBuildInputs = [ brotli prefetch-yarn-deps jq which yarn ];
@ -81,6 +86,7 @@ stdenv.mkDerivation rec {
fixup-yarn-lock ~/yarn.lock
fixup-yarn-lock ~/client/yarn.lock
fixup-yarn-lock ~/apps/peertube-cli/yarn.lock
fixup-yarn-lock ~/apps/peertube-runner/yarn.lock
yarn config --offline set yarn-offline-mirror $yarnOfflineCacheServer
yarn install --offline --frozen-lockfile --ignore-engines --ignore-scripts --no-progress
cd ~/client
@ -89,8 +95,11 @@ stdenv.mkDerivation rec {
cd ~/apps/peertube-cli
yarn config --offline set yarn-offline-mirror $yarnOfflineCacheAppsCli
yarn install --offline --frozen-lockfile --ignore-engines --ignore-scripts --no-progress
cd ~/apps/peertube-runner
yarn config --offline set yarn-offline-mirror $yarnOfflineCacheAppsRunner
yarn install --offline --frozen-lockfile --ignore-engines --ignore-scripts --no-progress
patchShebangs ~/{node_modules,client/node_modules,/apps/peertube-cli/node_modules,scripts}
patchShebangs ~/{node_modules,client/node_modules,/apps/peertube-cli/node_modules,apps/peertube-runner/node_modules,scripts}
# Fix bcrypt node module
cd ~/node_modules/bcrypt
@ -113,6 +122,10 @@ stdenv.mkDerivation rec {
npm run build:peertube-cli
patchShebangs ~/apps/peertube-cli/dist/peertube.js
# Build PeerTube runner
npm run build:peertube-runner
patchShebangs ~/apps/peertube-runner/dist/peertube-runner.js
# Clean up declaration files
find ~/dist/ \
~/packages/core-utils/dist/ \
@ -143,6 +156,10 @@ stdenv.mkDerivation rec {
mv ~/apps/peertube-cli/{dist,node_modules,package.json,yarn.lock} $cli
ln -s $cli/dist/peertube.js $cli/bin/peertube-cli
mkdir -p $runner/bin
mv ~/apps/peertube-runner/{dist,node_modules,package.json,yarn.lock} $runner
ln -s $runner/dist/peertube-runner.js $runner/bin/peertube-runner
# Create static gzip and brotli files
find $out/client/dist -type f -regextype posix-extended -iregex '.*\.(css|eot|html|js|json|svg|webmanifest|xlf)' | while read file; do
gzip -9 -n -c $file > $file.gz