2023-05-20 21:36:21 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchYarnDeps
|
|
|
|
, mkYarnPackage
|
|
|
|
|
|
|
|
, taxjar
|
|
|
|
, gocardless-pro
|
|
|
|
, plaid-python
|
|
|
|
, unidecode
|
|
|
|
, pycountry
|
|
|
|
, python-youtube
|
|
|
|
, tweepy
|
|
|
|
, redisearch
|
|
|
|
, googlemaps
|
|
|
|
, python-stdnum
|
|
|
|
, frappe
|
2023-05-18 13:57:22 +00:00
|
|
|
}:
|
2023-05-20 21:36:21 +00:00
|
|
|
let
|
|
|
|
frappe-version = "14.36.1";
|
|
|
|
erpnext-version = "14.24.3";
|
|
|
|
in
|
2023-05-18 13:57:22 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "erpnext";
|
2023-05-20 21:36:21 +00:00
|
|
|
version = erpnext-version;
|
2023-05-18 15:49:23 +00:00
|
|
|
format = "flit";
|
2023-05-18 13:57:22 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "frappe";
|
|
|
|
repo = pname;
|
2023-05-20 21:36:21 +00:00
|
|
|
rev = "v${erpnext-version}";
|
|
|
|
sha256 = "sha256-zovdbpTp9fTpY7kAs4J8EiPh+EjqUOtVUk+rDYMfYDk=";
|
2023-05-18 13:57:22 +00:00
|
|
|
};
|
2023-05-21 15:51:45 +00:00
|
|
|
propagatedBuildInputs = [
|
2023-05-18 13:57:22 +00:00
|
|
|
taxjar
|
|
|
|
gocardless-pro
|
|
|
|
plaid-python
|
|
|
|
unidecode
|
|
|
|
pycountry
|
|
|
|
python-youtube
|
|
|
|
tweepy
|
|
|
|
redisearch
|
|
|
|
googlemaps
|
|
|
|
python-stdnum
|
|
|
|
frappe
|
|
|
|
];
|
2023-05-20 21:36:21 +00:00
|
|
|
|
|
|
|
frappe-assets = mkYarnPackage {
|
|
|
|
pname = "frappe-assets";
|
|
|
|
version = frappe-version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "frappe";
|
|
|
|
repo = "frappe";
|
|
|
|
rev = "v${frappe-version}";
|
|
|
|
hash = "sha256-eee6IS/Ep/DSDCPdnyrqBea/ag0kNnN5Id3YQMNz5js=";
|
|
|
|
};
|
|
|
|
|
|
|
|
packageJSON = ../frappe-package.json;
|
|
|
|
yarnFlags = [ "--production" ];
|
|
|
|
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
|
|
yarnLock = src + "/yarn.lock";
|
|
|
|
hash = "sha256-PBdMUz9gJIoQaqQYbdk+xnd8CyZPmdeyz/9WznCb4Ss=";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
# Yarn writes cache directories etc to $HOME.
|
|
|
|
export HOME=$PWD/yarn_home
|
|
|
|
|
|
|
|
# The upstream build script reads sites/apps.txt to define what assets to build
|
|
|
|
# A list of assets is written to sites/assets/assets.json
|
|
|
|
mkdir -p apps sites/assets
|
|
|
|
echo -e "erpnext\nfrappe\n" > sites/apps.txt
|
|
|
|
cp -r ${src} apps/erpnext
|
|
|
|
chmod u+rw apps/erpnext
|
|
|
|
cp -r ${erpnext-modules}/node_modules apps/erpnext/node_modules
|
|
|
|
chmod u+rw apps/erpnext
|
|
|
|
#ln -s ${frappe-assets.src} apps/frappe
|
|
|
|
|
|
|
|
yarn --offline production
|
|
|
|
mv sites deps/
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Do not attempt generating a tarball
|
|
|
|
doDist = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Assets for frappe";
|
|
|
|
homepage = "https://github.com/frappe/frappe";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ axeman teutat3s ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
erpnext-modules = mkYarnPackage {
|
|
|
|
pname = "erpnext-modules";
|
|
|
|
version = erpnext-version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "frappe";
|
|
|
|
repo = "erpnext";
|
|
|
|
rev = "v${erpnext-version}";
|
|
|
|
hash = "sha256-zovdbpTp9fTpY7kAs4J8EiPh+EjqUOtVUk+rDYMfYDk=";
|
|
|
|
};
|
|
|
|
|
|
|
|
packageJSON = ../erpnext-package.json;
|
|
|
|
yarnFlags = [ "--production" ];
|
|
|
|
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
|
|
yarnLock = ../erpnext-yarn.lock;
|
|
|
|
hash = "sha256-Vho4BSbxcsVYExLvUaeoc3xIpbXoCUP/4jw4RwGnWGY=";
|
|
|
|
};
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
ln -s $node_modules node_modules
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
ls -alh
|
|
|
|
mkdir $out
|
|
|
|
cp -r node_modules $out/
|
|
|
|
ls -alh $out/
|
|
|
|
'';
|
|
|
|
|
|
|
|
# We only need node_modules
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
# Do not attempt generating a tarball
|
|
|
|
doDist = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Node modules for erpnext";
|
|
|
|
homepage = "https://github.com/frappe/erpnext";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ axeman teutat3s ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/test/frappe $out/test/erpnext
|
|
|
|
ln -s ${frappe-assets} $out/test/frappe
|
|
|
|
ln -s ${erpnext-modules} $out/test/erpnext
|
|
|
|
'';
|
2023-05-18 13:57:22 +00:00
|
|
|
}
|