mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-16 18:37:04 +03:00
Merge pull request #99632 from midchildan/update/epgstation
epgstation: 1.7.4 -> 1.7.5
This commit is contained in:
commit
6c13df3fc0
@ -1,31 +0,0 @@
|
||||
#!/usr/bin/env -S nix-build --no-out-link
|
||||
|
||||
# Script to generate default streaming configurations for EPGStation. There's
|
||||
# no need to run this script directly since generate.sh in the EPGStation
|
||||
# package directory would run this script for you.
|
||||
#
|
||||
# Usage: ./generate | xargs cat > streaming.json
|
||||
|
||||
{ pkgs ? (import ../../../../.. {}) }:
|
||||
|
||||
let
|
||||
sampleConfigPath = "${pkgs.epgstation.src}/config/config.sample.json";
|
||||
sampleConfig = builtins.fromJSON (builtins.readFile sampleConfigPath);
|
||||
streamingConfig = {
|
||||
inherit (sampleConfig)
|
||||
mpegTsStreaming
|
||||
mpegTsViewer
|
||||
liveHLS
|
||||
liveMP4
|
||||
liveWebM
|
||||
recordedDownloader
|
||||
recordedStreaming
|
||||
recordedViewer
|
||||
recordedHLS;
|
||||
};
|
||||
in
|
||||
pkgs.runCommand "streaming.json" { nativeBuildInputs = [ pkgs.jq ]; } ''
|
||||
jq . <<<'${builtins.toJSON streamingConfig}' > $out
|
||||
''
|
||||
|
||||
# vim:set ft=nix:
|
@ -1,119 +1,119 @@
|
||||
{
|
||||
"liveHLS": [
|
||||
{
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 0 -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 17 -hls_allow_cache 1 -hls_segment_filename %streamFileDir%/stream%streamNum%-%09d.ts -c:a aac -ar 48000 -b:a 192k -ac 2 -c:v libx264 -vf yadif,scale=-2:720 -b:v 3000k -preset veryfast -flags +loop-global_header %OUTPUT%",
|
||||
"name": "720p"
|
||||
"name": "720p",
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 0 -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 17 -hls_allow_cache 1 -hls_segment_filename %streamFileDir%/stream%streamNum%-%09d.ts -c:a aac -ar 48000 -b:a 192k -ac 2 -c:v libx264 -vf yadif,scale=-2:720 -b:v 3000k -preset veryfast -flags +loop-global_header %OUTPUT%"
|
||||
},
|
||||
{
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 0 -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 17 -hls_allow_cache 1 -hls_segment_filename %streamFileDir%/stream%streamNum%-%09d.ts -c:a aac -ar 48000 -b:a 128k -ac 2 -c:v libx264 -vf yadif,scale=-2:480 -b:v 1500k -preset veryfast -flags +loop-global_header %OUTPUT%",
|
||||
"name": "480p"
|
||||
"name": "480p",
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 0 -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 17 -hls_allow_cache 1 -hls_segment_filename %streamFileDir%/stream%streamNum%-%09d.ts -c:a aac -ar 48000 -b:a 128k -ac 2 -c:v libx264 -vf yadif,scale=-2:480 -b:v 1500k -preset veryfast -flags +loop-global_header %OUTPUT%"
|
||||
},
|
||||
{
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 0 -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 17 -hls_allow_cache 1 -hls_segment_filename %streamFileDir%/stream%streamNum%-%09d.ts -c:a aac -ar 48000 -b:a 48k -ac 2 -c:v libx264 -vf yadif,scale=-2:180 -b:v 100k -preset veryfast -maxrate 110k -bufsize 1000k -flags +loop-global_header %OUTPUT%",
|
||||
"name": "180p"
|
||||
"name": "180p",
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 0 -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 17 -hls_allow_cache 1 -hls_segment_filename %streamFileDir%/stream%streamNum%-%09d.ts -c:a aac -ar 48000 -b:a 48k -ac 2 -c:v libx264 -vf yadif,scale=-2:180 -b:v 100k -preset veryfast -maxrate 110k -bufsize 1000k -flags +loop-global_header %OUTPUT%"
|
||||
}
|
||||
],
|
||||
"liveMP4": [
|
||||
{
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 0 -c:a aac -ar 48000 -b:a 192k -ac 2 -c:v libx264 -vf yadif,scale=-2:720 -b:v 3000k -profile:v baseline -preset veryfast -tune fastdecode,zerolatency -movflags frag_keyframe+empty_moov+faststart+default_base_moof -y -f mp4 pipe:1",
|
||||
"name": "720p"
|
||||
"name": "720p",
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 0 -c:a aac -ar 48000 -b:a 192k -ac 2 -c:v libx264 -vf yadif,scale=-2:720 -b:v 3000k -profile:v baseline -preset veryfast -tune fastdecode,zerolatency -movflags frag_keyframe+empty_moov+faststart+default_base_moof -y -f mp4 pipe:1"
|
||||
},
|
||||
{
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 0 -c:a aac -ar 48000 -b:a 128k -ac 2 -c:v libx264 -vf yadif,scale=-2:480 -b:v 1500k -profile:v baseline -preset veryfast -tune fastdecode,zerolatency -movflags frag_keyframe+empty_moov+faststart+default_base_moof -y -f mp4 pipe:1",
|
||||
"name": "480p"
|
||||
"name": "480p",
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 0 -c:a aac -ar 48000 -b:a 128k -ac 2 -c:v libx264 -vf yadif,scale=-2:480 -b:v 1500k -profile:v baseline -preset veryfast -tune fastdecode,zerolatency -movflags frag_keyframe+empty_moov+faststart+default_base_moof -y -f mp4 pipe:1"
|
||||
}
|
||||
],
|
||||
"liveWebM": [
|
||||
{
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 3 -c:a libvorbis -ar 48000 -b:a 192k -ac 2 -c:v libvpx-vp9 -vf yadif,scale=-2:720 -b:v 3000k -deadline realtime -speed 4 -cpu-used -8 -y -f webm pipe:1",
|
||||
"name": "720p"
|
||||
"name": "720p",
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 3 -c:a libvorbis -ar 48000 -b:a 192k -ac 2 -c:v libvpx-vp9 -vf yadif,scale=-2:720 -b:v 3000k -deadline realtime -speed 4 -cpu-used -8 -y -f webm pipe:1"
|
||||
},
|
||||
{
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 2 -c:a libvorbis -ar 48000 -b:a 128k -ac 2 -c:v libvpx-vp9 -vf yadif,scale=-2:480 -b:v 1500k -deadline realtime -speed 4 -cpu-used -8 -y -f webm pipe:1",
|
||||
"name": "480p"
|
||||
"name": "480p",
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 2 -c:a libvorbis -ar 48000 -b:a 128k -ac 2 -c:v libvpx-vp9 -vf yadif,scale=-2:480 -b:v 1500k -deadline realtime -speed 4 -cpu-used -8 -y -f webm pipe:1"
|
||||
}
|
||||
],
|
||||
"mpegTsStreaming": [
|
||||
{
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 0 -c:a aac -ar 48000 -b:a 192k -ac 2 -c:v libx264 -vf yadif,scale=-2:720 -b:v 3000k -preset veryfast -y -f mpegts pipe:1",
|
||||
"name": "720p"
|
||||
"name": "720p",
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 0 -c:a aac -ar 48000 -b:a 192k -ac 2 -c:v libx264 -vf yadif,scale=-2:720 -b:v 3000k -preset veryfast -y -f mpegts pipe:1"
|
||||
},
|
||||
{
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 0 -c:a aac -ar 48000 -b:a 128k -ac 2 -c:v libx264 -vf yadif,scale=-2:480 -b:v 1500k -preset veryfast -y -f mpegts pipe:1",
|
||||
"name": "480p"
|
||||
"name": "480p",
|
||||
"cmd": "%FFMPEG% -re -dual_mono_mode main -i pipe:0 -sn -threads 0 -c:a aac -ar 48000 -b:a 128k -ac 2 -c:v libx264 -vf yadif,scale=-2:480 -b:v 1500k -preset veryfast -y -f mpegts pipe:1"
|
||||
},
|
||||
{
|
||||
"name": "Original"
|
||||
}
|
||||
],
|
||||
"mpegTsViewer": {
|
||||
"android": "intent://ADDRESS#Intent;package=com.mxtech.videoplayer.ad;type=video;scheme=http;end",
|
||||
"ios": "vlc-x-callback://x-callback-url/stream?url=http://ADDRESS"
|
||||
"ios": "vlc-x-callback://x-callback-url/stream?url=http://ADDRESS",
|
||||
"android": "intent://ADDRESS#Intent;package=com.mxtech.videoplayer.ad;type=video;scheme=http;end"
|
||||
},
|
||||
"recordedDownloader": {
|
||||
"android": "intent://ADDRESS#Intent;package=com.dv.adm;type=video;scheme=http;end",
|
||||
"ios": "vlc-x-callback://x-callback-url/download?url=http://ADDRESS&filename=FILENAME"
|
||||
"ios": "vlc-x-callback://x-callback-url/download?url=http://ADDRESS&filename=FILENAME",
|
||||
"android": "intent://ADDRESS#Intent;package=com.dv.adm;type=video;scheme=http;end"
|
||||
},
|
||||
"recordedHLS": [
|
||||
{
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main -i %INPUT% -sn -threads 0 -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 0 -hls_allow_cache 1 -hls_segment_filename %streamFileDir%/stream%streamNum%-%09d.ts -c:a aac -ar 48000 -b:a 192k -ac 2 -c:v libx264 -vf yadif,scale=-2:720 -b:v 3000k -preset veryfast -flags +loop-global_header %OUTPUT%",
|
||||
"name": "720p"
|
||||
},
|
||||
{
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main -i %INPUT% -sn -threads 0 -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 0 -hls_allow_cache 1 -hls_segment_filename %streamFileDir%/stream%streamNum%-%09d.ts -c:a aac -ar 48000 -b:a 128k -ac 2 -c:v libx264 -vf yadif,scale=-2:480 -b:v 1500k -preset veryfast -flags +loop-global_header %OUTPUT%",
|
||||
"name": "480p"
|
||||
},
|
||||
{
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main -i %INPUT% -sn -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 0 -hls_allow_cache 1 -hls_segment_type fmp4 -hls_fmp4_init_filename stream%streamNum%-init.mp4 -hls_segment_filename stream%streamNum%-%09d.m4s -c:a aac -ar 48000 -b:a 128k -ac 2 -c:v libx265 -vf yadif,scale=-2:480 -b:v 350k -preset veryfast -tag:v hvc1 %OUTPUT%",
|
||||
"name": "480p(h265)"
|
||||
}
|
||||
],
|
||||
"recordedStreaming": {
|
||||
"mp4": [
|
||||
"webm": [
|
||||
{
|
||||
"ab": "192k",
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main %RE% -i pipe:0 -sn -threads 0 -c:a aac -ar 48000 -ac 2 -c:v libx264 -vf yadif,scale=-2:720 %VB% %VBUFFER% %AB% %ABUFFER% -profile:v baseline -preset veryfast -tune fastdecode,zerolatency -movflags frag_keyframe+empty_moov+faststart+default_base_moof -y -f mp4 pipe:1",
|
||||
"name": "720p",
|
||||
"vb": "3000k"
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main %RE% -i pipe:0 -sn -threads 3 -c:a libvorbis -ar 48000 -ac 2 -c:v libvpx-vp9 -vf yadif,scale=-2:720 %VB% %VBUFFER% %AB% %ABUFFER% -deadline realtime -speed 4 -cpu-used -8 -y -f webm pipe:1",
|
||||
"vb": "3000k",
|
||||
"ab": "192k"
|
||||
},
|
||||
{
|
||||
"ab": "128k",
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main %RE% -i pipe:0 -sn -threads 0 -c:a aac -ar 48000 -ac 2 -c:v libx264 -vf yadif,scale=-2:360 %VB% %VBUFFER% %AB% %ABUFFER% -profile:v baseline -preset veryfast -tune fastdecode,zerolatency -movflags frag_keyframe+empty_moov+faststart+default_base_moof -y -f mp4 pipe:1",
|
||||
"name": "360p",
|
||||
"vb": "1500k"
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main %RE% -i pipe:0 -sn -threads 2 -c:a libvorbis -ar 48000 -ac 2 -c:v libvpx-vp9 -vf yadif,scale=-2:360 %VB% %VBUFFER% %AB% %ABUFFER% -deadline realtime -speed 4 -cpu-used -8 -y -f webm pipe:1",
|
||||
"vb": "1500k",
|
||||
"ab": "128k"
|
||||
}
|
||||
],
|
||||
"mp4": [
|
||||
{
|
||||
"name": "720p",
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main %RE% -i pipe:0 -sn -threads 0 -c:a aac -ar 48000 -ac 2 -c:v libx264 -vf yadif,scale=-2:720 %VB% %VBUFFER% %AB% %ABUFFER% -profile:v baseline -preset veryfast -tune fastdecode,zerolatency -movflags frag_keyframe+empty_moov+faststart+default_base_moof -y -f mp4 pipe:1",
|
||||
"vb": "3000k",
|
||||
"ab": "192k"
|
||||
},
|
||||
{
|
||||
"name": "360p",
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main %RE% -i pipe:0 -sn -threads 0 -c:a aac -ar 48000 -ac 2 -c:v libx264 -vf yadif,scale=-2:360 %VB% %VBUFFER% %AB% %ABUFFER% -profile:v baseline -preset veryfast -tune fastdecode,zerolatency -movflags frag_keyframe+empty_moov+faststart+default_base_moof -y -f mp4 pipe:1",
|
||||
"vb": "1500k",
|
||||
"ab": "128k"
|
||||
}
|
||||
],
|
||||
"mpegTs": [
|
||||
{
|
||||
"ab": "192k",
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main %RE% -i pipe:0 -sn -threads 0 -c:a aac -ar 48000 -ac 2 -c:v libx264 -vf yadif,scale=-2:720 %VB% %VBUFFER% %AB% %ABUFFER% -profile:v baseline -preset veryfast -tune fastdecode,zerolatency -y -f mpegts pipe:1",
|
||||
"name": "720p (H.264)",
|
||||
"vb": "3000k"
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main %RE% -i pipe:0 -sn -threads 0 -c:a aac -ar 48000 -ac 2 -c:v libx264 -vf yadif,scale=-2:720 %VB% %VBUFFER% %AB% %ABUFFER% -profile:v baseline -preset veryfast -tune fastdecode,zerolatency -y -f mpegts pipe:1",
|
||||
"vb": "3000k",
|
||||
"ab": "192k"
|
||||
},
|
||||
{
|
||||
"ab": "128k",
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main %RE% -i pipe:0 -sn -threads 0 -c:a aac -ar 48000 -ac 2 -c:v libx264 -vf yadif,scale=-2:360 %VB% %VBUFFER% %AB% %ABUFFER% -profile:v baseline -preset veryfast -tune fastdecode,zerolatency -y -f mpegts pipe:1",
|
||||
"name": "360p (H.264)",
|
||||
"vb": "1500k"
|
||||
}
|
||||
],
|
||||
"webm": [
|
||||
{
|
||||
"ab": "192k",
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main %RE% -i pipe:0 -sn -threads 3 -c:a libvorbis -ar 48000 -ac 2 -c:v libvpx-vp9 -vf yadif,scale=-2:720 %VB% %VBUFFER% %AB% %ABUFFER% -deadline realtime -speed 4 -cpu-used -8 -y -f webm pipe:1",
|
||||
"name": "720p",
|
||||
"vb": "3000k"
|
||||
},
|
||||
{
|
||||
"ab": "128k",
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main %RE% -i pipe:0 -sn -threads 2 -c:a libvorbis -ar 48000 -ac 2 -c:v libvpx-vp9 -vf yadif,scale=-2:360 %VB% %VBUFFER% %AB% %ABUFFER% -deadline realtime -speed 4 -cpu-used -8 -y -f webm pipe:1",
|
||||
"name": "360p",
|
||||
"vb": "1500k"
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main %RE% -i pipe:0 -sn -threads 0 -c:a aac -ar 48000 -ac 2 -c:v libx264 -vf yadif,scale=-2:360 %VB% %VBUFFER% %AB% %ABUFFER% -profile:v baseline -preset veryfast -tune fastdecode,zerolatency -y -f mpegts pipe:1",
|
||||
"vb": "1500k",
|
||||
"ab": "128k"
|
||||
}
|
||||
]
|
||||
},
|
||||
"recordedHLS": [
|
||||
{
|
||||
"name": "720p",
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main -i %INPUT% -sn -threads 0 -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 0 -hls_allow_cache 1 -hls_segment_filename %streamFileDir%/stream%streamNum%-%09d.ts -c:a aac -ar 48000 -b:a 192k -ac 2 -c:v libx264 -vf yadif,scale=-2:720 -b:v 3000k -preset veryfast -flags +loop-global_header %OUTPUT%"
|
||||
},
|
||||
{
|
||||
"name": "480p",
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main -i %INPUT% -sn -threads 0 -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 0 -hls_allow_cache 1 -hls_segment_filename %streamFileDir%/stream%streamNum%-%09d.ts -c:a aac -ar 48000 -b:a 128k -ac 2 -c:v libx264 -vf yadif,scale=-2:480 -b:v 1500k -preset veryfast -flags +loop-global_header %OUTPUT%"
|
||||
},
|
||||
{
|
||||
"name": "480p(h265)",
|
||||
"cmd": "%FFMPEG% -dual_mono_mode main -i %INPUT% -sn -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 0 -hls_allow_cache 1 -hls_segment_type fmp4 -hls_fmp4_init_filename stream%streamNum%-init.mp4 -hls_segment_filename stream%streamNum%-%09d.m4s -c:a aac -ar 48000 -b:a 128k -ac 2 -c:v libx265 -vf yadif,scale=-2:480 -b:v 350k -preset veryfast -tag:v hvc1 %OUTPUT%"
|
||||
}
|
||||
],
|
||||
"recordedViewer": {
|
||||
"android": "intent://ADDRESS#Intent;package=com.mxtech.videoplayer.ad;type=video;scheme=http;end",
|
||||
"ios": "infuse://x-callback-url/play?url=http://ADDRESS"
|
||||
"ios": "infuse://x-callback-url/play?url=http://ADDRESS",
|
||||
"android": "intent://ADDRESS#Intent;package=com.mxtech.videoplayer.ad;type=video;scheme=http;end"
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,27 @@
|
||||
{ stdenv, fetchFromGitHub, makeWrapper, bash, nodejs, nodePackages, gzip }:
|
||||
{ stdenv
|
||||
, fetchFromGitHub
|
||||
, common-updater-scripts
|
||||
, genericUpdater
|
||||
, writers
|
||||
, makeWrapper
|
||||
, bash
|
||||
, nodejs
|
||||
, nodePackages
|
||||
, gzip
|
||||
, jq
|
||||
}:
|
||||
|
||||
let
|
||||
# NOTE: use updateScript to bump the package version
|
||||
pname = "EPGStation";
|
||||
version = "1.7.5";
|
||||
src = fetchFromGitHub {
|
||||
owner = "l3tnun";
|
||||
repo = "EPGStation";
|
||||
rev = "v${version}";
|
||||
sha256 = "06yaf5yb5rp3q0kdhw33df7px7vyfby885ckb6bdzw3wnams5d8m";
|
||||
};
|
||||
|
||||
workaround-opencollective-buildfailures = stdenv.mkDerivation {
|
||||
# FIXME: This should be removed when a complete fix is available
|
||||
# https://github.com/svanderburg/node2nix/issues/145
|
||||
@ -12,67 +33,73 @@ let
|
||||
chmod +x $out/bin/opencollective-postinstall
|
||||
'';
|
||||
};
|
||||
in
|
||||
nodePackages.epgstation.override (drv: {
|
||||
src = fetchFromGitHub {
|
||||
owner = "l3tnun";
|
||||
repo = "EPGStation";
|
||||
rev = "v${drv.version}"; # version specified in ./generate.sh
|
||||
sha256 = "15z1kdbamj97frp3dfnbm0h8krihmv2xdab4id0rxin29ibrw1k2";
|
||||
};
|
||||
|
||||
buildInputs = [ bash ];
|
||||
nativeBuildInputs = [
|
||||
workaround-opencollective-buildfailures
|
||||
makeWrapper
|
||||
nodePackages.node-pre-gyp
|
||||
];
|
||||
pkg = nodePackages.epgstation.override (drv: {
|
||||
inherit src;
|
||||
|
||||
preRebuild = ''
|
||||
# Fix for not being able to connect to mysql using domain sockets.
|
||||
patch -p1 ${./use-mysql-over-domain-socket.patch}
|
||||
'';
|
||||
buildInputs = [ bash ];
|
||||
nativeBuildInputs = [
|
||||
workaround-opencollective-buildfailures
|
||||
makeWrapper
|
||||
nodePackages.node-pre-gyp
|
||||
];
|
||||
|
||||
postInstall = let
|
||||
runtimeDeps = [ nodejs bash ];
|
||||
in
|
||||
''
|
||||
mkdir -p $out/{bin,libexec,share/doc/epgstation,share/man/man1}
|
||||
preRebuild = ''
|
||||
# Fix for not being able to connect to mysql using domain sockets.
|
||||
patch -p1 ${./use-mysql-over-domain-socket.patch}
|
||||
'';
|
||||
|
||||
pushd $out/lib/node_modules/EPGStation
|
||||
postInstall = let
|
||||
runtimeDeps = [ nodejs bash ];
|
||||
in
|
||||
''
|
||||
mkdir -p $out/{bin,libexec,share/doc/epgstation,share/man/man1}
|
||||
|
||||
npm run build
|
||||
npm prune --production
|
||||
pushd $out/lib/node_modules/EPGStation
|
||||
|
||||
mv config/{enc.sh,enc.js} $out/libexec
|
||||
mv LICENSE Readme.md $out/share/doc/epgstation
|
||||
mv doc/* $out/share/doc/epgstation
|
||||
sed 's/@DESCRIPTION@/${drv.meta.description}/g' ${./epgstation.1} \
|
||||
| ${gzip}/bin/gzip > $out/share/man/man1/epgstation.1.gz
|
||||
rm -rf doc
|
||||
npm run build
|
||||
npm prune --production
|
||||
|
||||
# just log to stdout and let journald do its job
|
||||
rm -rf logs
|
||||
mv config/{enc.sh,enc.js} $out/libexec
|
||||
mv LICENSE Readme.md $out/share/doc/epgstation
|
||||
mv doc/* $out/share/doc/epgstation
|
||||
sed 's/@DESCRIPTION@/${drv.meta.description}/g' ${./epgstation.1} \
|
||||
| ${gzip}/bin/gzip > $out/share/man/man1/epgstation.1.gz
|
||||
rm -rf doc
|
||||
|
||||
# Replace the existing configuration and runtime state directories with
|
||||
# symlinks. Without this, they would all be non-writable because they reside
|
||||
# in the Nix store. Note that the source path won't be accessible at build
|
||||
# time.
|
||||
rm -r config data recorded thumbnail
|
||||
ln -sfT /etc/epgstation config
|
||||
ln -sfT /var/lib/epgstation data
|
||||
ln -sfT /var/lib/epgstation/recorded recorded
|
||||
ln -sfT /var/lib/epgstation/thumbnail thumbnail
|
||||
# just log to stdout and let journald do its job
|
||||
rm -rf logs
|
||||
|
||||
makeWrapper ${nodejs}/bin/npm $out/bin/epgstation \
|
||||
--run "cd $out/lib/node_modules/EPGStation" \
|
||||
--prefix PATH : ${stdenv.lib.makeBinPath runtimeDeps}
|
||||
# Replace the existing configuration and runtime state directories with
|
||||
# symlinks. Without this, they would all be non-writable because they
|
||||
# reside in the Nix store. Note that the source path won't be accessible
|
||||
# at build time.
|
||||
rm -r config data recorded thumbnail
|
||||
ln -sfT /etc/epgstation config
|
||||
ln -sfT /var/lib/epgstation data
|
||||
ln -sfT /var/lib/epgstation/recorded recorded
|
||||
ln -sfT /var/lib/epgstation/thumbnail thumbnail
|
||||
|
||||
popd
|
||||
'';
|
||||
makeWrapper ${nodejs}/bin/npm $out/bin/epgstation \
|
||||
--run "cd $out/lib/node_modules/EPGStation" \
|
||||
--prefix PATH : ${stdenv.lib.makeBinPath runtimeDeps}
|
||||
|
||||
meta = with stdenv.lib; drv.meta // {
|
||||
maintainers = with maintainers; [ midchildan ];
|
||||
popd
|
||||
'';
|
||||
|
||||
# NOTE: this may take a while since it has to update all packages in
|
||||
# nixpkgs.nodePackages
|
||||
passthru.updateScript = import ./update.nix {
|
||||
inherit (stdenv) lib;
|
||||
inherit (src.meta) homepage;
|
||||
inherit
|
||||
pname
|
||||
version
|
||||
common-updater-scripts
|
||||
genericUpdater
|
||||
writers
|
||||
jq;
|
||||
};
|
||||
|
||||
# nodePackages.epgstation is a stub package to fetch npm dependencies and
|
||||
# is marked as broken to prevent users from installing it directly. This
|
||||
@ -80,6 +107,16 @@ nodePackages.epgstation.override (drv: {
|
||||
# nixpkgs while still allowing us to heavily customize the build. It also
|
||||
# allows us to provide devDependencies for the epgstation build process
|
||||
# without doing the same for all the other node packages.
|
||||
broken = false;
|
||||
meta = drv.meta // { broken = false; };
|
||||
});
|
||||
in
|
||||
pkg // {
|
||||
name = "${pname}-${version}";
|
||||
|
||||
meta = with stdenv.lib; pkg.meta // {
|
||||
maintainers = with maintainers; [ midchildan ];
|
||||
|
||||
# NOTE: updateScript relies on this being correct
|
||||
position = toString ./default.nix + ":1";
|
||||
};
|
||||
})
|
||||
}
|
||||
|
@ -1,34 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Script to generate the Nix package definition for EPGStation. Run this script
|
||||
# when bumping the package version.
|
||||
|
||||
VERSION="1.7.4"
|
||||
URL="https://raw.githubusercontent.com/l3tnun/EPGStation/v$VERSION/package.json"
|
||||
JQ_BIN="$(nix-build ../../../.. --no-out-link -A jq)/bin/jq"
|
||||
|
||||
set -eu -o pipefail
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
main() {
|
||||
# update package.json
|
||||
curl -sSfL "$URL" \
|
||||
| jq '. + {"dependencies": (.devDependencies + .dependencies)} | del(.devDependencies)' \
|
||||
> package.json
|
||||
|
||||
# regenerate node packages to update the actual Nix package
|
||||
pushd ../../../development/node-packages \
|
||||
&& ./generate.sh
|
||||
popd
|
||||
|
||||
# generate default streaming settings for EPGStation
|
||||
pushd ../../../../nixos/modules/services/video/epgstation \
|
||||
&& cat "$(./generate)" > streaming.json
|
||||
popd
|
||||
}
|
||||
|
||||
jq() {
|
||||
"$JQ_BIN" "$@"
|
||||
}
|
||||
|
||||
main "@"
|
@ -1,23 +1,7 @@
|
||||
{
|
||||
"name": "EPGStation",
|
||||
"version": "1.7.4",
|
||||
"version": "1.7.5",
|
||||
"description": "DTV Software in Japan.",
|
||||
"main": "dist/server/index.js",
|
||||
"scripts": {
|
||||
"start": "node dist/server/index.js",
|
||||
"dev-start": "node dist/server/index.js --env development",
|
||||
"clean": "gulp clean",
|
||||
"build": "gulp build --max_old_space_size=768 --env production",
|
||||
"dev-build": "gulp build --max_old_space_size=512 --env development",
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"task": "gulp --max_old_space_size=512",
|
||||
"install-win-service": "winser -i -a",
|
||||
"uninstall-win-service": "winser -r -x",
|
||||
"backup": "node dist/server/DBTools.js -m backup -o",
|
||||
"restore": "node dist/server/DBTools.js -m restore -o",
|
||||
"move-log": "node dist/server/LogFileMoveTools.js",
|
||||
"convert-str": "node dist/server/ConvertDBStrTools.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/l3tnun/EPGStation.git"
|
||||
@ -32,23 +16,53 @@
|
||||
"node": "^10.x.x < 11 || ^12.14.0 < 13 || ^14.5.0 < 15"
|
||||
},
|
||||
"dependencies": {
|
||||
"aribts": "^2.1.12",
|
||||
"b24.js": "1.0.3",
|
||||
"basic-auth": "2.0.1",
|
||||
"body-parser": "1.19.0",
|
||||
"chart.js": "2.9.3",
|
||||
"css-ripple-effect": "1.0.5",
|
||||
"diskusage": "1.1.3",
|
||||
"express": "4.17.1",
|
||||
"express-openapi": "7.0.1",
|
||||
"fs-extra": "9.0.1",
|
||||
"hls-b24.js": "0.12.3",
|
||||
"js-yaml": "3.14.0",
|
||||
"lodash": "4.17.20",
|
||||
"log4js": "6.3.0",
|
||||
"material-design-icons": "3.0.1",
|
||||
"material-design-lite": "1.3.0",
|
||||
"minimist": "1.2.5",
|
||||
"mirakurun": "3.3.1",
|
||||
"mithril": "2.0.4",
|
||||
"mkdirp": "1.0.4",
|
||||
"multer": "1.4.2",
|
||||
"mysql": "2.18.1",
|
||||
"openapi-types": "7.0.1",
|
||||
"pg": "8.3.3",
|
||||
"request": "2.88.2",
|
||||
"socket.io": "2.3.0",
|
||||
"socket.io-client": "2.3.0",
|
||||
"sqlite3": "5.0.0",
|
||||
"swagger-ui-dist": "3.34.0",
|
||||
"url-join": "4.0.1",
|
||||
"@types/basic-auth": "1.1.3",
|
||||
"@types/body-parser": "1.19.0",
|
||||
"@types/chart.js": "2.9.23",
|
||||
"@types/express": "4.17.7",
|
||||
"@types/hls.js": "0.13.0",
|
||||
"@types/chart.js": "2.9.24",
|
||||
"@types/express": "4.17.8",
|
||||
"@types/hls.js": "0.13.1",
|
||||
"@types/js-yaml": "3.12.5",
|
||||
"@types/lodash": "4.14.158",
|
||||
"@types/lodash": "4.14.161",
|
||||
"@types/material-design-lite": "1.1.16",
|
||||
"@types/minimist": "1.2.0",
|
||||
"@types/mithril": "2.0.3",
|
||||
"@types/mkdirp": "1.0.1",
|
||||
"@types/multer": "1.4.3",
|
||||
"@types/multer": "1.4.4",
|
||||
"@types/mysql": "2.15.15",
|
||||
"@types/node": "14.0.26",
|
||||
"@types/pg": "7.14.4",
|
||||
"@types/node": "14.11.1",
|
||||
"@types/pg": "7.14.5",
|
||||
"@types/request": "2.48.5",
|
||||
"@types/socket.io": "2.1.10",
|
||||
"@types/socket.io": "2.1.11",
|
||||
"@types/socket.io-client": "1.4.33",
|
||||
"@types/sqlite3": "3.1.6",
|
||||
"@types/url-join": "4.0.0",
|
||||
@ -61,41 +75,11 @@
|
||||
"gulp-sourcemaps": "2.6.5",
|
||||
"gulp-tslint": "8.1.4",
|
||||
"gulp-typescript": "5.0.1",
|
||||
"terser-webpack-plugin": "3.0.7",
|
||||
"ts-loader": "8.0.1",
|
||||
"tslint": "6.1.2",
|
||||
"typescript": "3.9.7",
|
||||
"webpack": "4.44.0",
|
||||
"webpack-stream": "5.2.1",
|
||||
"aribts": "^2.1.12",
|
||||
"b24.js": "1.0.3",
|
||||
"basic-auth": "2.0.1",
|
||||
"body-parser": "1.19.0",
|
||||
"chart.js": "2.9.3",
|
||||
"css-ripple-effect": "1.0.5",
|
||||
"diskusage": "1.1.3",
|
||||
"express": "4.17.1",
|
||||
"express-openapi": "7.0.0",
|
||||
"fs-extra": "9.0.1",
|
||||
"hls-b24.js": "0.12.3",
|
||||
"js-yaml": "3.14.0",
|
||||
"lodash": "4.17.19",
|
||||
"log4js": "6.3.0",
|
||||
"material-design-icons": "3.0.1",
|
||||
"material-design-lite": "1.3.0",
|
||||
"minimist": "1.2.5",
|
||||
"mirakurun": "3.2.0",
|
||||
"mithril": "2.0.4",
|
||||
"mkdirp": "1.0.4",
|
||||
"multer": "1.4.2",
|
||||
"mysql": "2.18.1",
|
||||
"openapi-types": "7.0.0",
|
||||
"pg": "8.3.0",
|
||||
"request": "2.88.2",
|
||||
"socket.io": "2.3.0",
|
||||
"socket.io-client": "2.3.0",
|
||||
"sqlite3": "5.0.0",
|
||||
"swagger-ui-dist": "3.30.2",
|
||||
"url-join": "4.0.1"
|
||||
"terser-webpack-plugin": "4.2.2",
|
||||
"ts-loader": "8.0.4",
|
||||
"tslint": "6.1.3",
|
||||
"typescript": "4.0.3",
|
||||
"webpack": "4.44.2",
|
||||
"webpack-stream": "6.1.0"
|
||||
}
|
||||
}
|
||||
|
66
pkgs/applications/video/epgstation/update.nix
Normal file
66
pkgs/applications/video/epgstation/update.nix
Normal file
@ -0,0 +1,66 @@
|
||||
{ pname
|
||||
, version
|
||||
, homepage
|
||||
, lib
|
||||
, common-updater-scripts
|
||||
, genericUpdater
|
||||
, writers
|
||||
, jq
|
||||
}:
|
||||
|
||||
let
|
||||
updater = genericUpdater {
|
||||
inherit pname version;
|
||||
attrPath = lib.toLower pname;
|
||||
rev-prefix = "v";
|
||||
versionLister = "${common-updater-scripts}/bin/list-git-tags ${homepage}";
|
||||
};
|
||||
updateScript = builtins.elemAt updater 0;
|
||||
updateArgs = map (lib.escapeShellArg) (builtins.tail updater);
|
||||
in writers.writeBash "update-epgstation" ''
|
||||
set -euxo pipefail
|
||||
|
||||
# bump the version
|
||||
${updateScript} ${lib.concatStringsSep " " updateArgs}
|
||||
|
||||
cd "${toString ./.}"
|
||||
|
||||
# Get the path to the latest source. Note that we can't just pass the value
|
||||
# of epgstation.src directly because it'd be evaluated before we can run
|
||||
# updateScript.
|
||||
SRC="$(nix-build ../../../.. --no-out-link -A epgstation.src)"
|
||||
if [[ "${version}" == "$(${jq}/bin/jq -r .version "$SRC/package.json")" ]]; then
|
||||
echo "[INFO] Already using the latest version of ${pname}" >&2
|
||||
exit
|
||||
fi
|
||||
|
||||
# Regenerate package.json from the latest source.
|
||||
${jq}/bin/jq '. + {
|
||||
dependencies: (.dependencies + .devDependencies),
|
||||
} | del(.devDependencies, .main, .scripts)' \
|
||||
"$SRC/package.json" \
|
||||
> package.json
|
||||
|
||||
# Regenerate node packages to update the pre-overriden epgstation derivation.
|
||||
# This must come *after* package.json has been regenerated.
|
||||
pushd ../../../development/node-packages
|
||||
./generate.sh
|
||||
popd
|
||||
|
||||
# Generate default streaming settings for the nixos module.
|
||||
pushd ../../../../nixos/modules/services/video/epgstation
|
||||
${jq}/bin/jq '
|
||||
{ liveHLS
|
||||
, liveMP4
|
||||
, liveWebM
|
||||
, mpegTsStreaming
|
||||
, mpegTsViewer
|
||||
, recordedDownloader
|
||||
, recordedStreaming
|
||||
, recordedHLS
|
||||
, recordedViewer
|
||||
}' \
|
||||
"$SRC/config/config.sample.json" \
|
||||
> streaming.json
|
||||
popd
|
||||
''
|
1477
pkgs/development/node-packages/node-packages.nix
generated
1477
pkgs/development/node-packages/node-packages.nix
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user