biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / by-name / ad / adminerevo / package.nix
blob398d007671002e3f85c465a015ccc220bd32bf64
1 { lib
2 , pkgs
3 , stdenvNoCC
4 , fetchFromGitHub
5 , php
6 , nix-update-script
7 , theme ? null
8 , plugins ? []
9 }:
11 stdenvNoCC.mkDerivation (finalAttrs: {
12   version = "4.8.4";
13   pname = "adminerevo";
15   src = fetchFromGitHub {
16     owner = "adminerevo";
17     repo = "adminerevo";
18     rev = "v${finalAttrs.version}";
19     hash = "sha256-cyKSwzoVbS/0Fiv02kFIF4MTOqzpKSEFwwUwS4yqL6Q=";
20     fetchSubmodules = true;
21   };
23   nativeBuildInputs = [
24     php
25   ];
27   buildPhase = ''
28     runHook preBuild
30     php compile.php
32     runHook postBuild
33   '';
35   installPhase = ''
36     runHook preInstall
38     mkdir $out
39     cp adminer-${finalAttrs.version}.php $out/adminer.php
40     cp ${./index.php} $out/index.php
42     ${lib.optionalString (theme != null) ''
43       cp designs/${theme}/adminer.css $out/adminer.css
44     ''}
46     # Copy base plugin
47     mkdir -p $out/plugins
48     cp plugins/plugin.php $out/plugins/plugin.php
50     ${lib.optionalString (plugins != []) ''
51       cp plugins/*.php $out/plugins/
52       cp ${pkgs.writeText "$out/plugins.json" ''
53         ${toString (builtins.toJSON plugins)}
54       ''} $out/plugins.json
55     ''}
57     runHook postInstall
58   '';
60   passthru = {
61     updateScript = nix-update-script { };
62   };
64   meta = with lib; {
65     description = "Database management in a single PHP file";
66     homepage = "https://docs.adminerevo.org";
67     license = with licenses; [ asl20 gpl2Only ];
68     maintainers = with maintainers; [
69       shyim
70     ];
71     platforms = platforms.all;
72   };