forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request NixOS#312060 from siriobalmelli/fix/odoo
odoo: fix odoo16; add odoo17
- Loading branch information
Showing
9 changed files
with
154 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
{ stdenv | ||
, lib | ||
, fetchgit | ||
, fetchzip | ||
, python310 | ||
, rtlcss | ||
, wkhtmltopdf | ||
, nixosTests | ||
, odoo_version ? "17.0" | ||
, odoo_release ? "20240610" | ||
}: | ||
|
||
let | ||
python = python310.override { | ||
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:https://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"; | ||
|
||
src = fetchzip { | ||
# 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 = "${pname}-${version}"; | ||
hash = "sha256-blibGJyaz+MxMazOXhPbGBAJWZoGubirwSnjVYyLBJs="; # odoo | ||
}; | ||
|
||
# needs some investigation | ||
doCheck = false; | ||
|
||
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 | ||
gevent | ||
greenlet | ||
idna | ||
jinja2 | ||
libsass | ||
lxml | ||
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 ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell -i bash -p curl gnused nix coreutils nix-prefetch | ||
|
||
set -euo pipefail | ||
|
||
VERSION="17.0" # must be incremented manually | ||
|
||
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 ./. {}; odoo.version or (lib.getVersion odoo)" | tr -d '"') | ||
|
||
if [[ "$currentVersion" == "$latestVersion" ]]; then | ||
echo "odoo is up-to-date: $currentVersion" | ||
exit 0 | ||
fi | ||
|
||
cd "$(dirname "${BASH_SOURCE[0]}")" | ||
|
||
sed -ri "s| hash.+ # odoo| hash = \"$(nix-prefetch -q fetchzip --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 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters