summaryrefslogtreecommitdiff
path: root/pkgs/travelynx.nix
blob: 4cbb6d09e083285ac176194aa07c233ab01093b4 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
{ perl, fetchgit, fetchurl, stdenvNoCC, lib, ... }:

with perl.pkgs;

let
  ClassMeasure = buildPerlModule {
    pname = "Class-Measure";
    version = "0.09";
    src = fetchurl {
      url = "mirror://cpan/authors/id/B/BL/BLUEFEET/Class-Measure-0.09.tar.gz";
      sha256 =
        "ee272ee35d05ab6fe94f2ac170943ff29c1a0f9a7362faa44ad92d2521e88ba5";
    };
    buildInputs = [ ModuleBuildTiny Test2Suite ];
    propagatedBuildInputs = [ SubExporter ];
    meta = {
      homepage = "https://github.com/bluefeet/Class-Measure";
      description = "Create, compare, and convert units of measurement";
      license = with lib.licenses; [ artistic1 gpl1Plus ];
    };
  };
  MojoliciousPluginAuthentication = buildPerlPackage {
    pname = "Mojolicious-Plugin-Authentication";
    version = "1.39";
    src = fetchurl {
      url =
        "mirror://cpan/authors/id/J/JJ/JJATRIA/Mojolicious-Plugin-Authentication-1.39.tar.gz";
      sha256 = "sha256-n5nL31ysqj+j+WG+6U3pcibRd6NqFee6MDrnnRModNE=";
    };
    propagatedBuildInputs = [ Mojolicious ];
    meta = {
      homepage =
        "https://github.com/benvanstaveren/Mojolicious-Plugin-Authentication";
      description = "A plugin to make authentication a bit easier";
      license = with lib.licenses; [ artistic1 gpl1Plus ];
    };
  };
  GISDistance = buildPerlModule {
    pname = "GIS-Distance";
    version = "0.19";
    src = fetchurl {
      url = "mirror://cpan/authors/id/B/BL/BLUEFEET/GIS-Distance-0.19.tar.gz";
      sha256 =
        "f855d05d47f2fd2001824f8bccf131ab4ea21f2b945d202ccb163b7ba8587db3";
    };
    buildInputs = [ ModuleBuildTiny Test2Suite ];
    propagatedBuildInputs =
      [ ClassMeasure ConstFast namespaceclean strictures ];
    meta = {
      homepage = "https://github.com/bluefeet/GIS-Distance";
      description = "Calculate geographic distances";
      license = with lib.licenses; [ artistic1 gpl1Plus ];
    };
  };
  GISDistanceFast = buildPerlModule {
    pname = "GIS-Distance-Fast";
    version = "0.15";
    src = fetchurl {
      url =
        "mirror://cpan/authors/id/B/BL/BLUEFEET/GIS-Distance-Fast-0.15.tar.gz";
      sha256 =
        "d4d0ebe6fc92812528dd6f9ab86a1e3745dbe99448acd4911cc25a266b8ccd6a";
    };
    buildInputs = [ ModuleBuildTiny Test2Suite ];
    propagatedBuildInputs = [ GISDistance namespaceclean strictures ];
    meta = {
      homepage = "https://github.com/bluefeet/GIS-Distance-Fast";
      description = "C implementation of GIS::Distance formulas";
      license = with lib.licenses; [ artistic1 gpl1Plus ];
    };
  };
  TravelStatusDEDeutscheBahn = buildPerlModule {
    pname = "Travel-Status-DE-DeutscheBahn";
    version = "4.09";
    src = fetchurl {
      url =
        "mirror://cpan/authors/id/D/DE/DERF/Travel-Status-DE-DeutscheBahn-4.09.tar.gz";
      sha256 =
        "7ea92038912ab0e07ad73bc83e0b43be7bbfdc906f831ac06fd206747a49e28c";
    };
    buildInputs = [ FileSlurp TestCompile TestPod ];
    propagatedBuildInputs = [
      ClassAccessor
      DateTime
      DateTimeFormatStrptime
      JSON
      LWP
      LWPProtocolhttps
      ListMoreUtils
    ];
    meta = {
      description = "Interface to the online arrival/departure";
      license = with lib.licenses; [ artistic1 gpl1Plus ];
    };
  };
  TravelStatusDEDBWagenreihung = buildPerlModule {
    pname = "Travel-Status-DE-DBWagenreihung";
    version = "0.08";
    src = fetchurl {
      url =
        "mirror://cpan/authors/id/D/DE/DERF/Travel-Status-DE-DBWagenreihung-0.08.tar.gz";
      sha256 =
        "87f5d7dd01ac8fd46f630aee929ea37b79a65ecdf89fb927575ff7139265d61b";
    };
    buildInputs = [ TestCompile TestPod ];
    propagatedBuildInputs = [ ClassAccessor JSON LWP TravelStatusDEIRIS ];
    meta = {
      description = "Interface to Deutsche Bahn Wagon Order API";
      license = with lib.licenses; [ artistic1 gpl1Plus ];
    };
  };
  TravelStatusDEIRIS = buildPerlModule {
    pname = "Travel-Status-DE-IRIS";
    version = "1.82";
    src = fetchurl {
      url =
        "mirror://cpan/authors/id/D/DE/DERF/Travel-Status-DE-IRIS-1.82.tar.gz";
      sha256 =
        "92875b556cec42ac0e65fab94dbe9299eba09be958ab0d794b2a616f7e937c18";
    };
    buildInputs =
      [ FileSlurp JSON TestCompile TestFatal TestNumberDelta TestPod TextCSV ];
    propagatedBuildInputs = [
      ClassAccessor
      DateTime
      DateTimeFormatStrptime
      GISDistance
      LWP
      LWPProtocolhttps
      ListCompare
      ListMoreUtils
      ListUtilsBy
      TextLevenshteinXS
      XMLLibXML
    ];
    meta = {
      description = "Interface to IRIS based web departure monitors";
      license = with lib.licenses; [ artistic1 gpl1Plus ];
    };
  };
  Cache = buildPerlModule {
    pname = "Cache";
    version = "2.11";
    src = fetchurl {
      url = "mirror://cpan/authors/id/S/SH/SHLOMIF/Cache-2.11.tar.gz";
      sha256 =
        "e1d2d89677981166abc5bb6e5ecc6471f001f13eb56d5be9544d8047dc08a592";
    };
    doCheck = false;
    propagatedBuildInputs = [ FileNFSLock Heap IOString TimeDate ];
    meta = {
      description = "Provide a generic Cache mechanism";
      license = with lib.licenses; [ artistic1 gpl1Plus ];
    };
  };
  Heap = buildPerlPackage {
    pname = "Heap";
    version = "0.80";
    src = fetchurl {
      url = "mirror://cpan/authors/id/J/JM/JMM/Heap-0.80.tar.gz";
      sha256 =
        "ccda29f3c93176ad0fdfff4dd6f5e4ac90b370cba4b028386b7343bf64139bde";
    };
    meta = { };
  };
  CAMPDF = buildPerlPackage {
    pname = "CAM-PDF";
    version = "1.60";
    src = fetchurl {
      url = "mirror://cpan/authors/id/C/CD/CDOLAN/CAM-PDF-1.60.tar.gz";
      sha256 =
        "e76afc7f38a624924a77c5c988c36c9e388bfa7716e75cd397fef8e1b42ebb89";
    };
    propagatedBuildInputs = [ CryptRC4 TextPDF ];
    meta = {
      description = "PDF manipulation library";
      license = with lib.licenses; [ artistic1 gpl1Plus ];
    };
  };

  perlWithPackages = perl.withPackages (_: [
    Cache
    CacheCache
    CAMPDF
    CryptEksblowfish
    DateTime
    DateTimeFormatStrptime
    EmailSender
    GISDistance
    GISDistanceFast
    ListUtilsBy
    MIMEtools
    Mojolicious
    MojoliciousPluginAuthentication
    MojoPg
    TravelStatusDEDeutscheBahn
    TravelStatusDEDBWagenreihung
    TravelStatusDEIRIS
    UUIDTiny
    TextCSV
    JSON
    JSONXS
    XMLLibXML
    DBFile
    FileSlurp
    TextLevenshteinXS
  ]);

  # Note: set location of config via $MOJO_CONFIG when running index.pl
  travelynx = stdenvNoCC.mkDerivation {
    pname = "travelynx";
    version = "2.0.2";
    src = fetchgit {
      url = "https://git.finalrewind.org/travelynx";
      sha256 = "sha256-wUaQ+1+aqoF0mire8izWNKtlbRIEtrWEc7eACGNjGIY=";
    };
    buildInputs = [ p ];
    buildPhase = ''
      substituteInPlace index.pl \
        --replace "/usr/bin/env perl" ${perlWithPackages.outPath}/bin/perl
      chmod +x index.pl
    '';
    installPhase = ''
      mkdir -p $out
      cp -r * $out
    '';
  };

in travelynx