about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/tp/tpnote/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/by-name/tp/tpnote/package.nix')
-rw-r--r--nixpkgs/pkgs/by-name/tp/tpnote/package.nix59
1 files changed, 59 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/tp/tpnote/package.nix b/nixpkgs/pkgs/by-name/tp/tpnote/package.nix
new file mode 100644
index 000000000000..b1b61f0c8f5d
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/tp/tpnote/package.nix
@@ -0,0 +1,59 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, rustPlatform
+, cmake
+, pkg-config
+, oniguruma
+, darwin
+, installShellFiles
+, tpnote
+, testers
+}:
+
+
+rustPlatform.buildRustPackage rec {
+  pname = "tpnote";
+  version = "1.23.10";
+
+  src = fetchFromGitHub {
+    owner = "getreu";
+    repo = "tp-note";
+    rev = "v${version}";
+    hash = "sha256-HOCd5N8oS8N+9alR3cG7IEghvhvcc8A+O24L6FD1F38=";
+  };
+
+  cargoHash = "sha256-hI9vzPLcMaFSQpPgIf39UsWDpdHAmQ56D8pSWZ/R1aI=";
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    installShellFiles
+  ];
+  buildInputs = [
+    oniguruma
+  ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+     AppKit
+     CoreServices
+     SystemConfiguration
+  ]);
+
+  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 ];
+  };
+}