2024-03-11 10:48:13 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, oniguruma
|
|
|
|
, darwin
|
|
|
|
, installShellFiles
|
|
|
|
, tpnote
|
|
|
|
, testers
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "tpnote";
|
2024-04-12 14:11:44 +00:00
|
|
|
version = "1.24.2";
|
2024-03-11 10:48:13 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "getreu";
|
|
|
|
repo = "tp-note";
|
|
|
|
rev = "v${version}";
|
2024-04-12 14:11:44 +00:00
|
|
|
hash = "sha256-uNW1gb4zmLjOZFtxaBBEQGRGc9C2M8cSARZBa3+FC2k=";
|
2024-03-11 10:48:13 +00:00
|
|
|
};
|
|
|
|
|
2024-04-12 14:11:44 +00:00
|
|
|
cargoHash = "sha256-pOiIQU/5z/g4NbdwoYaDdxTfTkxEdddVsmuH54pCOBM=";
|
2024-03-11 10:48:13 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
installShellFiles
|
|
|
|
];
|
2024-04-12 14:11:44 +00:00
|
|
|
|
2024-03-11 10:48:13 +00:00
|
|
|
buildInputs = [
|
|
|
|
oniguruma
|
|
|
|
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
|
|
|
AppKit
|
|
|
|
CoreServices
|
|
|
|
SystemConfiguration
|
|
|
|
]);
|
|
|
|
|
2024-06-09 07:43:32 +00:00
|
|
|
postInstall = ''
|
|
|
|
installManPage docs/build/man/man1/tpnote.1
|
|
|
|
'';
|
|
|
|
|
2024-03-11 10:48:13 +00:00
|
|
|
RUSTONIG_SYSTEM_LIBONIG = true;
|
|
|
|
|
|
|
|
passthru.tests.version = testers.testVersion { package = tpnote; };
|
|
|
|
|
|
|
|
# The `tpnote` crate has no unit tests. All tests are in `tpnote-lib`.
|
|
|
|
checkType = "debug";
|
|
|
|
cargoTestFlags = "--package tpnote-lib";
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
changelog = "https://github.com/getreu/tp-note/releases/tag/v${version}";
|
|
|
|
description = "Markup enhanced granular note-taking";
|
|
|
|
homepage = "https://blog.getreu.net/projects/tp-note/";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
mainProgram = "tpnote";
|
|
|
|
maintainers = with lib.maintainers; [ getreu ];
|
|
|
|
};
|
|
|
|
}
|