summaryrefslogtreecommitdiff
path: root/pkgs/crs-tools.nix
blob: 07032b80919d84b758fdac155998f07e447a328a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ stdenv, lib, fetchFromGitHub, system, ... }:

let
  # we need php < 8; some of the tracker's code is kinda deprecated
  nixpkgs = fetchFromGitHub {
    owner = "NixOS";
    repo = "nixpkgs";
    rev = "21.05";
    sha256 = "sha256-ZjBd81a6J3TwtlBr3rHsZspYUwT9OdhDk+a/SgSEf7I=";
  };
in

rec {
  php = (import nixpkgs { inherit system; }).php73.withExtensions
    (e: with e.all; e.enabled ++ [curl intl mbstring openssl xsl apcu]);

  tracker = stdenv.mkDerivation {
    pname = "crs-tracker";
    version = "yolo";

    src = fetchFromGitHub {
      owner = "crs-tools";
      repo = "tracker";
      rev = "7763c665522c7c027ed7f70cba00d7eef47b0644";
      sha256 = "sha256-MA04yiDLquKmiJ/6kUXigFPt7JtNB7/HI9SA60bRhH0=";
      fetchSubmodules = true;
    };

    patches = [
      ./patches/crs-tools-add-lockfile.patch
    ];

    buildInputs = [ php php.packages.composer ];

    buildPhase = ''
      composer install --ignore-platform-req=ext-xdiff --ignore-platform-req=ext-xmlrpc
    '';

    installPhase = ''
      mkdir -p $out
      cp -r * $out
    '';
  };
}