about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/applications/video/epgstation/default.nix19
-rw-r--r--pkgs/applications/video/epgstation/package.json2
-rw-r--r--pkgs/applications/video/epgstation/update.nix4
-rw-r--r--pkgs/development/node-packages/overrides.nix3
-rw-r--r--pkgs/top-level/all-packages.nix4
5 files changed, 20 insertions, 12 deletions
diff --git a/pkgs/applications/video/epgstation/default.nix b/pkgs/applications/video/epgstation/default.nix
index 1f5d23a684a8a..af055d614b85b 100644
--- a/pkgs/applications/video/epgstation/default.nix
+++ b/pkgs/applications/video/epgstation/default.nix
@@ -6,7 +6,6 @@
 , makeWrapper
 , bash
 , nodejs
-, nodePackages
 , gzip
 , jq
 , yq
@@ -23,18 +22,17 @@ let
     sha256 = "K1cAvmqWEfS6EY4MKAtjXb388XLYHtouxNM70PWgFig=";
   };
 
-  client = nodePackages.epgstation-client.override (drv: {
-    # FIXME: remove this option if possible
-    #
-    # Unsetting this option resulted NPM attempting to re-download packages.
-    dontNpmInstall = true;
+  client = nodejs.pkgs.epgstation-client.override (drv: {
+    # This is set to false to keep devDependencies at build time. Build time
+    # dependencies are pruned afterwards.
+    production = false;
 
     meta = drv.meta // {
       inherit (nodejs.meta) platforms;
     };
   });
 
-  server = nodePackages.epgstation.override (drv: {
+  server = nodejs.pkgs.epgstation.override (drv: {
     inherit src;
 
     # This is set to false to keep devDependencies at build time. Build time
@@ -47,6 +45,9 @@ let
     ];
 
     preRebuild = ''
+      # Fix for OpenSSL compat with newer Node.js
+      export NODE_OPTIONS=--openssl-legacy-provider
+
       # Fix for not being able to connect to mysql using domain sockets.
       patch -p1 < ${./use-mysql-over-domain-socket.patch}
 
@@ -64,8 +65,8 @@ let
 
       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
+      cp -r ${client}/lib/node_modules/epgstation-client/{package-lock.json,node_modules} client/
+      chmod -R u+w client/{package-lock.json,node_modules}
 
       npm run build
 
diff --git a/pkgs/applications/video/epgstation/package.json b/pkgs/applications/video/epgstation/package.json
index cf302a95161ac..e636d95ef1165 100644
--- a/pkgs/applications/video/epgstation/package.json
+++ b/pkgs/applications/video/epgstation/package.json
@@ -35,7 +35,7 @@
     "reflect-metadata": "0.1.13",
     "socket.io": "4.3.1",
     "source-map-support": "0.5.20",
-    "sqlite3": "5.0.2",
+    "sqlite3": "5.0.11",
     "swagger-ui-dist": "3.52.5",
     "typeorm": "0.2.38",
     "url-join": "4.0.1",
diff --git a/pkgs/applications/video/epgstation/update.nix b/pkgs/applications/video/epgstation/update.nix
index 387fbe0db62d2..6061f0c7775f5 100644
--- a/pkgs/applications/video/epgstation/update.nix
+++ b/pkgs/applications/video/epgstation/update.nix
@@ -6,6 +6,7 @@
 , writers
 , jq
 , yq
+, gnused
 }:
 
 let
@@ -45,6 +46,9 @@ in writers.writeBash "update-epgstation" ''
     "$SRC/client/package.json" \
     > client/package.json
 
+  # Fix issue with old sqlite3 version pinned that depends on very old node-gyp 3.x
+  ${gnused}/bin/sed -i -e 's/"sqlite3":\s*"5.0.[0-9]\+"/"sqlite3": "5.0.11"/' 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
diff --git a/pkgs/development/node-packages/overrides.nix b/pkgs/development/node-packages/overrides.nix
index a29c5623b15d9..28a2be66df309 100644
--- a/pkgs/development/node-packages/overrides.nix
+++ b/pkgs/development/node-packages/overrides.nix
@@ -132,7 +132,8 @@ final: prev: {
   # NOTE: this is a stub package to fetch npm dependencies for
   # ../../applications/video/epgstation
   epgstation = prev."epgstation-../../applications/video/epgstation".override (oldAttrs: {
-    buildInputs = [ final.node-pre-gyp final.node-gyp-build ];
+    buildInputs = [ pkgs.postgresql ];
+    nativeBuildInputs = [ final.node-pre-gyp final.node-gyp-build pkgs.which ];
     meta = oldAttrs.meta // { platforms = lib.platforms.none; };
   });
 
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 3bf6034c0a93a..e8cc37745c492 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -27630,7 +27630,9 @@ with pkgs;
 
   epeg = callPackage ../applications/graphics/epeg { };
 
-  epgstation = callPackage ../applications/video/epgstation { };
+  epgstation = callPackage ../applications/video/epgstation {
+    nodejs = nodejs-16_x;
+  };
 
   inherit (gnome) epiphany;