depot/third_party/nixpkgs/pkgs/servers/web-apps/engelsystem/default.nix
Default email d5f4a57cbf Project import generated by Copybara.
GitOrigin-RevId: ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e
2023-08-10 09:59:29 +02:00

51 lines
1.5 KiB
Nix

{ lib, stdenv, fetchzip, php, writeText, nixosTests }:
let
phpExt = php.withExtensions
({ enabled, all }: with all; [ filter mysqlnd mysqli pdo pdo_mysql ]);
in
stdenv.mkDerivation rec {
pname = "engelsystem";
version = "3.3.0";
src = fetchzip {
url = "https://github.com/engelsystem/engelsystem/releases/download/v${version}/engelsystem-v${version}.zip";
hash = "sha256-DS0klm26udXsiiFToeOJooA1WUR8gk0qf/UJL8E77ps=";
};
buildInputs = [ phpExt ];
installPhase = ''
runHook preInstall
# prepare
rm -r ./storage/
ln -sf /etc/engelsystem/config.php ./config/config.php
ln -sf /var/lib/engelsystem/storage/ ./storage
mkdir -p $out/share/engelsystem
mkdir -p $out/bin
cp -r . $out/share/engelsystem
echo $(command -v php)
# The patchShebangAuto function always used the php without extensions, so path the shebang manually
sed -i -e "1 s|.*|#\!${phpExt}/bin/php|" "$out/share/engelsystem/bin/migrate"
ln -s "$out/share/engelsystem/bin/migrate" "$out/bin/migrate"
runHook postInstall
'';
passthru.tests = nixosTests.engelsystem;
meta = with lib; {
description =
"Coordinate your volunteers in teams, assign them to work shifts or let them decide for themselves when and where they want to help with what";
homepage = "https://engelsystem.de";
changelog = "https://github.com/engelsystem/engelsystem/releases/tag/v${version}";
license = licenses.gpl2;
maintainers = with maintainers; [ kloenk ];
mainProgram = "migrate";
platforms = platforms.all;
};
}