diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 06213b9ce7c6..b5c46f2fb16a 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -619,7 +619,6 @@ in odoo = handleTest ./odoo.nix { }; odoo17 = handleTest ./odoo.nix { package = pkgs.odoo17; }; odoo16 = handleTest ./odoo.nix { package = pkgs.odoo16; }; - odoo15 = handleTest ./odoo.nix { package = pkgs.odoo15; }; # 9pnet_virtio used to mount /nix partition doesn't support # hibernation. This test happens to work on x86_64-linux but # not on other platforms. diff --git a/pkgs/by-name/od/odoo/package.nix b/pkgs/by-name/od/odoo/package.nix index 254459e62081..ceef961f1fd8 100644 --- a/pkgs/by-name/od/odoo/package.nix +++ b/pkgs/by-name/od/odoo/package.nix @@ -9,7 +9,7 @@ let odoo_version = "18.0"; - odoo_release = "20250213"; + odoo_release = "20250506"; python = python312.override { self = python; }; @@ -24,7 +24,7 @@ python.pkgs.buildPythonApplication rec { # find latest version on https://nightly.odoo.com/${odoo_version}/nightly/src url = "https://nightly.odoo.com/${odoo_version}/nightly/src/odoo_${version}.zip"; name = "odoo-${version}"; - hash = "sha256-iohlJ5OQ10iUaWjC4AFYmBwXuf9OOXAdCgdhdJAchYQ="; # odoo + hash = "sha256-rNG0He+51DnRT5g1SovGZ9uiE1HWXtcmAybcadBMjY4="; # odoo }; makeWrapperArgs = [ @@ -97,11 +97,11 @@ python.pkgs.buildPythonApplication rec { }; }; - meta = with lib; { + meta = { description = "Open Source ERP and CRM"; homepage = "https://www.odoo.com/"; - license = licenses.lgpl3Only; - maintainers = with maintainers; [ + license = lib.licenses.lgpl3Only; + maintainers = with lib.maintainers; [ mkg20001 siriobalmelli ]; diff --git a/pkgs/by-name/od/odoo15/package.nix b/pkgs/by-name/od/odoo15/package.nix deleted file mode 100644 index c149bf1ee2bb..000000000000 --- a/pkgs/by-name/od/odoo15/package.nix +++ /dev/null @@ -1,119 +0,0 @@ -{ - lib, - fetchFromGitHub, - fetchzip, - python310, - rtlcss, - wkhtmltopdf, - nixosTests, -}: - -let - odoo_version = "15.0"; - odoo_release = "20241010"; - python = python310.override { - self = python; - packageOverrides = self: super: { - pypdf2 = super.pypdf2.overridePythonAttrs (old: rec { - version = "1.28.6"; - - src = fetchFromGitHub { - owner = "py-pdf"; - repo = "pypdf"; - rev = version; - fetchSubmodules = true; - hash = "sha256-WnRbsy/PJcotZqY9mJPLadrYqkXykOVifLIbDyNf4s4="; - }; - - dependencies = [ self.setuptools ]; - - nativeCheckInputs = with self; [ - pytestCheckHook - pillow - ]; - }); - }; - }; -in -python.pkgs.buildPythonApplication rec { - pname = "odoo"; - version = "${odoo_version}.${odoo_release}"; - - format = "setuptools"; - - # latest release is at https://github.com/odoo/docker/blob/5fb6a842747c296099d9384587cd89640eb7a615/15.0/Dockerfile#L58 - src = fetchzip { - url = "https://nightly.odoo.com/${odoo_version}/nightly/src/odoo_${version}.zip"; - name = "odoo-${version}"; - hash = "sha256-Hkre6mghEiLrDwfB1BxGbqEm/zruHLwaS+eIFQKjl1o="; # odoo - }; - - makeWrapperArgs = [ - "--prefix" - "PATH" - ":" - "${lib.makeBinPath [ - wkhtmltopdf - rtlcss - ]}" - ]; - - propagatedBuildInputs = with python.pkgs; [ - babel - chardet - decorator - docutils - ebaysdk - freezegun - gevent - greenlet - idna - jinja2 - libsass - lxml - lxml-html-clean - markupsafe - mock - num2words - ofxparse - passlib - pillow - polib - psutil - psycopg2 - pydot - pyopenssl - pypdf2 - pyserial - python-dateutil - python-ldap - python-stdnum - pytz - pyusb - qrcode - reportlab - requests - setuptools - vobject - werkzeug - xlrd - xlsxwriter - xlwt - zeep - ]; - - # takes 5+ minutes and there are not files to strip - dontStrip = true; - - passthru = { - updateScript = ./update.sh; - tests = { inherit (nixosTests) odoo15; }; - }; - - meta = with lib; { - description = "Open Source ERP and CRM"; - homepage = "https://www.odoo.com/"; - license = licenses.lgpl3Only; - maintainers = with maintainers; [ mkg20001 ]; - }; -} diff --git a/pkgs/by-name/od/odoo15/update.sh b/pkgs/by-name/od/odoo15/update.sh deleted file mode 100755 index 2265f9048c0e..000000000000 --- a/pkgs/by-name/od/odoo15/update.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -p curl gnused nix coreutils nix-prefetch -# shellcheck shell=bash - -set -euo pipefail - -SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")" -PKG=$(basename "$SCRIPT_DIR") - -LATEST="18" # increment manually -VERSION="${PKG/#odoo}" -VERSION="${VERSION:-$LATEST}.0" - -RELEASE="$( - curl "https://nightly.odoo.com/$VERSION/nightly/src/" | - sed -nE 's/.*odoo_'"$VERSION"'.(20[0-9]{6}).tar.gz.*/\1/p' | - tail -n 1 -)" - -latestVersion="$VERSION.$RELEASE" -currentVersion=$(nix-instantiate --eval -E "with import ./. {}; $PKG.version or (lib.getVersion $PKG)" | tr -d '"') - -if [[ "$currentVersion" == "$latestVersion" ]]; then - echo "$PKG is up-to-date: $currentVersion" - exit 0 -fi - -cd "$SCRIPT_DIR" - -sed -ri "s| hash.+ # odoo| hash = \"$(nix-prefetch -q fetchzip --option extra-experimental-features flakes --url "https://nightly.odoo.com/${VERSION}/nightly/src/odoo_${latestVersion}.zip")\"; # odoo|g" package.nix -sed -ri "s|odoo_version = .+|odoo_version = \"$VERSION\";|" package.nix -sed -ri "s|odoo_release = .+|odoo_release = \"$RELEASE\";|" package.nix diff --git a/pkgs/by-name/od/odoo16/fix-test.patch b/pkgs/by-name/od/odoo16/fix-test.patch new file mode 100644 index 000000000000..232590c87c30 --- /dev/null +++ b/pkgs/by-name/od/odoo16/fix-test.patch @@ -0,0 +1,22 @@ +diff --git a/odoo/http.py b/odoo/http.py +index f26dd52db235c..9689fc894b2b1 100644 +--- a/odoo/http.py ++++ b/odoo/http.py +@@ -117,6 +117,7 @@ + import glob + import hashlib + import hmac ++import importlib.metadata + import inspect + import json + import logging +@@ -256,7 +257,7 @@ def get_default_session(): + 'alias', 'host', 'methods', + } + +-if parse_version(werkzeug.__version__) >= parse_version('2.0.2'): ++if parse_version(importlib.metadata.version('werkzeug')) >= parse_version('2.0.2'): + # Werkzeug 2.0.2 adds the websocket option. If a websocket request + # (ws/wss) is trying to access an HTTP route, a WebsocketMismatch + # exception is raised. On the other hand, Werkzeug 0.16 does not + diff --git a/pkgs/by-name/od/odoo16/package.nix b/pkgs/by-name/od/odoo16/package.nix index 73791dbcfcf1..6e95a6909def 100644 --- a/pkgs/by-name/od/odoo16/package.nix +++ b/pkgs/by-name/od/odoo16/package.nix @@ -1,7 +1,7 @@ { lib, fetchzip, - python310, + python311, rtlcss, wkhtmltopdf, nixosTests, @@ -9,8 +9,8 @@ let odoo_version = "16.0"; - odoo_release = "20241010"; - python = python310.override { + odoo_release = "20250506"; + python = python311.override { self = python; }; in @@ -24,9 +24,11 @@ python.pkgs.buildPythonApplication rec { src = fetchzip { url = "https://nightly.odoo.com/${odoo_version}/nightly/src/odoo_${version}.zip"; name = "odoo-${version}"; - hash = "sha256-ICe5UOy+Ga81fE66SnIhRz3+JEEbGfoz7ag53mkG4UM="; # odoo + hash = "sha256-dBqRZ3cf4/udP9hm+u9zhuUCkH176uG2NPAy5sujyNc="; # odoo }; + patches = [ ./fix-test.patch ]; + makeWrapperArgs = [ "--prefix" "PATH" @@ -90,14 +92,14 @@ python.pkgs.buildPythonApplication rec { passthru = { updateScript = ./update.sh; tests = { - inherit (nixosTests) odoo; + inherit (nixosTests) odoo16; }; }; - meta = with lib; { + meta = { description = "Open Source ERP and CRM"; homepage = "https://www.odoo.com/"; - license = licenses.lgpl3Only; - maintainers = with maintainers; [ mkg20001 ]; + license = lib.licenses.lgpl3Only; + maintainers = with lib.maintainers; [ mkg20001 ]; }; } diff --git a/pkgs/by-name/od/odoo17/package.nix b/pkgs/by-name/od/odoo17/package.nix index 698afb37d103..ac5db5d4ff76 100644 --- a/pkgs/by-name/od/odoo17/package.nix +++ b/pkgs/by-name/od/odoo17/package.nix @@ -2,7 +2,8 @@ lib, fetchgit, fetchzip, - python310, + fetchpatch2, + python311, rtlcss, wkhtmltopdf, nixosTests, @@ -10,8 +11,8 @@ let odoo_version = "17.0"; - odoo_release = "20241010"; - python = python310.override { + odoo_release = "20250506"; + python = python311.override { self = python; packageOverrides = final: prev: { # requirements.txt fixes docutils at 0.17; the default 0.21.1 tested throws exceptions @@ -37,8 +38,14 @@ python.pkgs.buildPythonApplication rec { src = fetchzip { url = "https://nightly.odoo.com/${odoo_version}/nightly/src/odoo_${version}.zip"; name = "odoo-${version}"; - hash = "sha256-s4Fvzjwl2oM0V9G1WQdSoqo7kE7b8tJdluk9f7A06e8="; # odoo + hash = "sha256-V15Oe3AOBJ1agt5WmpFZnC7EkyoKyxTH8Iqdf2/9aec="; # odoo }; + patches = [ + (fetchpatch2 { + url = "https://github.com/odoo/odoo/commit/ade3200e8138a9c28eb9b294a4efd2753a8e5591.patch?full_index=1"; + hash = "sha256-EFKjrR38eg9bxlNmRNoLSXem+MjQKqPcR3/mSgs0cDs="; + }) + ]; makeWrapperArgs = [ "--prefix" @@ -105,15 +112,15 @@ python.pkgs.buildPythonApplication rec { passthru = { updateScript = ./update.sh; tests = { - inherit (nixosTests) odoo; + inherit (nixosTests) odoo17; }; }; - meta = with lib; { + meta = { description = "Open Source ERP and CRM"; homepage = "https://www.odoo.com/"; - license = licenses.lgpl3Only; - maintainers = with maintainers; [ + license = lib.licenses.lgpl3Only; + maintainers = with lib.maintainers; [ mkg20001 siriobalmelli ]; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 5e6ee7707b97..ca3b4c3a7efe 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1332,6 +1332,7 @@ mapAliases { oathToolkit = oath-toolkit; # Added 2022-04-04 oauth2_proxy = throw "'oauth2_proxy' has been renamed to/replaced by 'oauth2-proxy'"; # Converted to throw 2024-10-17 ocis-bin = throw "ocis-bin has been renamed to ocis_5-bin'. Future major.minor versions will be made available as separate packages"; # Added 2025-03-30 + odoo15 = throw "odoo15 has been removed from nixpkgs as it is unsupported; migrate to a newer version of odoo"; # Added 2025-05-06 oil = lib.warnOnInstantiate "Oil has been replaced with the faster native C++ version and renamed to 'oils-for-unix'. See also https://github.com/oils-for-unix/oils/wiki/Oils-Deployments" oils-for-unix; # Added 2024-10-22 onevpl-intel-gpu = lib.warnOnInstantiate "onevpl-intel-gpu has been renamed to vpl-gpu-rt" vpl-gpu-rt; # Added 2024-06-04 openai-whisper-cpp = whisper-cpp; # Added 2024-12-13