diff --git a/pkgs/applications/networking/p2p/freenet/default.nix b/pkgs/applications/networking/p2p/freenet/default.nix new file mode 100644 index 000000000000..a284c92c16f6 --- /dev/null +++ b/pkgs/applications/networking/p2p/freenet/default.nix @@ -0,0 +1,54 @@ +{ stdenv, fetchurl, apacheAntOpenJDK, jre }: + +let + # The .gitmodules in freenet-official-20130413-eccc9b3198 + # points to freenet-contrib-staging-ce3b7d5 + freenet_ext = fetchurl { + url = https://downloads.freenetproject.org/latest/freenet-ext.jar; + sha1 = "507ab3f6ee91f47c187149136fb6d6e98f9a8c7f"; + }; + + bcprov = fetchurl { + url = http://www.bouncycastle.org/download/bcprov-jdk15on-148.jar; + sha256 = "12129q8rmqwlvj6z4j0gc3w0hq5ccrkf2gdlsggp3iws7cp7wjw0"; + }; +in +stdenv.mkDerivation { + name = "freenet-official-20130413-eccc9b3198"; + + src = fetchurl { + url = https://github.com/freenet/fred-official/tarball/eccc9b3198; + name = "freenet-official-eccc9b3198.tar.gz"; + sha256 = "0x0s8gmb95770l7968r99sq0588vf0n1687ivc2hixar19cw620y"; + }; + + patchPhase = '' + cp ${freenet_ext} lib/freenet/freenet-ext.jar + cp ${bcprov} lib/bcprov.jar + + sed '/antcall.*-ext/d' -i build.xml + ''; + + buildInputs = [ apacheAntOpenJDK jre ]; + + buildPhase = "ant package-only"; + + installPhase = '' + ensureDir $out/share/freenet $out/bin + cp lib/freenet/freenet-ext.jar $out/share/freenet + cp dist/freenet.jar $out/share/freenet + + cat < $out/bin/freenet + ${jre}/bin/java -cp $out/share/freenet/freenet-ext.jar:$out/share/freenet/freenet.jar \\ + -Xmx1024M freenet.node.NodeStarter + EOF + chmod +x $out/bin/freenet + ''; + + meta = { + description = "Decentralised and censorship-resistant network"; + homepage = https://freenetproject.org/; + license = "GPLv2+"; + platforms = with stdenv.lib.platforms; linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f7fc18ff3d08..0b9d26e1fcf9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7057,6 +7057,8 @@ let jre = jdk; }; + freenet = callPackage ../applications/networking/p2p/freenet { }; + freepv = callPackage ../applications/graphics/freepv { }; xfontsel = callPackage ../applications/misc/xfontsel { };