mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 08:53:21 +00:00
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:
parent
a972071a31
commit
8306ac3d7e
@ -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
|
@ -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
26
pkgs/by-name/od/odoo/update.sh
Executable 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
|
@ -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 { };
|
||||
|
Loading…
Reference in New Issue
Block a user