nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchzip,
4 stdenv,
5 php,
6 phpCfg ? null,
7 withMariaDB ? false,
8 withPostgreSQL ? true,
9}:
10
11assert lib.assertMsg (
12 withPostgreSQL || withMariaDB
13) "At least one Flyspray database driver required";
14
15# The src tarball has the dependencies vendored. Considering that there is
16# no composer.lock, the easier option is using stdenv.mkDerivation over
17# php.buildComposerProject2 + building from source.
18stdenv.mkDerivation (finalAttrs: {
19 pname = "flyspray";
20 version = "1.0-rc11";
21
22 src = fetchzip {
23 url = "https://github.com/flyspray/flyspray/releases/download/v${finalAttrs.version}/flyspray-${finalAttrs.version}.tgz";
24 hash = "sha256-VNukYtHqf1OqWoyR+GXxgoX2GjTD4RfJ0SaGoDyHLJ4=";
25 };
26
27 php =
28 php.buildEnv {
29 # https://www.flyspray.org/docs/requirements/
30 extensions = (
31 { all, enabled }:
32 enabled
33 ++ [
34 all.gd
35 all.pdo
36 all.xml
37 ]
38 ++ lib.optionals withPostgreSQL [
39 all.pdo_pgsql
40 all.pgsql
41 ]
42 ++ lib.optionals withMariaDB [
43 all.mysqli
44 all.mysqlnd
45 all.pdo_mysql
46 ]
47 );
48 }
49 // lib.optionalAttrs (phpCfg != null) {
50 extraConfig = phpCfg;
51 };
52
53 postInstall = ''
54 DIR="$out/share/php/flyspray"
55 mkdir -p "$DIR"
56 cp -Tr "$src" "$DIR"
57 '';
58
59 meta = {
60 description = "Lightweight, web-based bug tracking system written in PHP for assisting with software development and project managements";
61 homepage = "https://www.flyspray.org";
62 license = lib.licenses.lgpl21;
63 maintainers = with lib.maintainers; [ toastal ];
64 };
65})