uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,76 @@
From 035709eeac697945a26276cc17b996c1a0678ddc Mon Sep 17 00:00:00 2001
From: Maximilian Bosch <maximilian@mbosch.me>
Date: Tue, 22 Dec 2020 15:38:56 +0100
Subject: [PATCH] Define configs with env vars
---
app.php | 4 ++--
services/DatabaseService.php | 2 +-
services/FilesService.php | 2 +-
services/StockService.php | 3 +--
4 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/app.php b/app.php
index 17ba6a99..89f48089 100644
--- a/app.php
+++ b/app.php
@@ -11,7 +11,7 @@ use Slim\Views\Blade;
require_once __DIR__ . '/vendor/autoload.php';
// Load config files
-require_once GROCY_DATAPATH . '/config.php';
+require_once getenv('GROCY_CONFIG_FILE');
require_once __DIR__ . '/config-dist.php'; // For not in own config defined values we use the default ones
require_once __DIR__ . '/helpers/ConfigurationValidator.php';
@@ -62,7 +62,7 @@ $app = AppFactory::create();
$container = $app->getContainer();
$container->set('view', function (Container $container) {
- return new Blade(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache');
+ return new Blade(__DIR__ . '/views', getenv('GROCY_CACHE_DIR'));
});
$container->set('UrlManager', function (Container $container) {
diff --git a/services/DatabaseService.php b/services/DatabaseService.php
index dfcd5d4b..bc8d1a1d 100644
--- a/services/DatabaseService.php
+++ b/services/DatabaseService.php
@@ -107,6 +107,6 @@ class DatabaseService
return GROCY_DATAPATH . '/grocy_' . $dbSuffix . '.db';
}
- return GROCY_DATAPATH . '/grocy.db';
+ return getenv('GROCY_DB_FILE');
}
}
diff --git a/services/FilesService.php b/services/FilesService.php
index 7d070350..fba2e923 100644
--- a/services/FilesService.php
+++ b/services/FilesService.php
@@ -103,7 +103,7 @@ class FilesService extends BaseService
public function GetFilePath($group, $fileName)
{
- $groupFolderPath = $this->StoragePath . '/' . $group;
+ $this->StoragePath = getenv('GROCY_STORAGE_DIR');
if (!file_exists($groupFolderPath))
{
diff --git a/services/StockService.php b/services/StockService.php
index f73ac5bd..6b6e693a 100644
--- a/services/StockService.php
+++ b/services/StockService.php
@@ -1589,8 +1589,7 @@ class StockService extends BaseService
throw new \Exception('No barcode lookup plugin defined');
}
- $path = GROCY_DATAPATH . "/plugins/$pluginName.php";
-
+ $path = getenv('GROCY_PLUGIN_DIR') . "/$pluginName.php";
if (file_exists($path))
{
require_once $path;
--
2.31.1

View file

@ -0,0 +1,24 @@
From c46323dfc4a3d5bf17f7508f5b5f223858a598c3 Mon Sep 17 00:00:00 2001
From: Maximilian Bosch <maximilian@mbosch.me>
Date: Tue, 22 Dec 2020 15:39:15 +0100
Subject: [PATCH 2/2] Remove check for config-file as it's stored in /etc/grocy
---
helpers/PrerequisiteChecker.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/helpers/PrerequisiteChecker.php b/helpers/PrerequisiteChecker.php
index cbe0a3a..a484db2 100644
--- a/helpers/PrerequisiteChecker.php
+++ b/helpers/PrerequisiteChecker.php
@@ -11,7 +11,6 @@ class PrerequisiteChecker
{
public function checkRequirements()
{
- self::checkForConfigFile();
self::checkForConfigDistFile();
self::checkForComposer();
self::checkForPhpExtensions();
--
2.29.2

View file

@ -0,0 +1,40 @@
{ lib, stdenv, fetchurl, unzip, nixosTests }:
stdenv.mkDerivation rec {
pname = "grocy";
version = "3.3.0";
src = fetchurl {
url = "https://github.com/grocy/grocy/releases/download/v${version}/grocy_${version}.zip";
sha256 = "sha256-y0l0V+cTIfZYtyV8l6kdFW9UzJWb7eQMEocaPo7TLbg=";
};
nativeBuildInputs = [ unzip ];
unpackPhase = ''
unzip ${src} -d .
'';
# NOTE: if patches are created from a git checkout, those should be modified
# with `unixdos` to make sure those apply here.
patches = [
./0001-Define-configs-with-env-vars.patch
./0002-Remove-check-for-config-file-as-it-s-stored-in-etc-g.patch
];
patchFlags = [ "--binary" "-p1" ];
dontBuild = true;
passthru.tests = { inherit (nixosTests) grocy; };
installPhase = ''
mkdir -p $out/
cp -R . $out/
'';
meta = with lib; {
license = licenses.mit;
maintainers = with maintainers; [ ma27 ];
description = "ERP beyond your fridge - grocy is a web-based self-hosted groceries & household management solution for your home";
homepage = "https://grocy.info/";
};
}