about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2024-06-25 16:25:06 +0200
committerGitHub <noreply@github.com>2024-06-25 16:25:06 +0200
commit3f8391d04c54f3de0734021a7b82370bfa4c17a3 (patch)
tree145163c5b1155ae7451394755dd614adbb846ce8 /pkgs
parentdff7599cae4b4af7ee878bd6642a720d6dd8cafc (diff)
parentff0671b1c457ce16255d6322f476dbe00a07c815 (diff)
Merge pull request #321580 from gador/radicle-httpd
radicle-httpd: init at 0.11.0
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/by-name/ra/radicle-httpd/package.nix79
1 files changed, 79 insertions, 0 deletions
diff --git a/pkgs/by-name/ra/radicle-httpd/package.nix b/pkgs/by-name/ra/radicle-httpd/package.nix
new file mode 100644
index 0000000000000..46a35fda34ca8
--- /dev/null
+++ b/pkgs/by-name/ra/radicle-httpd/package.nix
@@ -0,0 +1,79 @@
+{
+  asciidoctor,
+  darwin,
+  fetchgit,
+  git,
+  installShellFiles,
+  lib,
+  makeWrapper,
+  man-db,
+  rustPlatform,
+  stdenv,
+  xdg-utils,
+}:
+rustPlatform.buildRustPackage rec {
+  pname = "radicle-httpd";
+  version = "0.11.0";
+  env.RADICLE_VERSION = version;
+
+  src = fetchgit {
+    url = "https://seed.radicle.xyz/z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git";
+    rev = "refs/namespaces/z6MkkfM3tPXNPrPevKr3uSiQtHPuwnNhu2yUVjgd2jXVsVz5/refs/tags/v${version}";
+    hash = "sha256-XMEO+L362uaPUr25YUkMh41a2BcKEy8bgXfwKlvBtnQ=";
+    sparseCheckout = [ "radicle-httpd" ];
+  };
+  sourceRoot = "${src.name}/radicle-httpd";
+  cargoHash = "sha256-WdgPL6X3FMxHW6OVoTkrbo0azAxp35UzGMcTJ5pNnkI=";
+
+  nativeBuildInputs = [
+    asciidoctor
+    installShellFiles
+    makeWrapper
+  ];
+  nativeCheckInputs = [ git ];
+  buildInputs = lib.optionals stdenv.buildPlatform.isDarwin [ darwin.apple_sdk.frameworks.Security ];
+
+  doCheck = stdenv.hostPlatform.isLinux;
+
+  postInstall = ''
+    for page in $(find -name '*.adoc'); do
+      asciidoctor -d manpage -b manpage $page
+      installManPage ''${page::-5}
+    done
+  '';
+
+  postFixup = ''
+    for program in $out/bin/* ;
+    do
+      wrapProgram "$program" \
+        --prefix PATH : "${
+          lib.makeBinPath [
+            git
+            man-db
+            xdg-utils
+          ]
+        }"
+    done
+  '';
+
+  meta = {
+    description = "Radicle JSON HTTP API Daemon";
+    longDescription = ''
+      A Radicle HTTP daemon exposing a JSON HTTP API that allows someone to browse local
+      repositories on a Radicle node via their web browser.
+    '';
+    homepage = "https://radicle.xyz";
+    # cargo.toml says MIT and asl20, LICENSE file says GPL3
+    license = with lib.licenses; [
+      gpl3Only
+      mit
+      asl20
+    ];
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [
+      gador
+      lorenzleutgeb
+    ];
+    mainProgram = "radicle-httpd";
+  };
+}