2024-10-26 18:56:30 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildGoModule,
|
|
|
|
fetchFromGitHub,
|
|
|
|
libax25,
|
|
|
|
installShellFiles,
|
2024-10-26 19:18:03 +00:00
|
|
|
fetchpatch,
|
2023-09-28 22:25:27 +00:00
|
|
|
}:
|
2023-07-16 19:53:47 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "pat";
|
2024-10-26 19:17:46 +00:00
|
|
|
version = "0.16.0";
|
2023-07-16 19:53:47 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "la5nta";
|
|
|
|
repo = "pat";
|
|
|
|
rev = "v${version}";
|
2024-10-26 19:17:46 +00:00
|
|
|
hash = "sha256-JlqYdsAXs3pS5i59tiel+gxQsTrn5mUs0qLzjHxGZU0=";
|
2023-07-16 19:53:47 +00:00
|
|
|
};
|
|
|
|
|
2024-10-26 19:18:03 +00:00
|
|
|
# Remove upon next release since upstream is fixed
|
|
|
|
# https://github.com/la5nta/pat/pull/449
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/la5nta/pat/commit/5604eac8853216d96d49d7d9947bdc514e195538.patch";
|
|
|
|
sha256 = "sha256-Z9uoZLlhdCslULUxGkc4ao4ptC4ImWzSrfabSA5S/PE=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-10-26 19:17:46 +00:00
|
|
|
vendorHash = "sha256-Z6p0wiOY5l++nch64BJWGXleBgUNecTDm+yVCnmXvtU=";
|
2023-07-16 19:53:47 +00:00
|
|
|
|
2024-10-26 18:56:30 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
2023-09-28 22:25:27 +00:00
|
|
|
];
|
|
|
|
|
2024-10-26 18:56:30 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2023-09-28 22:25:27 +00:00
|
|
|
buildInputs = lib.optional stdenv.hostPlatform.isLinux [ libax25 ];
|
|
|
|
|
|
|
|
# Needed by wl2k-go go module for libax25 to include support for Linux' AX.25 stack by linking against libax25.
|
|
|
|
# ref: https://github.com/la5nta/wl2k-go/blob/abe3ae5bf6a2eec670a21672d461d1c3e1d4c2f3/transport/ax25/ax25.go#L11-L17
|
|
|
|
tags = lib.optionals stdenv.hostPlatform.isLinux [ "libax25" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installManPage man/pat-configure.1 man/pat.1
|
|
|
|
'';
|
|
|
|
|
2023-07-16 19:53:47 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Pat is a cross platform Winlink client written in Go";
|
|
|
|
homepage = "https://getpat.io/";
|
|
|
|
license = licenses.mit;
|
2024-10-26 18:56:30 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
dotemup
|
|
|
|
sarcasticadmin
|
|
|
|
];
|
2023-09-28 22:25:27 +00:00
|
|
|
platforms = platforms.unix;
|
2024-02-11 02:19:15 +00:00
|
|
|
mainProgram = "pat";
|
2023-07-16 19:53:47 +00:00
|
|
|
};
|
|
|
|
}
|