about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/pe/peergos/package.nix
blob: d51f0504bd4921838feab2589a72ae5a4c60ea91 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ lib
, stdenv
, fetchurl
, jre
, makeWrapper
}:

let
  version = "0.14.1";
  peergos = fetchurl {
    url = "https://github.com/Peergos/web-ui/releases/download/v${version}/Peergos.jar";
    hash = "sha256-oCsUuFxTAL0vAabGggGhZHaF40A5TLfkT15HYPiKHlU=";
  };
in
stdenv.mkDerivation rec {
  pname = "peergos";
  inherit version;

  dontUnpack = true;
  dontBuild = true;

  nativeBuildInputs = [ makeWrapper ];

  installPhase = ''
    runHook preInstall

    install -D ${peergos} $out/share/java/peergos.jar
    makeWrapper ${lib.getExe jre} $out/bin/${pname} \
      --add-flags "-jar -Djava.library.path=native-lib $out/share/java/${pname}.jar"

    runHook postInstall
  '';

  meta = with lib; {
    description = "A p2p, secure file storage, social network and application protocol";
    homepage = "https://peergos.org/";
    # peergos have agpt3 license, peergos-web-ui have gpl3, both are used
    license = [ licenses.agpl3Only licenses.gpl3Only ];
    platforms = platforms.all;
    maintainers = with maintainers; [ raspher ];
    sourceProvenance = with sourceTypes; [ binaryBytecode ];
  };
}