nextcloud30Packages.apps.recognize: ensure node_binary is replaced

This commit is contained in:
Beardhatcode
2024-11-23 21:23:55 +01:00
parent 9634c2818b
commit e035b7bc65
@@ -44,17 +44,18 @@ stdenv.mkDerivation rec {
'';
patchPhase = ''
#hardcode node
# Make it clear we are not reading the node in settings
sed -i "/'node_binary'/s:'""':'Nix Controled':" recognize/lib/Service/SettingsService.php
# Replace all occurences of node (and check that we actually remved them all)
test "$(grep "get[a-zA-Z]*('node_binary'" recognize/lib/**/*.php | wc -l)" -gt 0
substituteInPlace recognize/lib/**/*.php \
--replace-quiet "\$this->settingsService->getSetting('node_binary')" "'${nodejs}/bin/node'"
substituteInPlace recognize/lib/**/*.php \
--replace-quiet "\$this->config->getAppValueString('node_binary', '""')" "'${nodejs}/bin/node'"
substituteInPlace recognize/lib/**/*.php \
--replace-quiet "\$this->settingsService->getSetting('node_binary')" "'${nodejs}/bin/node'" \
--replace-quiet "\$this->config->getAppValueString('node_binary', '""')" "'${nodejs}/bin/node'" \
--replace-quiet "\$this->config->getAppValueString('node_binary')" "'${nodejs}/bin/node'"
test "$(grep "get[a-zA-Z]*('node_binary'" recognize/lib/**/*.php | wc -l)" -eq 0
# Skip trying to install it... (less warnings in the log)
sed -i '/public function run/areturn ; //skip' recognize/lib/Migration/InstallDeps.php