2022-08-14 14:03:42 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, nixosTests, stateDir ? "/var/lib/dolibarr" }:
|
2022-08-14 14:02:46 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "dolibarr";
|
2022-12-01 05:43:59 +00:00
|
|
|
version = "16.0.3";
|
2022-08-14 14:02:46 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Dolibarr";
|
|
|
|
repo = "dolibarr";
|
|
|
|
rev = version;
|
2022-12-01 05:43:59 +00:00
|
|
|
sha256 = "sha256-Zkjmm2DAaAGQc1IigMYDpE5b+YaYU8oFMHZSqBEBsRw=";
|
2022-08-14 14:02:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
find . -type f -name "*.php" -print0 | xargs -0 sed -i 's|/etc/dolibarr|${stateDir}|g'
|
|
|
|
|
|
|
|
substituteInPlace htdocs/filefunc.inc.php \
|
|
|
|
--replace '//$conffile = ' '$conffile = ' \
|
|
|
|
--replace '//$conffiletoshow = ' '$conffiletoshow = '
|
|
|
|
|
|
|
|
substituteInPlace htdocs/install/inc.php \
|
|
|
|
--replace '//$conffile = ' '$conffile = ' \
|
|
|
|
--replace '//$conffiletoshow = ' '$conffiletoshow = '
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out"
|
|
|
|
cp -r * $out
|
|
|
|
'';
|
|
|
|
|
2022-08-14 14:03:42 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) dolibarr; };
|
|
|
|
|
2022-08-14 14:02:46 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A enterprise resource planning (ERP) and customer relationship manager (CRM) server";
|
|
|
|
homepage = "https://dolibarr.org/";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = [ maintainers.raitobezarius ];
|
|
|
|
};
|
|
|
|
}
|