push
This commit is contained in:
1 parent
bcf05e8063
commit
f37985b4c8
109 files changed
+22810
-6143
No files matched your search
@@ -0,0 +1,62 @@
|
||||
{
|
||||
lib,
|
||||
buildNpmPackage,
|
||||
importNpmLock,
|
||||
nodejs,
|
||||
ffmpeg-headless,
|
||||
makeWrapper,
|
||||
}:
|
||||
|
||||
let
|
||||
root = ../.;
|
||||
|
||||
src = lib.fileset.toSource {
|
||||
inherit root;
|
||||
fileset = lib.fileset.unions [
|
||||
../src
|
||||
../providers
|
||||
../package.json
|
||||
../package-lock.json
|
||||
];
|
||||
};
|
||||
|
||||
pkgJson = lib.importJSON ../package.json;
|
||||
in
|
||||
|
||||
assert lib.assertMsg (lib.versionAtLeast nodejs.version "22") "bug-tv needs node >= 22";
|
||||
|
||||
buildNpmPackage {
|
||||
pname = "bug-tv";
|
||||
inherit (pkgJson) version;
|
||||
inherit src nodejs;
|
||||
|
||||
# no lockfile hash to keep in sync: deps are fetched per-package from package-lock.json
|
||||
npmDeps = importNpmLock { npmRoot = src; };
|
||||
npmConfigHook = importNpmLock.npmConfigHook;
|
||||
|
||||
# webtorrent's optional native deps (bufferutil, utf-8-validate, node-datachannel) are not needed
|
||||
npmFlags = [ "--ignore-scripts" ];
|
||||
dontNpmBuild = true;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/lib/bug-tv
|
||||
cp -r src providers node_modules package.json $out/lib/bug-tv/
|
||||
|
||||
makeWrapper ${lib.getExe nodejs} $out/bin/bug-tv \
|
||||
--add-flags $out/lib/bug-tv/src/server.js \
|
||||
--prefix PATH : ${lib.makeBinPath [ ffmpeg-headless ]}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = pkgJson.description;
|
||||
homepage = "https://git.bug.tools/bug/tv";
|
||||
mainProgram = "bug-tv";
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user