From 9f7331a682f119bb81089d8412afc044ad2b76a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C6=B0=C6=A1ng=20Huy=20Trung?= Date: Fri, 14 Jun 2024 00:57:08 +0930 Subject: [PATCH] transito: init at 0.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Nguyễn Gia Phong --- pkgs/by-name/tr/transito/package.nix | 74 ++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 pkgs/by-name/tr/transito/package.nix diff --git a/pkgs/by-name/tr/transito/package.nix b/pkgs/by-name/tr/transito/package.nix new file mode 100644 index 000000000000..a87a00f33753 --- /dev/null +++ b/pkgs/by-name/tr/transito/package.nix @@ -0,0 +1,74 @@ +{ + lib, + buildGoModule, + fetchFromSourcehut, + pkg-config, + vulkan-headers, + libxkbcommon, + wayland, + xorg, + libGL, + sqlite, +}: + +buildGoModule rec { + pname = "transito"; + version = "0.9.1"; + + src = fetchFromSourcehut { + owner = "~mil"; + repo = "transito"; + rev = "v${version}"; + hash = "sha256-5aG/hmpUAN2qYxpqMKLl2WnYgR/sPdtAwLGkFXVyrNs="; + }; + vendorHash = "sha256-7QMO+/f+yc5GfxvDLIXuf+QT2cAmbgI6iQqWmQIkMMA="; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ + vulkan-headers + libxkbcommon + wayland + xorg.libX11 + xorg.libXcursor + xorg.libXfixes + libGL + sqlite + ]; + + tags = [ "sqlite_math_functions" ]; + ldflags = [ "-X git.sr.ht/~mil/transito/src/uipages/pageconfig.Commit=${version}" ]; + + postInstall = '' + install -Dm644 -t $out/share/applications assets/transito.desktop + install -Dm644 -t $out/share/pixmaps assets/transito.png + for icon in assets/transito_*.png + do + name=$(basename $icon .png) + install -Dm644 -t $out/share/icons/hicolor/''${name#transito_}/apps $icon + done + ''; + + doCheck = false; # no test + + meta = with lib; { + description = "Data-provider-agnostic (GTFS) public transportation app"; + longDescription = '' + Transito is a data-provider-agnostic public transportation app + that let's you route between locations using openly available + public GTFS feeds. Utilizing the Mobroute library, + the Transito app lets you performs routing calculations offline + (no network calls once data is initially fetched). + + Overall, Transito aims to be an opensource alternative + to proprietary routing apps to get users from point A to point B + via public transit without comprising privacy or user freedoms. + It works in many well-connected metros which have publicly available + GTFS data, to name a few: Lisbon, NYC, Brussels, Krakow, and Bourges. + ''; + homepage = "https://git.sr.ht/~mil/transito"; + license = licenses.gpl3Plus; + maintainers = [ maintainers.McSinyx ]; + mainProgram = "transito"; + platforms = platforms.unix; + }; +}