Skip to content

Commit

Permalink
odoo17: init
Browse files Browse the repository at this point in the history
Signed-off-by: phanirithvij <phanirithvij2000@gmail.com>
  • Loading branch information
phanirithvij committed Oct 23, 2024
1 parent 90f8329 commit 4b7c3e6
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ in {
pyload = handleTest ./pyload.nix {};
oci-containers = handleTestOn ["aarch64-linux" "x86_64-linux"] ./oci-containers.nix {};
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
Expand Down
121 changes: 121 additions & 0 deletions pkgs/by-name/od/odoo17/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
lib,
fetchgit,
fetchzip,
python310,
rtlcss,
wkhtmltopdf,
nixosTests,
}:

let
odoo_version = "17.0";
odoo_release = "20241010";
python = python310.override {
self = python;
packageOverrides = final: prev: {
# requirements.txt fixes docutils at 0.17; the default 0.21.1 tested throws exceptions
docutils-0_17 = prev.docutils.overridePythonAttrs (old: rec {
version = "0.17";
src = fetchgit {
url = "git://repo.or.cz/docutils.git";
rev = "docutils-${version}";
hash = "sha256-O/9q/Dg1DBIxKdNBOhDV16yy5ez0QANJYMjeovDoWX8=";
};
buildInputs = with prev; [ setuptools ];
});
};
};
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/17.0/Dockerfile
src = fetchzip {
url = "https://nightly.odoo.com/${odoo_version}/nightly/src/odoo_${version}.zip";
name = "odoo-${version}";
hash = "sha256-s4Fvzjwl2oM0V9G1WQdSoqo7kE7b8tJdluk9f7A06e8="; # odoo
};

makeWrapperArgs = [
"--prefix"
"PATH"
":"
"${lib.makeBinPath [
wkhtmltopdf
rtlcss
]}"
];

propagatedBuildInputs = with python.pkgs; [
babel
chardet
cryptography
decorator
docutils-0_17 # sphinx has a docutils requirement >= 18
ebaysdk
freezegun
geoip2
gevent
greenlet
idna
jinja2
libsass
lxml
lxml-html-clean
markupsafe
num2words
ofxparse
passlib
pillow
polib
psutil
psycopg2
pydot
pyopenssl
pypdf2
pyserial
python-dateutil
python-ldap
python-stdnum
pytz
pyusb
qrcode
reportlab
requests
rjsmin
urllib3
vobject
werkzeug
xlrd
xlsxwriter
xlwt
zeep

setuptools
mock
];

# takes 5+ minutes and there are not files to strip
dontStrip = true;

passthru = {
updateScript = ./update.sh;
tests = {
inherit (nixosTests) odoo;
};
};

meta = with lib; {
description = "Open Source ERP and CRM";
homepage = "https://www.odoo.com/";
license = licenses.lgpl3Only;
maintainers = with maintainers; [
mkg20001
siriobalmelli
];
};
}

0 comments on commit 4b7c3e6

Please sign in to comment.