about summary refs log tree commit diff
path: root/pkgs/applications/video
diff options
context:
space:
mode:
authormidchildan <git@midchildan.org>2022-01-29 21:21:54 +0900
committermidchildan <git@midchildan.org>2022-03-12 15:10:28 +0900
commit227e4f4d0ac77a5a033f0dae7c72bbda9e7b9d4c (patch)
treeeb14535a23d6f0511234e423a30bd445f31a1a75 /pkgs/applications/video
parent1ae34d3ec09b65476d3441ca7d0ac5e3d1ae8534 (diff)
downloadnixlib-227e4f4d0ac77a5a033f0dae7c72bbda9e7b9d4c.tar
nixlib-227e4f4d0ac77a5a033f0dae7c72bbda9e7b9d4c.tar.gz
nixlib-227e4f4d0ac77a5a033f0dae7c72bbda9e7b9d4c.tar.bz2
nixlib-227e4f4d0ac77a5a033f0dae7c72bbda9e7b9d4c.tar.lz
nixlib-227e4f4d0ac77a5a033f0dae7c72bbda9e7b9d4c.tar.xz
nixlib-227e4f4d0ac77a5a033f0dae7c72bbda9e7b9d4c.tar.zst
nixlib-227e4f4d0ac77a5a033f0dae7c72bbda9e7b9d4c.zip
epgstation: 1.7.5 -> 2.6.20
Diffstat (limited to 'pkgs/applications/video')
-rw-r--r--pkgs/applications/video/epgstation/client/package.json57
-rw-r--r--pkgs/applications/video/epgstation/default.nix75
-rw-r--r--pkgs/applications/video/epgstation/epgstation.16
-rw-r--r--pkgs/applications/video/epgstation/package.json113
-rw-r--r--pkgs/applications/video/epgstation/update.nix20
-rw-r--r--pkgs/applications/video/epgstation/use-mysql-over-domain-socket.patch55
6 files changed, 218 insertions, 108 deletions
diff --git a/pkgs/applications/video/epgstation/client/package.json b/pkgs/applications/video/epgstation/client/package.json
new file mode 100644
index 000000000000..6ba9974afa5a
--- /dev/null
+++ b/pkgs/applications/video/epgstation/client/package.json
@@ -0,0 +1,57 @@
+{
+  "name": "epgstation-client",
+  "version": "2.6.20",
+  "private": true,
+  "scripts": {
+    "build": "vue-cli-service build",
+    "lint": "vue-cli-service lint",
+    "watch": "vue-cli-service build --watch --mode development"
+  },
+  "dependencies": {
+    "@mdi/font": "6.5.95",
+    "aribb24.js": "1.8.8",
+    "axios": "0.24.0",
+    "eventemitter2": "6.4.5",
+    "hls.js": "1.1.2",
+    "inversify": "6.0.1",
+    "json-stable-stringify": "1.0.1",
+    "lodash": "4.17.21",
+    "material-design-icons-iconfont": "6.1.1",
+    "mpegts.js": "1.6.10",
+    "reflect-metadata": "0.1.13",
+    "resize-observer-polyfill": "1.5.1",
+    "roboto-fontface": "*",
+    "smoothscroll-polyfill": "0.4.4",
+    "socket.io-client": "4.3.2",
+    "typeface-roboto": "1.1.13",
+    "vue": "2.6.14",
+    "vue-class-component": "7.2.6",
+    "vue-property-decorator": "9.1.2",
+    "vue-router": "3.5.3",
+    "vuetify": "2.5.10",
+    "vuetify-datetime-picker": "2.1.1",
+    "@types/hls.js": "0.13.3",
+    "@types/json-stable-stringify": "1.0.33",
+    "@types/lodash": "4.14.178",
+    "@types/smoothscroll-polyfill": "0.3.1",
+    "@types/socket.io-client": "1.4.36",
+    "@typescript-eslint/eslint-plugin": "4.33.0",
+    "@typescript-eslint/parser": "4.33.0",
+    "@vue/cli-plugin-eslint": "4.5.12",
+    "@vue/cli-plugin-typescript": "4.5.13",
+    "@vue/cli-plugin-vuex": "4.5.13",
+    "@vue/cli-service": "4.5.13",
+    "@vue/eslint-config-prettier": "6.0.0",
+    "@vue/eslint-config-typescript": "7.0.0",
+    "eslint": "7.32.0",
+    "eslint-plugin-prettier": "3.4.1",
+    "eslint-plugin-vue": "7.20.0",
+    "prettier": "2.4.1",
+    "sass": "1.32.12",
+    "sass-loader": "10.2.0",
+    "typescript": "4.4.4",
+    "vue-cli-plugin-vuetify": "2.4.3",
+    "vue-template-compiler": "2.6.14",
+    "vuetify-loader": "1.7.3"
+  }
+}
diff --git a/pkgs/applications/video/epgstation/default.nix b/pkgs/applications/video/epgstation/default.nix
index 3d910ad4c0e8..77510ae153de 100644
--- a/pkgs/applications/video/epgstation/default.nix
+++ b/pkgs/applications/video/epgstation/default.nix
@@ -10,17 +10,18 @@
 , nodePackages
 , gzip
 , jq
