Skip to content

Commit

Permalink
fix(web): patch package to make it work with nix
Browse files Browse the repository at this point in the history
  • Loading branch information
matt1432 committed Oct 27, 2024
1 parent f1783a6 commit 8b98490
Show file tree
Hide file tree
Showing 4 changed files with 1,377 additions and 1 deletion.
26 changes: 26 additions & 0 deletions pkgs/jellyfin-web/commit.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
webpack.common.js | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/webpack.common.js b/webpack.common.js
index 61fe39483..b838552b1 100644
--- a/webpack.common.js
+++ b/webpack.common.js
@@ -20,15 +20,7 @@ const Assets = [
];

const DEV_MODE = process.env.NODE_ENV !== 'production';
-let COMMIT_SHA = '';
-try {
- COMMIT_SHA = require('child_process')
- .execSync('git describe --always --dirty')
- .toString()
- .trim();
-} catch (err) {
- console.warn('Failed to get commit sha. Is git installed?', err);
-}
+const COMMIT_SHA = process.env.COMMIT_SHA;

const NODE_MODULES_REGEX = /[\\/]node_modules[\\/]/;

--
2.46.1
11 changes: 11 additions & 0 deletions pkgs/jellyfin-web/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
buildNpmPackage,
darwin,
dart-sass,
fetchFromGitHub,
giflib,
lib,
Expand Down Expand Up @@ -47,6 +48,16 @@ in
darwin.apple_sdk.frameworks.CoreText
];

patches = [
./commit.patch
./lock.patch
];

env = {
COMMIT_SHA = jellyfin-web-src.rev;
SASS_EMBEDDED_BIN_PATH = "${dart-sass}/bin/sass";
};

installPhase = ''
runHook preInstall
Expand Down
Loading

0 comments on commit 8b98490

Please sign in to comment.