tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
i2p: 0.9.19 -> 0.9.20
Herwig Hochleitner
10 years ago
604dfd33
6f5aa25e
+47
-7
2 changed files
expand all
collapse all
unified
split
pkgs
tools
networking
i2p
default.nix
i2p.patch
+8
-7
pkgs/tools/networking/i2p/default.nix
···
1
{ stdenv, procps, coreutils, fetchurl, jdk, jre, ant, gettext, which }:
2
3
stdenv.mkDerivation rec {
4
-
name = "i2p-0.9.19";
5
src = fetchurl {
6
url = "https://github.com/i2p/i2p.i2p/archive/${name}.tar.gz";
7
-
sha256 = "1q9sda1a708laxf452qnzbfv7bwfwyam5n1giw2n3z3ar602i936";
8
};
9
buildInputs = [ jdk ant gettext which ];
0
10
buildPhase = ''
11
export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
12
ant preppkg-linux-only
···
17
cp -r pkg-temp/* $out
18
cp installer/lib/wrapper/linux64/* $out
19
sed -i $out/i2prouter -i $out/runplain.sh \
20
-
-e "s#%INSTALL_PATH#$out#" \
0
0
21
-e "s#/usr/ucb/ps#${procps}/bin/ps#" \
22
-e "s#/usr/bin/tr#${coreutils}/bin/tr#" \
0
23
-e 's#%USER_HOME#$HOME#' \
24
-e "s#%SYSTEM_java_io_tmpdir#/tmp#" \
25
-
-e 's#JAVA=java#JAVA=${jre}/bin/java#'
26
-
sed -i $out/runplain.sh \
27
-
-e "s#nohup \(.*Launch\) .*#\1#" \
28
-
-e "s#echo \$\! .*##"
29
mv $out/runplain.sh $out/bin/i2prouter-plain
30
mv $out/man $out/share/
31
chmod +x $out/bin/* $out/i2psvc
···
1
{ stdenv, procps, coreutils, fetchurl, jdk, jre, ant, gettext, which }:
2
3
stdenv.mkDerivation rec {
4
+
name = "i2p-0.9.20";
5
src = fetchurl {
6
url = "https://github.com/i2p/i2p.i2p/archive/${name}.tar.gz";
7
+
sha256 = "10rynkl9dbnfl67ck3d7wdwz52h7354r7nbwcypsjnng4f1dmj5s";
8
};
9
buildInputs = [ jdk ant gettext which ];
10
+
patches = [ ./i2p.patch ];
11
buildPhase = ''
12
export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
13
ant preppkg-linux-only
···
18
cp -r pkg-temp/* $out
19
cp installer/lib/wrapper/linux64/* $out
20
sed -i $out/i2prouter -i $out/runplain.sh \
21
+
-e "s#uname#${coreutils}/bin/uname#" \
22
+
-e "s#which#${which}/bin/which#" \
23
+
-e "s#%gettext%#${gettext}/bin/gettext#" \
24
-e "s#/usr/ucb/ps#${procps}/bin/ps#" \
25
-e "s#/usr/bin/tr#${coreutils}/bin/tr#" \
26
+
-e "s#%INSTALL_PATH#$out#" \
27
-e 's#%USER_HOME#$HOME#' \
28
-e "s#%SYSTEM_java_io_tmpdir#/tmp#" \
29
+
-e "s#%JAVA%#${jre}/bin/java#"
0
0
0
30
mv $out/runplain.sh $out/bin/i2prouter-plain
31
mv $out/man $out/share/
32
chmod +x $out/bin/* $out/i2psvc
+39
pkgs/tools/networking/i2p/i2p.patch
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
--- a/installer/resources/runplain.sh
2
+
+++ b/installer/resources/runplain.sh
3
+
@@ -21,7 +21,7 @@
4
+
5
+
# Try using the Java binary that I2P was installed with.
6
+
# If it's not found, try looking in the system PATH.
7
+
-JAVA=$(which %JAVA_HOME/bin/java || which java)
8
+
+JAVA=%JAVA%
9
+
10
+
if [ -z $JAVA ] || [ ! -x $JAVA ]; then
11
+
echo "Error: Cannot find java." >&2
12
+
@@ -40,15 +40,4 @@
13
+
export JAVA_TOOL_OPTIONS="-Djava.awt.headless=true"
14
+
fi
15
+
JAVAOPTS="-Djava.net.preferIPv4Stack=${PREFERv4} -Djava.library.path=${I2P}:${I2P}/lib -Di2p.dir.base=${I2P} -DloggerFilenameOverride=logs/log-router-@.txt"
16
+
-(
17
+
- nohup ${JAVA} -cp \"${CP}\" ${JAVAOPTS} net.i2p.router.RouterLaunch > /dev/null 2>&1
18
+
-) &
19
+
-PID=$!
20
+
-
21
+
-if [ ! -z $PID ] && kill -0 $PID > /dev/null 2>&1 ; then
22
+
- echo "I2P started [$PID]" >&2
23
+
- echo $PID > "${I2PTEMP}/router.pid"
24
+
-else
25
+
- echo "I2P failed to start." >&2
26
+
- exit 1
27
+
-fi
28
+
+${JAVA} -cp \"${CP}\" ${JAVAOPTS} net.i2p.router.RouterLaunch
29
+
--- a/installer/resources/i2prouter
30
+
+++ b/installer/resources/i2prouter
31
+
@@ -49,7 +49,7 @@
32
+
33
+
# gettext - we look for it in the path
34
+
# fallback to echo is below, we can't set it to echo here.
35
+
-GETTEXT=$(which gettext > /dev/null 2>&1)
36
+
+GETTEXT=%gettext%
37
+
38
+
# Where to install the systemd service
39
+
SYSTEMD_SERVICE="/etc/systemd/system/${APP_NAME}.service"