odoo: migrate to pkgs/by-name

Remove original 'pkgs/applications/finance/odoo' directory.

Update 'pkgs/applications/finance/odoo/update.sh'
to point to the nightly builds archive for odoo, ignoring Docker.

Signed-off-by: Sirio Balmelli <sirio@b-ad.ch>
This commit is contained in:
Sirio Balmelli 2024-06-19 13:35:21 +00:00
parent a972071a31
commit 8306ac3d7e
No known key found for this signature in database
GPG Key ID: 0437A96EFE4C426E
6 changed files with 27 additions and 31 deletions

View File

@ -1,27 +0,0 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnused nix coreutils nix-prefetch
set -euo pipefail
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"
}
VERSION=$(get_var VERSION)
RELEASE=$(get_var RELEASE)
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" default.nix
sed -ri "s| odoo_version.+| odoo_version = \"$VERSION\";|" default.nix
sed -ri "s| odoo_release.+| odoo_release = \"$RELEASE\";|" default.nix

View File

@ -32,6 +32,7 @@ in python.pkgs.buildPythonApplication rec {
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-WdJBs1YgJhHmD+ip6UU2pwXrcZCsbjgOGjrZTRFQBFw="; # odoo

26
pkgs/by-name/od/odoo/update.sh Executable file
View File

@ -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

View File

@ -5968,10 +5968,6 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) AppKit Security;
};
odoo = callPackage ../applications/finance/odoo { };
odoo16 = callPackage ../applications/finance/odoo/odoo16.nix { };
odoo15 = callPackage ../applications/finance/odoo/odoo15.nix { };
odafileconverter = libsForQt5.callPackage ../applications/graphics/odafileconverter { };
oil-buku = callPackage ../applications/misc/oil-buku { };