1{
2 lib,
3 buildGoModule,
4 fetchFromSourcehut,
5 sqlite,
6 stdenv,
7}:
8
9buildGoModule rec {
10 pname = "mobroute";
11 version = "0.10.0";
12
13 src = fetchFromSourcehut {
14 owner = "~mil";
15 repo = "mobroute";
16 rev = "v${version}";
17 hash = "sha256-qQmOvo8fVZfAE0XzX1YPhfzXrBXEWwRkNNnhLQFd4ec=";
18 };
19 vendorHash = "sha256-HcHPQq9KmqSB5RdmZDFR6BXsVoJ4XfBMClS8hR8weCU=";
20
21 buildInputs = [ sqlite ];
22 tags = [
23 "libsqlite3"
24 "sqlite_math_functions"
25 ];
26
27 preCheck = ''
28 export HOME=$TMPDIR
29 '';
30
31 postInstall = ''
32 mv $out/bin/{cli,mobroute}
33 '';
34
35 meta = with lib; {
36 description = "General purpose public transportation router based on GTFS";
37 longDescription = ''
38 Mobroute is a general purpose public transportation router
39 (e.g. trip planner) Go library and CLI that works
40 by directly ingesting timetable (GTFS) data from transit agencies
41 (sourced from the Mobility Database). After data has been fetched,
42 routing calculations can be run offline.
43
44 Overall, Mobroute aims to offer an opensource framework
45 for integrating data-provider-agnostic GTFS public transit capabilities
46 (integrated GTFS ETL, GTFS multisource support, and routing algorithm)
47 into applications to get users from point-a to point-b via public transit
48 without comprising privacy or user freedoms.
49 '';
50 homepage = "https://git.sr.ht/~mil/mobroute";
51 license = licenses.gpl3Plus;
52 maintainers = [ maintainers.McSinyx ];
53 mainProgram = "mobroute";
54 platforms = platforms.unix;
55 broken = stdenv.hostPlatform.isDarwin;
56 };
57}