2022-11-29 20:45:00 +00:00
|
|
|
{ lib, stdenv, fetchurl, jdk, bash, coreutils, substituteAll, nixosTests, jna }:
|
2013-04-13 13:00:02 +00:00
|
|
|
|
|
|
|
let
|
2022-11-07 22:30:00 +00:00
|
|
|
version = "build01494";
|
2013-04-13 13:00:02 +00:00
|
|
|
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=";
|
2013-04-13 13:00:02 +00:00
|
|
|
};
|
|
|
|
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=";
|
2013-04-13 13:00:02 +00:00
|
|
|
};
|
2015-10-25 05:34:58 +00:00
|
|
|
seednodes = fetchurl {
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "https://downloads.freenetproject.org/alpha/opennet/seednodes.fref";
|
2016-08-20 16:17:13 +00:00
|
|
|
sha256 = "08awwr8n80b4cdzzb3y8hf2fzkr1f2ly4nlq779d6pvi5jymqdvv";
|
2015-10-25 05:34:58 +00:00
|
|
|
};
|
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
freenet-jars = stdenv.mkDerivation {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "freenet-jars";
|
|
|
|
inherit version;
|
2013-04-13 13:00:02 +00:00
|
|
|
|
2022-11-07 22:30:00 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/freenet/fred/releases/download/${version}/freenet.jar";
|
|
|
|
sha256 = "sha256-1Pjc8Ob4EN7N05QkGTMKBn7z3myTDaQ98N48nNSLstg=";
|
2016-01-03 14:33:56 +00:00
|
|
|
};
|
2013-04-13 13:00:02 +00:00
|
|
|
|
2022-11-07 22:30:00 +00:00
|
|
|
dontUnpack = true;
|
2013-04-13 13:00:02 +00:00
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
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
|
2022-11-29 20:45:00 +00:00
|
|
|
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
|
2016-01-03 14:33:56 +00:00
|
|
|
'';
|
|
|
|
};
|
2015-10-25 05:34:58 +00:00
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
in stdenv.mkDerivation {
|
2022-11-07 22:30:00 +00:00
|
|
|
pname = "freenet";
|
2016-01-03 14:33:56 +00:00
|
|
|
inherit version;
|
2013-04-13 13:00:02 +00:00
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
src = substituteAll {
|
|
|
|
src = ./freenetWrapper;
|
2022-11-07 22:30:00 +00:00
|
|
|
inherit bash coreutils jdk seednodes;
|
2016-01-03 14:33:56 +00:00
|
|
|
freenet = freenet-jars;
|
|
|
|
};
|
|
|
|
|
2021-08-02 22:05:05 +00:00
|
|
|
dontUnpack = true;
|
2016-01-03 14:33:56 +00:00
|
|
|
|
2022-11-29 17:30:00 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) freenet; };
|
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
2022-11-07 22:30:00 +00:00
|
|
|
install -Dm555 $src $out/bin/freenet
|
2016-01-03 14:33:56 +00:00
|
|
|
ln -s ${freenet-jars}/share $out/share
|
2013-04-13 13:00:02 +00:00
|
|
|
'';
|
|
|
|
|
2014-01-03 13:32:13 +00:00
|
|
|
meta = {
|
2013-04-13 13:00:02 +00:00
|
|
|
description = "Decentralised and censorship-resistant network";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://freenetproject.org/";
|
2022-06-02 13:38:41 +00:00
|
|
|
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;
|
2022-11-29 20:45:00 +00:00
|
|
|
changelog = "https://github.com/freenet/fred/blob/build${version}/NEWS.md";
|
2013-04-13 13:00:02 +00:00
|
|
|
};
|
|
|
|
}
|