2016-01-03 14:33:56 +00:00
|
|
|
{ stdenv, fetchurl, fetchgit, ant, jdk, bash, coreutils, substituteAll }:
|
2013-04-13 14:00:02 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
freenet_ext = fetchurl {
|
|
|
|
url = https://downloads.freenetproject.org/latest/freenet-ext.jar;
|
2015-10-25 05:34:58 +00:00
|
|
|
sha256 = "17ypljdvazgx2z6hhswny1lxfrknysz3x6igx8vl3xgdpvbb7wij";
|
2013-04-13 14:00:02 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
bcprov = fetchurl {
|
2015-10-25 05:34:58 +00:00
|
|
|
url = https://downloads.freenetproject.org/latest/bcprov-jdk15on-152.jar;
|
|
|
|
sha256 = "0wqpdcvcfh939fk8yr033ijzr1vjbp6ydlnv5ly8jiykwj0x3i0d";
|
2013-04-13 14:00:02 +01:00
|
|
|
};
|
2015-10-25 05:34:58 +00:00
|
|
|
seednodes = fetchurl {
|
|
|
|
url = https://downloads.freenetproject.org/alpha/opennet/seednodes.fref;
|
|
|
|
sha256 = "109zn9w8axdkjwhkkcm2s8dvib0mq0n8imjgs3r8hvi128cjsmg9";
|
|
|
|
};
|
|
|
|
version = "build01470";
|
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
freenet-jars = stdenv.mkDerivation {
|
|
|
|
name = "freenet-jars-${version}";
|
2013-04-13 14:00:02 +01:00
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
src = fetchgit {
|
|
|
|
url = https://github.com/freenet/fred;
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
sha256 = "1b6e6fec2b9a729d4a25605fa142df9ea42e59b379ff665f580e32c6178c9746";
|
|
|
|
};
|
2013-04-13 14:00:02 +01:00
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
patchPhase = ''
|
|
|
|
cp ${freenet_ext} lib/freenet/freenet-ext.jar
|
|
|
|
cp ${bcprov} lib/bcprov-jdk15on-152.jar
|
2013-04-13 14:00:02 +01: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 14:00:02 +01:00
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
buildInputs = [ ant jdk ];
|
2013-04-13 14:00:02 +01:00
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
buildPhase = "ant package-only";
|
2013-04-13 14:00:02 +01:00
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/freenet
|
|
|
|
cp lib/bcprov-jdk15on-152.jar $out/share/freenet
|
|
|
|
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 14:00:02 +01:00
|
|
|
|
2016-01-03 14:33:56 +00:00
|
|
|
src = substituteAll {
|
|
|
|
src = ./freenetWrapper;
|
|
|
|
inherit bash coreutils seednodes;
|
|
|
|
freenet = freenet-jars;
|
|
|
|
jre = jdk.jre;
|
|
|
|
};
|
|
|
|
|
|
|
|
jars = freenet-jars;
|
|
|
|
|
|
|
|
phases = [ "installPhase" ];
|
|
|
|
|
|
|
|
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 14:00:02 +01:00
|
|
|
'';
|
|
|
|
|
2014-01-03 13:32:13 +00:00
|
|
|
meta = {
|
2013-04-13 14:00:02 +01:00
|
|
|
description = "Decentralised and censorship-resistant network";
|
|
|
|
homepage = https://freenetproject.org/;
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
2015-10-25 05:34:58 +00:00
|
|
|
maintainers = [ stdenv.lib.maintainers.doublec ];
|
2013-04-13 14:00:02 +01:00
|
|
|
platforms = with stdenv.lib.platforms; linux;
|
|
|
|
};
|
|
|
|
}
|