-
Notifications
You must be signed in to change notification settings - Fork 5
/
config.sh
executable file
·144 lines (120 loc) · 5.32 KB
/
config.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#! /usr/bin/env bash
## If you need to use a different JVM, JDK, or other utility from
# build.sh, set it in this file, for example:
uname=$(uname)
# Third-party builders should always override this in config_override.sh
if [ -z "$SIGNER" ]; then
export [email protected]
fi
if [ -z "$I2P_LIBS" ]; then
if [ -d "$HOME/i2p/lib/" ]; then
I2P_LIBS="$HOME/i2p/lib/"
fi
if [ -d "$LOCALAPPDATA/i2p/lib/" ]; then
I2P_LIBS="$LOCALAPPDATA/i2p/lib/"
fi
if [ -d "/usr/share/i2p/lib/" ]; then
I2P_LIBS="/usr/share/i2p/lib/"
fi
fi
if [ -z "$I2P_SNARK_DIR" ]; then
if [ -d "$HOME/.i2p/i2psnark" ]; then
I2P_SNARK_DIR="$HOME/.i2p/i2psnark"
fi
if [ -d "$LOCALAPPDATA/i2p/i2psnark/" ]; then
I2P_SNARK_DIR="$LOCALAPPDATA/i2p/i2psnark/"
fi
if [ -d "/var/lib/i2p/i2p-config/i2psnark/" ]; then
I2P_SNARK_DIR="/var/lib/i2p/i2p-config/i2psnark/"
fi
fi
NSIS_PATH="/c/Program Files (x86)/NSIS/Bin"
PATH="$NSIS_PATH:$PATH:$NSIS_PATH/"
export PATH="$NSIS_PATH:$PATH:$NSIS_PATH/"
wget_download(){
which powershell && powershell Invoke-WebRequest $@ && return
wget $@
}
makensisi(){
which makensis && makensis $@ && return
which wsl && wsl makensis $@ && return
}
make_make(){
which make && make $@ && return
which wsl && wsl make $@ && return
}
if [[ -n "$IS_WSL" || -n "$WSL_DISTRO_NAME" ]]; then
JAVA_HOME=$(java -XshowSettings:properties -version 2>&1 | findstr "java.home" | sed 's| java.home = ||g')
export JAVA_HOME="$JAVA_HOME"
PATH="$JAVA_HOME/bin/:$PATH:$JAVA_HOME/bin/"
export PATH="$JAVA_HOME/bin/:$PATH:$JAVA_HOME/bin/"
HOST=win32
export HOST=win32
fi
if [ "${uname}" != "Linux" ]; then
JAVA_HOME=$(java -XshowSettings:properties -version 2>&1 | findstr "java.home" | sed 's| java.home = ||g')
export JAVA_HOME="$JAVA_HOME"
PATH="$JAVA_HOME/bin/:$PATH:$JAVA_HOME/bin/"
export PATH="$JAVA_HOME/bin/:$PATH:$JAVA_HOME/bin/"
HOST=win32
export HOST=win32
fi
### TESTING:
## This isn't a default install location, obviously, it's where I unzipped it.
## It won't work for you unless you kurtly tell Windows that your name is `user`
## every time you make an account, like I do.
#PATH="/c/Users/user/Downloads/openjdk-20_windows-x64_bin/jdk-20/bin/:$PATH:/c/Users/user/Downloads/openjdk-20_windows-x64_bin/jdk-20/bin/"
#export PATH="/c/Users/user/Downloads/openjdk-20_windows-x64_bin/jdk-20/bin/:$PATH:/c/Users/user/Downloads/openjdk-20_windows-x64_bin/jdk-20/bin/"
#JAVA_HOME=/c/Users/user/Downloads/openjdk-20_windows-x64_bin/jdk-20
#export JAVA_HOME=/c/Users/user/Downloads/openjdk-20_windows-x64_bin/jdk-20
## Other potential values(NOT exhaustive):
#export PATH="$PATH:/c/Program Files/Eclipse Adoptium/jdk-17.0.3/bin/"
#export JAVA_HOME="/c/Program Files/Eclipse Adoptium/jdk-17.0.3"
#export PATH="$PATH:/c/Program Files/OpenJDK/jdk-17.0.3/bin/"
#export JAVA_HOME="/c/Program Files/OpenJDK/jdk-17.0.3"
#BREAKS!
#export PATH=/c/Program Files/GraalVM/graalvm-ce-java17-22.0.0.2/bin
#export JAVA_HOME=/c/Program Files/GraalVM/graalvm-ce-java17-22.0.0.2
#BREAKS!
# might be fun to learn why this is broken
#WORKS WELL! GETS UPDATES AS SOON AS ORACLE! VIABLE ALTERNATIVE!
#export PATH="$PATH:/c/Program Files/Amazon Corretto/jdk17.0.3_6/bin/"
#export JAVA_HOME="/c/Program Files/Amazon Corretto/jdk17.0.3_6"
#WORKS WELL! GETS UPDATES AS SOON AS ORACLE! VIABLE ALTERNATIVE!
# These are all things I built the package with today(April 20, 2022, idk)
# Which will determine, of course, which java compilers you use and where
# your JAVA_HOME(and thus your bootclasspath jars and stuff) come from.
# So for you reddit nerds who are all into graalVM or whatever, this might
# be where you go to mess with that.
## Until 1.7.4, releases were built using Eclipse Adoptium OpenJDK
# but it lags behind a day or two in security updates which did become
# a major issue in April 2022. At this point it was migrated to Oracle's
# JDK distribution which was more up to date. Should you prefer, or simply
# wish to experiment with a different JVM, copy this file to `config_overrides.sh`
# and add your JAVA_HOME and $PATH changes.
# You can also use this to temporarily add applications into the PATH that are
# required to build this if you do not wish to edit your PATH across the entire
# Windows session, and for setting ANT_HOME
if [ -d "/c/apache-ant-"* ]; then
ANT_HOME=$(ls -d /c/apache-ant-*)
export ANT_HOME="$ANT_HOME"
export PATH="$PATH:$ANT_HOME/bin/"
fi
if [ -d "/c/mktorrent"* ]; then
MKTORRENT_HOME=$(ls -d /c/mktorrent*)
export MKTORRENT_HOME="$MKTORRENT_HOME"
export PATH="$PATH:$MKTORRENT_HOME/bin/"
fi
if [[ -n "$IS_WSL" || -n "$WSL_DISTRO_NAME" ]]; then
PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
export PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
PATH="$PATH:C:\Users\user\Downloads\m4-1.4.14-1-bin\bin"
export PATH="$PATH:C:\Users\user\Downloads\m4-1.4.14-1-bin\bin"
fi
if [ "${uname}" != "Linux" ]; then
PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
export PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
PATH="$PATH:C:\Users\user\Downloads\m4-1.4.14-1-bin\bin"
export PATH="$PATH:C:\Users\user\Downloads\m4-1.4.14-1-bin\bin"
fi