about summary refs log tree commit diff
path: root/pkgs/by-name/pi/picocrypt/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/pi/picocrypt/package.nix')
-rw-r--r--pkgs/by-name/pi/picocrypt/package.nix77
1 files changed, 77 insertions, 0 deletions
diff --git a/pkgs/by-name/pi/picocrypt/package.nix b/pkgs/by-name/pi/picocrypt/package.nix
new file mode 100644
index 0000000000000..b0310ea54f66a
--- /dev/null
+++ b/pkgs/by-name/pi/picocrypt/package.nix
@@ -0,0 +1,77 @@
+{
+  lib,
+  buildGoModule,
+  fetchFromGitHub,
+  stdenv,
+  copyDesktopItems,
+  makeDesktopItem,
+
+  xorg,
+  glfw,
+  gtk3,
+  pkg-config,
+  wrapGAppsHook3,
+}:
+
+buildGoModule rec {
+  pname = "picocrypt";
+  version = "1.40";
+
+  src = fetchFromGitHub {
+    owner = "Picocrypt";
+    repo = "Picocrypt";
+    rev = "refs/tags/${version}";
+    hash = "sha256-L3UkWUT6zsUj5C/RHVvaTbt6E8VERk3hZNBGSGbON3c=";
+  };
+
+  sourceRoot = "${src.name}/src";
+
+  vendorHash = "sha256-YYQMJXyVANDrYsd7B/q8L5dpvbzxqjLvm6v20PnpAkY=";
+
+  ldflags = [
+    "-s"
+    "-w"
+  ];
+
+  buildInputs =
+    # Depends on a vendored, patched GLFW.
+    glfw.buildInputs or [ ]
+    ++ glfw.propagatedBuildInputs or [ ]
+    ++ lib.optionals (!stdenv.isDarwin) [
+      gtk3
+      xorg.libXxf86vm
+    ];
+
+  nativeBuildInputs = [
+    copyDesktopItems
+    pkg-config
+    wrapGAppsHook3
+  ];
+
+  CGO_ENABLED = 1;
+
+  postInstall = ''
+    mv $out/bin/Picocrypt $out/bin/picocrypt-gui
+    install -Dm644 $src/images/key.svg $out/share/icons/hicolor/scalable/apps/picocrypt.svg
+  '';
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = "Picocrypt";
+      exec = "picocrypt-gui";
+      icon = "picocrypt";
+      comment = meta.description;
+      desktopName = "Picocrypt";
+      categories = [ "Utility" ];
+    })
+  ];
+
+  meta = {
+    description = "Very small, very simple, yet very secure encryption tool, written in Go";
+    homepage = "https://github.com/Picocrypt/Picocrypt";
+    changelog = "https://github.com/Picocrypt/Picocrypt/blob/main/Changelog.md";
+    license = lib.licenses.gpl3Only;
+    maintainers = with lib.maintainers; [ ryand56 ];
+    mainProgram = "picocrypt-gui";
+  };
+}