|
1 | | -{ lib |
2 | | -, stdenv |
3 | | -, callPackage |
4 | | -, fetchFromGitHub |
5 | | -, makeWrapper |
6 | | -, nixosTests |
7 | | -, python3Packages |
8 | | -, writeShellScript |
| 1 | +{ |
| 2 | + lib, |
| 3 | + stdenv, |
| 4 | + callPackage, |
| 5 | + fetchFromGitHub, |
| 6 | + makeWrapper, |
| 7 | + nixosTests, |
| 8 | + python3Packages, |
| 9 | + writeShellScript, |
9 | 10 | }: |
10 | 11 |
|
11 | 12 | let |
12 | | - version = "2.3.0"; |
| 13 | + version = "2.6.0"; |
13 | 14 | src = fetchFromGitHub { |
14 | 15 | owner = "mealie-recipes"; |
15 | 16 | repo = "mealie"; |
16 | | - rev = "v${version}"; |
17 | | - hash = "sha256-GN+uXyZCvDuFmQnXhn0mFans3bvvEw7Uq6V0OeCPEbE="; |
| 17 | + tag = "v${version}"; |
| 18 | + hash = "sha256-txkHCQ/xTakPXXFki161jNOKwAH9p9z1hCNEEkbqQtM="; |
18 | 19 | }; |
19 | 20 |
|
20 | 21 | frontend = callPackage (import ./mealie-frontend.nix src version) { }; |
@@ -54,6 +55,11 @@ pythonpkgs.buildPythonApplication rec { |
54 | 55 |
|
55 | 56 | pythonRelaxDeps = true; |
56 | 57 |
|
| 58 | + patches = [ |
| 59 | + # compatiblity with openai 1.63.0 |
| 60 | + ./0000_openai_1.63.0.patch |
| 61 | + ]; |
| 62 | + |
57 | 63 | dependencies = with pythonpkgs; [ |
58 | 64 | aiofiles |
59 | 65 | alembic |
@@ -96,42 +102,32 @@ pythonpkgs.buildPythonApplication rec { |
96 | 102 |
|
97 | 103 | substituteInPlace mealie/__init__.py \ |
98 | 104 | --replace-fail '__version__ = ' '__version__ = "v${version}" #' |
99 | | -
|
100 | | - substituteInPlace mealie/services/backups_v2/alchemy_exporter.py \ |
101 | | - --replace-fail 'PROJECT_DIR = ' "PROJECT_DIR = Path('$out') #" |
102 | | -
|
103 | | - substituteInPlace mealie/db/init_db.py \ |
104 | | - --replace-fail 'PROJECT_DIR = ' "PROJECT_DIR = Path('$out') #" |
105 | | -
|
106 | | - substituteInPlace mealie/services/backups_v2/alchemy_exporter.py \ |
107 | | - --replace-fail '"script_location", path.join(PROJECT_DIR, "alembic")' '"script_location", "${src}/alembic"' |
108 | 105 | ''; |
109 | 106 |
|
110 | | - postInstall = let |
111 | | - start_script = writeShellScript "start-mealie" '' |
112 | | - ${lib.getExe pythonpkgs.gunicorn} "$@" -k uvicorn.workers.UvicornWorker mealie.app:app; |
113 | | - ''; |
114 | | - init_db = writeShellScript "init-mealie-db" '' |
115 | | - ${python.interpreter} $OUT/${python.sitePackages}/mealie/scripts/install_model.py |
116 | | - ${python.interpreter} $OUT/${python.sitePackages}/mealie/db/init_db.py |
| 107 | + postInstall = |
| 108 | + let |
| 109 | + start_script = writeShellScript "start-mealie" '' |
| 110 | + ${lib.getExe pythonpkgs.gunicorn} "$@" -k uvicorn.workers.UvicornWorker mealie.app:app; |
| 111 | + ''; |
| 112 | + init_db = writeShellScript "init-mealie-db" '' |
| 113 | + ${python.interpreter} $OUT/${python.sitePackages}/mealie/scripts/install_model.py |
| 114 | + ${python.interpreter} $OUT/${python.sitePackages}/mealie/db/init_db.py |
| 115 | + ''; |
| 116 | + in |
| 117 | + '' |
| 118 | + mkdir -p $out/bin $out/libexec |
| 119 | + rm -f $out/bin/* |
| 120 | +
|
| 121 | + makeWrapper ${start_script} $out/bin/mealie \ |
| 122 | + --set PYTHONPATH "$out/${python.sitePackages}:${pythonpkgs.makePythonPath dependencies}" \ |
| 123 | + --set LD_LIBRARY_PATH "${crfpp}/lib" \ |
| 124 | + --set STATIC_FILES "${frontend}" \ |
| 125 | + --set PATH "${lib.makeBinPath [ crfpp ]}" |
| 126 | +
|
| 127 | + makeWrapper ${init_db} $out/libexec/init_db \ |
| 128 | + --set PYTHONPATH "$out/${python.sitePackages}:${pythonpkgs.makePythonPath dependencies}" \ |
| 129 | + --set OUT "$out" |
117 | 130 | ''; |
118 | | - in '' |
119 | | - mkdir -p $out/bin $out/libexec |
120 | | - rm -f $out/bin/* |
121 | | -
|
122 | | - substitute ${src}/alembic.ini $out/alembic.ini \ |
123 | | - --replace-fail 'script_location = alembic' 'script_location = ${src}/alembic' |
124 | | -
|
125 | | - makeWrapper ${start_script} $out/bin/mealie \ |
126 | | - --set PYTHONPATH "$out/${python.sitePackages}:${pythonpkgs.makePythonPath dependencies}" \ |
127 | | - --set LD_LIBRARY_PATH "${crfpp}/lib" \ |
128 | | - --set STATIC_FILES "${frontend}" \ |
129 | | - --set PATH "${lib.makeBinPath [ crfpp ]}" |
130 | | -
|
131 | | - makeWrapper ${init_db} $out/libexec/init_db \ |
132 | | - --set PYTHONPATH "$out/${python.sitePackages}:${pythonpkgs.makePythonPath dependencies}" \ |
133 | | - --set OUT "$out" |
134 | | - ''; |
135 | 131 |
|
136 | 132 | nativeCheckInputs = with pythonpkgs; [ pytestCheckHook ]; |
137 | 133 |
|
@@ -160,7 +156,10 @@ pythonpkgs.buildPythonApplication rec { |
160 | 156 | homepage = "https://mealie.io"; |
161 | 157 | changelog = "https://github.com/mealie-recipes/mealie/releases/tag/${src.rev}"; |
162 | 158 | license = licenses.agpl3Only; |
163 | | - maintainers = with maintainers; [ litchipi anoa ]; |
| 159 | + maintainers = with maintainers; [ |
| 160 | + litchipi |
| 161 | + anoa |
| 162 | + ]; |
164 | 163 | mainProgram = "mealie"; |
165 | 164 | }; |
166 | 165 | } |
0 commit comments