+, yq
 }:
 
 let
   # NOTE: use updateScript to bump the package version
   pname = "EPGStation";
-  version = "1.7.5";
+  version = "2.6.20";
   src = fetchFromGitHub {
     owner = "l3tnun";
     repo = "EPGStation";
     rev = "v${version}";
-    sha256 = "06yaf5yb5rp3q0kdhw33df7px7vyfby885ckb6bdzw3wnams5d8m";
+    sha256 = "K1cAvmqWEfS6EY4MKAtjXb388XLYHtouxNM70PWgFig=";
   };
 
   workaround-opencollective-buildfailures = stdenv.mkDerivation {
@@ -35,19 +36,44 @@ let
     '';
   };
 
-  pkg = nodePackages.epgstation.override (drv: {
+  client = nodePackages.epgstation-client.override (drv: {
+    # FIXME: remove this option if possible
+    #
+    # Unsetting this option resulted NPM attempting to re-download packages.
+    dontNpmInstall = true;
+
+    meta = drv.meta // {
+      inherit (nodejs.meta) platforms;
+    };
+  });
+
+  server = nodePackages.epgstation.override (drv: {
     inherit src;
 
+    bypassCache = false;
+
+    # This is set to false to keep devDependencies at build time. Build time
+    # dependencies are pruned afterwards.
+    production = false;
+
     buildInputs = [ bash ];
     nativeBuildInputs = [
+      nodejs
       workaround-opencollective-buildfailures
       makeWrapper
-      nodePackages.node-pre-gyp
-    ];
+    ] ++ (with nodePackages; [
+      node-pre-gyp
+      node-gyp-build
+    ]);
 
     preRebuild = ''
       # Fix for not being able to connect to mysql using domain sockets.
-      patch -p1 ${./use-mysql-over-domain-socket.patch}
+      patch -p1 < ${./use-mysql-over-domain-socket.patch}
+
+      # Workaround for https://github.com/svanderburg/node2nix/issues/275
+      sed -i -e "s|#!/usr/bin/env node|#! ${nodejs}/bin/node|" node_modules/node-gyp-build/bin.js
+
+      find . -name package-lock.json -delete
     '';
 
     postInstall = let
@@ -56,12 +82,19 @@ let
     ''
       mkdir -p $out/{bin,libexec,share/doc/epgstation,share/man/man1}
 
-      pushd $out/lib/node_modules/EPGStation
+      pushd $out/lib/node_modules/epgstation
+
+      cp -r ${client}/lib/node_modules/epgstation-client/node_modules client/node_modules
+      chmod -R u+w client/node_modules
 
       npm run build
+
       npm prune --production
+      pushd client
+      npm prune --production
+      popd
 
-      mv config/{enc.sh,enc.js} $out/libexec
+      mv config/enc.js.template $out/libexec/enc.js
       mv LICENSE Readme.md $out/share/doc/epgstation
       mv doc/* $out/share/doc/epgstation
       sed 's/@DESCRIPTION@/${drv.meta.description}/g' ${./epgstation.1} \
@@ -82,8 +115,9 @@ let
       ln -sfT /var/lib/epgstation/thumbnail thumbnail
 
       makeWrapper ${nodejs}/bin/npm $out/bin/epgstation \
-       --run "cd $out/lib/node_modules/EPGStation" \
-       --prefix PATH : ${lib.makeBinPath runtimeDeps}
+       --run "cd $out/lib/node_modules/epgstation" \
+       --prefix PATH : ${lib.makeBinPath runtimeDeps} \
+       --set APP_ROOT_PATH "$out/lib/node_modules/epgstation"
 
       popd
     '';
@@ -99,22 +133,25 @@ let
         common-updater-scripts
         genericUpdater
         writers
-        jq;
+        jq
+        yq;
     };
 
     # nodePackages.epgstation is a stub package to fetch npm dependencies and
-    # is marked as broken to prevent users from installing it directly. This
-    # technique ensures epgstation can share npm packages with the rest of
-    # 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.
-    meta = drv.meta // { broken = false; };
+    # its meta.platforms is made empty to prevent users from installing it
+    # directly. This technique ensures epgstation can share npm packages with
+    # the rest of 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.
+    meta = drv.meta // {
+      inherit (nodejs.meta) platforms;
+    };
   });
 in
-pkg // {
+server // {
   name = "${pname}-${version}";
 
-  meta = with lib; pkg.meta // {
+  meta = with lib; server.meta // {
     maintainers = with maintainers; [ midchildan ];
 
     # NOTE: updateScript relies on this being correct
diff --git a/pkgs/applications/video/epgstation/epgstation.1 b/pkgs/applications/video/epgstation/epgstation.1
index bb5c02381378..2dc67f646088 100644
--- a/pkgs/applications/video/epgstation/epgstation.1
+++ b/pkgs/applications/video/epgstation/epgstation.1
@@ -27,7 +27,7 @@ platforms, run
 to start EPGStation.
 .Sh FILES
 .Bl -tag -width Ds -compact
-.It Pa /etc/epgstation/config.json
+.It Pa /etc/epgstation/config.yml
 .Nm
 configuration file.
 .El
@@ -48,5 +48,9 @@ Restore the EPGstation database.
 .Pp
 .Dl $ epgstation run restore /path/to/src
 .Pp
+Restore the EPGstation database from the prior v1 release.
+.Pp
+.Dl $ epgstation run v1migrate /path/to/src
+.Pp
 .Sh SEE ALSO
 .Xr npm 1
diff --git a/pkgs/applications/video/epgstation/package.json b/pkgs/applications/video/epgstation/package.json
index 53b1ebca2da7..cf302a95161a 100644
--- a/pkgs/applications/video/epgstation/package.json
+++ b/pkgs/applications/video/epgstation/package.json
@@ -1,85 +1,72 @@
 {
-  "name": "EPGStation",
-  "version": "1.7.5",
+  "name": "epgstation",
+  "version": "2.6.20",
   "description": "DTV Software in Japan.",
   "repository": {
     "type": "git",
-    "url": "https://github.com/l3tnun/EPGStation.git"
+    "url": "git+https://github.com/l3tnun/EPGStation-V2.git"
   },
   "author": "l3tnun",
   "license": "MIT",
   "bugs": {
-    "url": "https://github.com/l3tnun/EPGStation/issues"
-  },
-  "homepage": "https://github.com/l3tnun/EPGStation#readme",
-  "engines": {
-    "node": "^10.x.x < 11 || ^12.14.0 < 13 || ^14.5.0 < 15"
+    "url": "https://github.com/l3tnun/EPGStation-V2/issues"
   },
+  "homepage": "https://github.com/l3tnun/EPGStation-V2#readme",
   "dependencies": {
-    "aribts": "^2.1.12",
-    "b24.js": "1.0.3",
-    "basic-auth": "2.0.1",
+    "arib-subtitle-timedmetadater": "4.0.9",
+    "aribts": "2.1.12",
+    "axios": "0.24.0",
     "body-parser": "1.19.0",
-    "chart.js": "2.9.3",
-    "css-ripple-effect": "1.0.5",
-    "diskusage": "1.1.3",
+    "cors": "2.8.5",
+    "diskusage-ng": "1.0.2",
     "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",
+    "express-openapi": "9.3.0",
+    "file-type": "16.5.3",
+    "inversify": "5.1.1",
+    "js-yaml": "4.1.0",
+    "lodash": "4.17.21",
     "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",
+    "mirakurun": "3.9.0-beta.26",
     "mkdirp": "1.0.4",
-    "multer": "1.4.2",
+    "multer": "1.4.3",
     "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",
+    "openapi-types": "9.3.0",
+    "reflect-metadata": "0.1.13",
+    "socket.io": "4.3.1",
+    "source-map-support": "0.5.20",
+    "sqlite3": "5.0.2",
+    "swagger-ui-dist": "3.52.5",
+    "typeorm": "0.2.38",
     "url-join": "4.0.1",
-    "@types/basic-auth": "1.1.3",
-    "@types/body-parser": "1.19.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.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.4",
-    "@types/mysql": "2.15.15",
-    "@types/node": "14.11.1",
-    "@types/pg": "7.14.5",
-    "@types/request": "2.48.5",
-    "@types/socket.io": "2.1.11",
-    "@types/socket.io-client": "1.4.33",
-    "@types/sqlite3": "3.1.6",
-    "@types/url-join": "4.0.0",
-    "del": "5.1.0",
+    "@types/body-parser": "1.19.1",
+    "@types/express": "4.17.13",
+    "@types/file-type": "10.9.1",
+    "@types/js-yaml": "4.0.4",
+    "@types/lodash": "4.14.176",
+    "@types/minimist": "1.2.2",
+    "@types/mkdirp": "1.0.2",
+    "@types/mongodb": "4.0.6",
+    "@types/multer": "1.4.7",
+    "@types/node": "16.11.6",
+    "@types/socket.io": "3.0.1",
+    "@types/source-map-support": "0.5.4",
+    "@types/sqlite3": "3.1.7",
+    "@types/url-join": "4.0.1",
+    "@typescript-eslint/eslint-plugin": "4.33.0",
+    "@typescript-eslint/parser": "4.33.0",
+    "del": "6.0.0",
+    "eslint": "7.32.0",
+    "eslint-config-prettier": "8.3.0",
+    "eslint-plugin-prettier": "3.4.1",
     "gulp": "4.0.2",
-    "gulp-clean-css": "4.3.0",
-    "gulp-concat": "2.6.1",
-    "gulp-dart-sass": "1.0.2",
+    "gulp-eslint": "6.0.0",
     "gulp-plumber": "1.2.1",
-    "gulp-sourcemaps": "2.6.5",
-    "gulp-tslint": "8.1.4",
+    "gulp-sourcemaps": "3.0.0",
     "gulp-typescript": "5.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"
+    "prettier": "2.4.1",
+    "ts-loader": "9.2.6",
+    "ts-node": "10.4.0",
+    "typescript": "4.4.4"
   }
 }
diff --git a/pkgs/applications/video/epgstation/update.nix b/pkgs/applications/video/epgstation/update.nix
index 5c2fbe66f04e..bbce54ce1dcc 100644
--- a/pkgs/applications/video/epgstation/update.nix
+++ b/pkgs/applications/video/epgstation/update.nix
@@ -6,6 +6,7 @@
 , genericUpdater
 , writers
 , jq
+, yq
 }:
 
 let
@@ -40,6 +41,11 @@ in writers.writeBash "update-epgstation" ''
     } | del(.devDependencies, .main, .scripts)' \
     "$SRC/package.json" \
     > package.json
+  ${jq}/bin/jq '. + {
+      dependencies: (.dependencies + .devDependencies),
+    } | del(.devDependencies, .main, .scripts)' \
+    "$SRC/client/package.json" \
+    > client/package.json
 
   # Regenerate node packages to update the pre-overriden epgstation derivation.
   # This must come *after* package.json has been regenerated.
@@ -49,18 +55,8 @@ in writers.writeBash "update-epgstation" ''
 
   # 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" \
+  ${yq}/bin/yq -j '{ urlscheme , stream }' \
+    "$SRC/config/config.yml.template" \
     > streaming.json
   popd
 ''
diff --git a/pkgs/applications/video/epgstation/use-mysql-over-domain-socket.patch b/pkgs/applications/video/epgstation/use-mysql-over-domain-socket.patch
index 48640f2ba08d..87bb3e7fbd19 100644
--- a/pkgs/applications/video/epgstation/use-mysql-over-domain-socket.patch
+++ b/pkgs/applications/video/epgstation/use-mysql-over-domain-socket.patch
@@ -1,17 +1,46 @@
-diff --git a/src/server/ConfigInterface.ts b/src/server/ConfigInterface.ts
-index d23badd..1dd2b98 100644
---- a/src/server/ConfigInterface.ts
-+++ b/src/server/ConfigInterface.ts
-@@ -11,9 +11,10 @@ interface ConfigInterface {
-     dbPath: string;
-     dbInfoPath: string;
-     mysql: {
+diff --git a/ormconfig.js b/ormconfig.js
+index 5591853b..838c06cb 100644
+--- a/ormconfig.js
++++ b/ormconfig.js
+@@ -38,8 +38,6 @@ switch (config.dbtype) {
+ 
+     case 'mysql':
+         ormConfig.type = 'mysql';
+-        ormConfig.host = config.mysql.host;
+-        ormConfig.port = config.mysql.port;
+         ormConfig.username = config.mysql.user;
+         ormConfig.password = config.mysql.password;
+         ormConfig.database = config.mysql.database;
+@@ -49,6 +47,12 @@ switch (config.dbtype) {
+         } else {
+             ormConfig.charset = config.mysql.charset;
+         }
++        if (config.mysql.socketPath) {
++            ormConfig.socketPath = config.mysql.socketPath;
++        } else {
++            ormConfig.host = config.mysql.host;
++            ormConfig.port = config.mysql.port;
++        }
+         break;
+ 
+     case 'postgres':
+diff --git a/src/model/IConfigFile.ts b/src/model/IConfigFile.ts
+index 6a502e83..ba84a423 100644
+--- a/src/model/IConfigFile.ts
++++ b/src/model/IConfigFile.ts
+@@ -61,12 +61,13 @@ export default interface IConfigFile {
+         regexp?: boolean;
+     };
+     mysql?: {
 -        host: string;
 +        host?: string;
-+        socketPath?: string;
          user: string;
--        password: string;
-+        password?: string;
+-        port: number;
++        port?: number;
+         password: string;
          database: string;
-         connectTimeout: number;
-         connectionLimit: number;
+         charset?: string;
++        socketPath?: string;
+     };
+     postgres?: {
+         host: string;