2021-01-15 13:21:58 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchFromGitHub, ant, jdk, bash, coreutils, substituteAll }:
|
2013-04-13 13:00:02 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
freenet_ext = fetchurl {
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "https://downloads.freenetproject.org/latest/freenet-ext.jar";
|
2015-10-25 05:34:58 +00:00
|
|
|
sha256 = "17ypljdvazgx2z6hhswny1lxfrknysz3x6igx8vl3xgdpvbb7wij";
|
2013-04-13 13:00:02 +00:00
|
|
|
};
|
|
|
|
|
2016-08-20 16:17:13 +00:00
|
|
|
bcprov_version = "jdk15on-154";
|
2013-04-13 13:00:02 +00:00
|
|
|
bcprov = fetchurl {
|
2016-08-20 16:17:13 +00:00
|
|
|
url = "https://www.bouncycastle.org/download/bcprov-ext-${bcprov_version}.jar";
|
|
|
|
sha256 = "0abmhg2h44g8c5p7skzqwfxj8xwcjh9vs84mc0hr78k1am0633jk";
|
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
|
|
|
};
|
2021-09-20 16:01:31 +00:00
|
|
|
version = "build01480";
|
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
|
|
|
|
2016-08-20 16:17:13 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "freenet";
|
|
|
|
repo = "fred";
|
|
|
|
rev = version;
|
2021-09-20 16:01:31 +00:00
|
|
|
sha256 = "0wddkfyhsgs7bcq9svicz6l0a35yv82yqzmji3c345hg4hbch3kb";
|
2016-01-03 14:33:56 +00:00
|
|
|
};
|
2013-04-13 13:00:02 +00:00
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
patchPhase = ''
|
|
|
|
cp ${freenet_ext} lib/freenet/freenet-ext.jar
|
2016-08-20 16:17:13 +00:00
|
|
|
cp ${bcprov} lib/bcprov-${bcprov_version}.jar
|
2013-04-13 13:00:02 +00:00
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
sed '/antcall.*-ext/d' -i build.xml
|
|
|
|
sed 's/@unknown@/${version}/g' -i build-clean.xml
|
|
|
|
'';
|
2013-04-13 13:00:02 +00:00
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
buildInputs = [ ant jdk ];
|
2013-04-13 13:00:02 +00:00
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
buildPhase = "ant package-only";
|
2013-04-13 13:00:02 +00:00
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/freenet
|
2016-08-20 16:17:13 +00:00
|
|
|
cp lib/bcprov-${bcprov_version}.jar $out/share/freenet
|
2016-01-03 14:33:56 +00:00
|
|
|
cp lib/freenet/freenet-ext.jar $out/share/freenet
|
|
|
|
cp dist/freenet.jar $out/share/freenet
|
|
|
|
'';
|
|
|
|
};
|
2015-10-25 05:34:58 +00:00
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
in stdenv.mkDerivation {
|
|
|
|
name = "freenet-${version}";
|
|
|
|
inherit version;
|
2013-04-13 13:00:02 +00:00
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
src = substituteAll {
|
|
|
|
src = ./freenetWrapper;
|
2016-08-20 16:17:13 +00:00
|
|
|
inherit bash coreutils seednodes bcprov_version;
|
2016-01-03 14:33:56 +00:00
|
|
|
freenet = freenet-jars;
|
|
|
|
jre = jdk.jre;
|
|
|
|
};
|
|
|
|
|
|
|
|
jars = freenet-jars;
|
|
|
|
|
2021-08-02 22:05:05 +00:00
|
|
|
dontUnpack = true;
|
2016-01-03 14:33:56 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp $src $out/bin/freenet
|
|
|
|
chmod +x $out/bin/freenet
|
|
|
|
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/";
|
2021-01-15 13:21:58 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2020-11-09 08:42:14 +00:00
|
|
|
maintainers = [ ];
|
2021-01-15 13:21:58 +00:00
|
|
|
platforms = with lib.platforms; linux;
|
2013-04-13 13:00:02 +00:00
|
|
|
};
|
|
|
|
}
|