btw i use nix
1{
2 pkgs ? import <nixpkgs> { },
3}:
4
5with pkgs;
6let
7 version = "24.1.24086.542";
8
9 installer = stdenv.mkDerivation rec {
10 name = "hmrc-paye-tools-installer";
11 inherit version;
12
13 src = fetchurl {
14 url = "https://www.gov.uk/government/uploads/uploaded/hmrc/payetools-rti-${version}-linux.zip";
15 hash = "sha256-QOW6Loqg001AcqWX/TOH6wvI2uAY4qNyFvQzCVEe8VU=";
16 };
17
18 dontUnpack = true;
19 dontFixup = true;
20
21 buildInputs = [ unzip ];
22
23 buildPhase = ''
24 mkdir -p $out/bin
25 unzip $src -d $out/bin
26 chmod +x $out/bin/*
27 '';
28 };
29
30 installerFHS = buildFHSEnv {
31 name = "hmrc-paye-tools-installer-fhs";
32 targetPkgs = pkgs: [ pkgs.glibc ];
33 runScript = "${installer}/bin/payetools-rti-${version}-linux";
34 };
35
36 package = stdenv.mkDerivation {
37 name = "hmrc-paye-tools";
38 inherit version;
39
40 dontUnpack = true;
41
42 buildPhase = ''
43 ${installerFHS}/bin/hmrc-paye-tools-installer-fhs --mode unattended --prefix prefix --check_for_updates 0
44 mv prefix $out
45 '';
46 };
47in
48buildFHSUserEnv {
49 name = "hmrc-paye-tools-fhs";
50
51 targetPkgs =
52 pkgs:
53 (with pkgs; [
54 glibc
55 zlib
56 fontconfig
57 glib
58 libpng
59 freetype
60 xorg.libSM
61 xorg.libICE
62 xorg.libXrender
63 xorg.libXext
64 xorg.libX11
65 xorg.libXt
66 xorg.libXau
67 gst_all_1.gstreamer
68 gst_all_1.gst-plugins-base
69 gst_all_1.gst-libav
70 gst_all_1.gst-vaapi
71 sqlite
72 libGL
73 gtk2
74 ]);
75 runScript = "${package}/rti.linux";
76
77 meta = with lib; {
78 description = "HMRC Basic PAYE Tools";
79 homepage = "https://www.gov.uk/basic-paye-tools";
80 license = licenses.unfree;
81 platforms = platforms.linux;
82 };
83}