]> Git — Sourcephile - julm/julm-nix.git/blob - nixpkgs/by-name/ra/radicle-httpd/package.nix
radicle: add packages
[julm/julm-nix.git] / nixpkgs / by-name / ra / radicle-httpd / package.nix
1 { asciidoctor
2 , darwin
3 , fetchgit
4 , git
5 , installShellFiles
6 , lib
7 , makeWrapper
8 , man-db
9 , openssh
10 , rustPlatform
11 , stdenv
12 , xdg-utils
13 ,
14 }:
15 rustPlatform.buildRustPackage rec {
16 pname = "radicle-httpd";
17 version = "0.11.0";
18 env.RADICLE_VERSION = version;
19
20 src = fetchgit {
21 url = "https://seed.radicle.xyz/z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git";
22 rev = "refs/namespaces/z6MkkfM3tPXNPrPevKr3uSiQtHPuwnNhu2yUVjgd2jXVsVz5/refs/tags/v${version}";
23 hash = "sha256-XMEO+L362uaPUr25YUkMh41a2BcKEy8bgXfwKlvBtnQ=";
24 sparseCheckout = [ "radicle-httpd" ];
25 };
26 sourceRoot = "${src.name}/radicle-httpd";
27 cargoHash = "sha256-WdgPL6X3FMxHW6OVoTkrbo0azAxp35UzGMcTJ5pNnkI=";
28
29 nativeBuildInputs = [
30 asciidoctor
31 installShellFiles
32 makeWrapper
33 ];
34 nativeCheckInputs = [ git ];
35 buildInputs = lib.optionals stdenv.buildPlatform.isDarwin [ darwin.apple_sdk.frameworks.Security ];
36
37 doCheck = stdenv.hostPlatform.isLinux;
38
39 postInstall = ''
40 for page in $(find -name '*.adoc'); do
41 asciidoctor -d manpage -b manpage $page
42 installManPage ''${page::-5}
43 done
44 '';
45
46 postFixup = ''
47 for program in $out/bin/* ;
48 do
49 wrapProgram "$program" \
50 --prefix PATH : "${
51 lib.makeBinPath [
52 git
53 man-db
54 openssh
55 xdg-utils
56 ]
57 }"
58 done
59 '';
60
61 meta = {
62 description = "Radicle httpd";
63 longDescription = ''
64 A Radicle HTTP daemon exposing a JSON HTTP API that allows someone to browse local
65 repositories on a Radicle node via their web browser.
66 '';
67 homepage = "https://radicle.xyz";
68 # cargo.toml says MIT and asl20, LICENSE file says GPL3
69 license = with lib.licenses; [
70 gpl3Only
71 mit
72 asl20
73 ];
74 platforms = lib.platforms.unix;
75 maintainers = with lib.maintainers; [ gador ];
76 mainProgram = "radicle-httpd";
77 };
78 }