From c0cd90470b848bc1f1e96aaabcd3093b3d8ef812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 16 Sep 2022 11:29:15 +0200 Subject: [PATCH] navidrome: adhoc hack to fix the build This is very hacky, but I currently see any other way that does not involve changing node2nix in a non trivial way to allow these type of patches. --- pkgs/servers/misc/navidrome/default.nix | 2 ++ .../misc/navidrome/ui/node-composition.nix | 2 +- .../misc/navidrome/ui/node-packages.nix | 19 ++++++++++++++----- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/pkgs/servers/misc/navidrome/default.nix b/pkgs/servers/misc/navidrome/default.nix index 173dd0caa88f..7a8d759a6988 100644 --- a/pkgs/servers/misc/navidrome/default.nix +++ b/pkgs/servers/misc/navidrome/default.nix @@ -23,6 +23,8 @@ let hash = "sha256-gTvJI+brdEpdpbEcdQycqw15seI+k5dMDVrjY3v6i14="; }; + # FIXME: we currently manually inject a patch for react-scripts in here + # See https://github.com/navidrome/navidrome/pull/1767 ui = callPackage ./ui { inherit src version; }; diff --git a/pkgs/servers/misc/navidrome/ui/node-composition.nix b/pkgs/servers/misc/navidrome/ui/node-composition.nix index a10eaa345edf..2ebf5ef666f0 100644 --- a/pkgs/servers/misc/navidrome/ui/node-composition.nix +++ b/pkgs/servers/misc/navidrome/ui/node-composition.nix @@ -12,6 +12,6 @@ let }; in import ./node-packages.nix { - inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit; + inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit runCommand fetchpatch; inherit nodeEnv; } diff --git a/pkgs/servers/misc/navidrome/ui/node-packages.nix b/pkgs/servers/misc/navidrome/ui/node-packages.nix index f3743f8a990b..177f22921efa 100644 --- a/pkgs/servers/misc/navidrome/ui/node-packages.nix +++ b/pkgs/servers/misc/navidrome/ui/node-packages.nix @@ -1,6 +1,6 @@ # This file has been generated by node2nix 1.11.1. Do not edit! -{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}: +{nodeEnv, runCommand, fetchpatch, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}: let sources = { @@ -11258,10 +11258,19 @@ let name = "react-scripts"; packageName = "react-scripts"; version = "4.0.3"; - src = fetchurl { - url = "https://registry.npmjs.org/react-scripts/-/react-scripts-4.0.3.tgz"; - sha512 = "S5eO4vjUzUisvkIPB7jVsKtuH2HhWcASREYWHAQ1FP5HyCv3xgn+wpILAEWkmy+A+tTNbSZClhxjT3qz6g4L1A=="; - }; + src = runCommand "src.tgz" {} '' + tar -xvf ${fetchurl { + url = "https://registry.npmjs.org/react-scripts/-/react-scripts-4.0.3.tgz"; + sha512 = "S5eO4vjUzUisvkIPB7jVsKtuH2HhWcASREYWHAQ1FP5HyCv3xgn+wpILAEWkmy+A+tTNbSZClhxjT3qz6g4L1A=="; + }} + pushd package + patch -p2 < ${fetchpatch { + url = "https://raw.githubusercontent.com/navidrome/navidrome/c0364331748b8e0600b27caa956caa8160b2bdcd/ui/webpack-patch-for-openssl3.patch"; + sha512 = "sha512-PS1/yzneLGV76J+LvRuKtMv8imIBzB1gXnK2+vw61xQOWdNDffgfeFRUdQFBhp3Zm9oykX+YQcrwO215z+SQkg=="; + }} + popd + tar -czvf $out package + ''; }; "react-transition-group-4.4.1" = { name = "react-transition-group";