about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/finance/odoo
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/finance/odoo')
-rw-r--r--nixpkgs/pkgs/applications/finance/odoo/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/finance/odoo/odoo15.nix121
-rwxr-xr-xnixpkgs/pkgs/applications/finance/odoo/update.sh6
3 files changed, 133 insertions, 17 deletions
diff --git a/nixpkgs/pkgs/applications/finance/odoo/default.nix b/nixpkgs/pkgs/applications/finance/odoo/default.nix
index cfd181aa4d76..f00118fdf75a 100644
--- a/nixpkgs/pkgs/applications/finance/odoo/default.nix
+++ b/nixpkgs/pkgs/applications/finance/odoo/default.nix
@@ -1,9 +1,9 @@
 { stdenv
 , lib
 , fetchFromGitHub
-, fetchurl
+, fetchzip
 , python310
-, nodePackages
+, rtlcss
 , wkhtmltopdf
 , nixosTests
 }:
@@ -44,31 +44,26 @@ let
     };
   };
 
-  odoo_version = "15.0";
-  odoo_release = "20230317";
+  odoo_version = "16.0";
+  odoo_release = "20230722";
 in python.pkgs.buildPythonApplication rec {
   pname = "odoo";
   version = "${odoo_version}.${odoo_release}";
 
   format = "setuptools";
 
-  # latest release is at https://github.com/odoo/docker/blob/master/15.0/Dockerfile
-  src = fetchurl {
-    url = "https://nightly.odoo.com/${odoo_version}/nightly/src/odoo_${version}.tar.gz";
+  # latest release is at https://github.com/odoo/docker/blob/master/16.0/Dockerfile
+  src = fetchzip {
+    url = "https://nightly.odoo.com/${odoo_version}/nightly/src/odoo_${version}.zip";
     name = "${pname}-${version}";
-    hash = "sha256-nJEFPtZhq7DLLDCL9xt0RV75d/a45o6hBKsUlQAWh1U="; # odoo
+    hash = "sha256-pSycpYSiqJ6DKENvCWwLz+JaPUXT5dmaq8x4Aency60="; # odoo
   };
 
-  unpackPhase = ''
-    tar xfz $src
-    cd odoo*
-  '';
-
   # needs some investigation
   doCheck = false;
 
   makeWrapperArgs = [
-    "--prefix" "PATH" ":" "${lib.makeBinPath [ wkhtmltopdf nodePackages.rtlcss ]}"
+    "--prefix" "PATH" ":" "${lib.makeBinPath [ wkhtmltopdf rtlcss ]}"
   ];
 
   propagatedBuildInputs = with python.pkgs; [
diff --git a/nixpkgs/pkgs/applications/finance/odoo/odoo15.nix b/nixpkgs/pkgs/applications/finance/odoo/odoo15.nix
new file mode 100644
index 000000000000..a3255c4aa101
--- /dev/null
+++ b/nixpkgs/pkgs/applications/finance/odoo/odoo15.nix
@@ -0,0 +1,121 @@
+{ stdenv, lib, fetchFromGitHub, fetchzip, python310, rtlcss, wkhtmltopdf
+, nixosTests }:
+
+let
+  python = python310.override {
+    packageOverrides = self: super: {
+      pypdf2 = super.pypdf2.overridePythonAttrs (old: rec {
+        version = "1.28.6";
+        format = "setuptools";
+
+        src = fetchFromGitHub {
+          owner = "py-pdf";
+          repo = "pypdf";
+          rev = version;
+          fetchSubmodules = true;
+          hash = "sha256-WnRbsy/PJcotZqY9mJPLadrYqkXykOVifLIbDyNf4s4=";
+        };
+
+        nativeBuildInputs = [ ];
+
+        nativeCheckInputs = with self; [ pytestCheckHook pillow ];
+      });
+      flask = super.flask.overridePythonAttrs (old: rec {
+        version = "2.1.3";
+        src = old.src.override {
+          inherit version;
+          hash = "sha256-FZcuUBffBXXD1sCQuhaLbbkCWeYgrI1+qBOjlrrVtss=";
+        };
+      });
+      werkzeug = super.werkzeug.overridePythonAttrs (old: rec {
+        version = "2.1.2";
+        src = old.src.override {
+          inherit version;
+          hash = "sha256-HOCOgJPtZ9Y41jh5/Rujc1gX96gN42dNKT9ZhPJftuY=";
+        };
+      });
+    };
+  };
+
+  odoo_version = "15.0";
+  odoo_release = "20230816";
+in python.pkgs.buildPythonApplication rec {
+  pname = "odoo15";
+  version = "${odoo_version}.${odoo_release}";
+
+  format = "setuptools";
+
+  # latest release is at https://github.com/odoo/docker/blob/master/15.0/Dockerfile
+  src = fetchzip {
+    url = "https://nightly.odoo.com/${odoo_version}/nightly/src/odoo_${version}.zip";
+    name = "${pname}-${version}";
+    hash = "sha256-h81JA0o44DVtl/bZ52rGQfg54TigwQcNpcMjQbi0zIQ="; # odoo
+  };
+
+  # needs some investigation
+  doCheck = false;
+
+  makeWrapperArgs = [
+    "--prefix"
+    "PATH"
+    ":"
+    "${lib.makeBinPath [ wkhtmltopdf rtlcss ]}"
+  ];
+
+  propagatedBuildInputs = with python.pkgs; [
+    babel
+    chardet
+    decorator
+    docutils
+    ebaysdk
+    freezegun
+    gevent
+    greenlet
+    idna
+    jinja2
+    libsass
+    lxml
+    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 = {
+    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/nixpkgs/pkgs/applications/finance/odoo/update.sh b/nixpkgs/pkgs/applications/finance/odoo/update.sh
index 1bec751ae7e7..0f7ee144cf8a 100755
--- a/nixpkgs/pkgs/applications/finance/odoo/update.sh
+++ b/nixpkgs/pkgs/applications/finance/odoo/update.sh
@@ -1,9 +1,9 @@
 #!/usr/bin/env nix-shell
-#!nix-shell -i bash -p curl gnused nix coreutils
+#!nix-shell -i bash -p curl gnused nix coreutils nix-prefetch
 
 set -euo pipefail
 
-DOCKER=$(curl -s https://raw.githubusercontent.com/odoo/docker/master/15.0/Dockerfile)
+DOCKER=$(curl -s https://raw.githubusercontent.com/odoo/docker/master/16.0/Dockerfile)
 
 get_var() {
   echo "$DOCKER" | grep -E "^[A-Z][A-Z][A-Z] ODOO_$1" | sed -r "s|^[A-Z]{3} ODOO_$1.||g"
@@ -22,6 +22,6 @@ fi
 
 cd "$(dirname "${BASH_SOURCE[0]}")"
 
-sed -ri "s| hash.+ # odoo| hash = \"$(nix-prefetch-url --type sha256 "https://nightly.odoo.com/${VERSION}/nightly/src/odoo_${latestVersion}.tar.gz")\"; # odoo|g" default.nix
+sed -ri "s| hash.+ # odoo| hash = \"$(nix-prefetch -q fetchzip --url "https://nightly.odoo.com/${VERSION}/nightly/src/odoo_${latestVersion}.zip")\"; # odoo|g" default.nix
 sed -ri "s| odoo_version.+| odoo_version = \"$VERSION\";|" default.nix
 sed -ri "s| odoo_release.+| odoo_release = \"$RELEASE\";|" default.nix