nixpkgs/pkgs/applications/networking/p2p/freenet/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

69 lines
2.1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, jdk, bash, coreutils, substituteAll, nixosTests, jna }:
let
2022-11-07 22:30:00 +00:00
version = "build01494";
freenet_ext = fetchurl {
2022-11-07 22:30:00 +00:00
url = "https://github.com/freenet/fred/releases/download/${version}/freenet-ext.jar";
sha256 = "sha256-MvKz1r7t9UE36i+aPr72dmbXafCWawjNF/19tZuk158=";
};
bcprov = fetchurl {
2022-11-07 22:30:00 +00:00
url = "https://github.com/freenet/fred/releases/download/${version}/bcprov-jdk15on-1.59.jar";
sha256 = "sha256-HDHkTjMdJeRtKTs+juLQcCimfbAR50yyRDKFrtHVnIU=";
};
seednodes = fetchurl {
url = "https://downloads.freenetproject.org/alpha/opennet/seednodes.fref";
2016-08-20 16:17:13 +00:00
sha256 = "08awwr8n80b4cdzzb3y8hf2fzkr1f2ly4nlq779d6pvi5jymqdvv";
};
freenet-jars = stdenv.mkDerivation {
2019-08-13 21:52:01 +00:00
pname = "freenet-jars";
inherit version;
2022-11-07 22:30:00 +00:00
src = fetchurl {
url = "https://github.com/freenet/fred/releases/download/${version}/freenet.jar";
sha256 = "sha256-1Pjc8Ob4EN7N05QkGTMKBn7z3myTDaQ98N48nNSLstg=";
};
2022-11-07 22:30:00 +00:00
dontUnpack = true;
installPhase = ''
mkdir -p $out/share/freenet
2022-11-07 22:30:00 +00:00
ln -s ${bcprov} $out/share/freenet/bcprov.jar
ln -s ${freenet_ext} $out/share/freenet/freenet-ext.jar
ln -s ${jna}/share/java/jna-platform.jar $out/share/freenet/jna_platform.jar
ln -s ${jna}/share/java/jna.jar $out/share/freenet/jna.jar
2022-11-07 22:30:00 +00:00
ln -s $src $out/share/freenet/freenet.jar
'';
};
in stdenv.mkDerivation {
2022-11-07 22:30:00 +00:00
pname = "freenet";
inherit version;
src = substituteAll {
src = ./freenetWrapper;
2022-11-07 22:30:00 +00:00
inherit bash coreutils jdk seednodes;
freenet = freenet-jars;
};
2021-08-02 22:05:05 +00:00
dontUnpack = true;
2022-11-29 17:30:00 +00:00
passthru.tests = { inherit (nixosTests) freenet; };
installPhase = ''
mkdir -p $out/bin
2022-11-07 22:30:00 +00:00
install -Dm555 $src $out/bin/freenet
ln -s ${freenet-jars}/share $out/share
'';
meta = {
description = "Decentralised and censorship-resistant network";
homepage = "https://freenetproject.org/";
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
2021-01-15 13:21:58 +00:00
license = lib.licenses.gpl2Plus;
2022-11-07 22:30:00 +00:00
maintainers = with lib.maintainers; [ nagy ];
2021-01-15 13:21:58 +00:00
platforms = with lib.platforms; linux;
changelog = "https://github.com/freenet/fred/blob/build${version}/NEWS.md";
};
}