1{
2 lib,
3 fetchFromGitHub,
4 rustPlatform,
5 cmake,
6 pkg-config,
7 oniguruma,
8 installShellFiles,
9 tpnote,
10 testers,
11}:
12
13rustPlatform.buildRustPackage rec {
14 pname = "tpnote";
15 version = "1.25.12";
16
17 src = fetchFromGitHub {
18 owner = "getreu";
19 repo = "tp-note";
20 tag = "v${version}";
21 hash = "sha256-rjRZVD0EDRtSiF8kU3VyQJhBJEGDqDsjJgEZkVeC+L0=";
22 };
23
24 cargoHash = "sha256-lUwusYFt7shEt2fTV4N5bn6bYTWDjUU7hY9VsC2bDHo=";
25
26 nativeBuildInputs = [
27 cmake
28 pkg-config
29 installShellFiles
30 ];
31
32 buildInputs = [
33 oniguruma
34 ];
35
36 postInstall = ''
37 installManPage docs/build/man/man1/tpnote.1
38 '';
39
40 RUSTONIG_SYSTEM_LIBONIG = true;
41
42 passthru.tests.version = testers.testVersion { package = tpnote; };
43
44 # The `tpnote` crate has no unit tests. All tests are in `tpnote-lib`.
45 checkType = "debug";
46 cargoTestFlags = "--package tpnote-lib";
47 doCheck = true;
48
49 meta = {
50 changelog = "https://github.com/getreu/tp-note/releases/tag/v${version}";
51 description = "Markup enhanced granular note-taking";
52 homepage = "https://blog.getreu.net/projects/tp-note/";
53 license = lib.licenses.mit;
54 mainProgram = "tpnote";
55 maintainers = with lib.maintainers; [ getreu ];
56 };
57}