Skip to content

Commit eb23e1a

Browse files
authored
mealie: 2.3.0 -> 2.6.0 (NixOS#382604)
2 parents 2234999 + 1feaad0 commit eb23e1a

File tree

2 files changed

+57
-45
lines changed

2 files changed

+57
-45
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/mealie/services/openai/openai.py b/mealie/services/openai/openai.py
2+
index 09c391d5..5d74d930 100644
3+
--- a/mealie/services/openai/openai.py
4+
+++ b/mealie/services/openai/openai.py
5+
@@ -7,7 +7,7 @@ from pathlib import Path
6+
from textwrap import dedent
7+
8+
from openai import NOT_GIVEN, AsyncOpenAI
9+
-from openai.resources.chat.completions import ChatCompletion
10+
+from openai.types.chat import ChatCompletion
11+
from pydantic import BaseModel, field_validator
12+
13+
from mealie.core.config import get_app_settings

pkgs/by-name/me/mealie/package.nix

Lines changed: 44 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
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,
910
}:
1011

1112
let
12-
version = "2.3.0";
13+
version = "2.6.0";
1314
src = fetchFromGitHub {
1415
owner = "mealie-recipes";
1516
repo = "mealie";
16-
rev = "v${version}";
17-
hash = "sha256-GN+uXyZCvDuFmQnXhn0mFans3bvvEw7Uq6V0OeCPEbE=";
17+
tag = "v${version}";
18+
hash = "sha256-txkHCQ/xTakPXXFki161jNOKwAH9p9z1hCNEEkbqQtM=";
1819
};
1920

2021
frontend = callPackage (import ./mealie-frontend.nix src version) { };
@@ -54,6 +55,11 @@ pythonpkgs.buildPythonApplication rec {
5455

5556
pythonRelaxDeps = true;
5657

58+
patches = [
59+
# compatiblity with openai 1.63.0
60+
./0000_openai_1.63.0.patch
61+
];
62+
5763
dependencies = with pythonpkgs; [
5864
aiofiles
5965
alembic
@@ -96,42 +102,32 @@ pythonpkgs.buildPythonApplication rec {
96102
97103
substituteInPlace mealie/__init__.py \
98104
--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"'
108105
'';
109106

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"
117130
'';
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-
'';
135131

136132
nativeCheckInputs = with pythonpkgs; [ pytestCheckHook ];
137133

@@ -160,7 +156,10 @@ pythonpkgs.buildPythonApplication rec {
160156
homepage = "https://mealie.io";
161157
changelog = "https://github.com/mealie-recipes/mealie/releases/tag/${src.rev}";
162158
license = licenses.agpl3Only;
163-
maintainers = with maintainers; [ litchipi anoa ];
159+
maintainers = with maintainers; [
160+
litchipi
161+
anoa
162+
];
164163
mainProgram = "mealie";
165164
};
166165
}

0 commit comments

Comments
 (0)