-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathconfigure.win
More file actions
executable file
·116 lines (88 loc) · 3.11 KB
/
configure.win
File metadata and controls
executable file
·116 lines (88 loc) · 3.11 KB
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
# configure script that automatically downloads jasp-desktop/Common if it is missing.
# to manual specify a location for jasp-desktop/Common and not download it, do
#
# options(configure.vars = c(jaspBase = "INCLUDE_DIR='<path>/github/jasp-desktop/Common'"))
# install.packages("jaspBase", ...)
DOWNLOAD_SUCCESS=1
COMMON_DIR="inst/include/Common"
if [ "${INCLUDE_DIR}" ]; then
echo "Found INCLUDE_DIR: ${INCLUDE_DIR}"
DOWNLOAD_SUCCESS=0
PKG_CXXFLAGS="-I\"${INCLUDE_DIR}\""
else
PKG_CXXFLAGS='-I"../inst/include/Common"'
mkdir -p 'inst/include'
COMMON_FILES=(
enumutilities.h
columntype.h
columntype.cpp
stringutils.h
utils.h
utils.cpp
)
JSON_FILES=(
allocator.h
assertions.h
config.h
forwards.h
json.h
json_features.h
json_reader.cpp
json_tool.h
json_value.cpp
json_valueiterator.inl
json_writer.cpp
reader.h
value.h
version.h
writer.h
)
if [ "${GITHUB_JASP_DESKTOP_FILES}" == "" ]; then
GITHUB_JASP_DESKTOP_FILES="https://raw.githubusercontent.com/boutinb/jasp-desktop/refs/heads/removeColumnEncoderModule"
fi
rm -rf "${COMMON_DIR}"
mkdir -p "${COMMON_DIR}"
mkdir -p "${COMMON_DIR}/json"
echo "seeing if curl is available"
if curl --version 2>&1 >/dev/null; then
echo 'Downloading jasp-desktop/Common with curl'
for i in "${COMMON_FILES[@]}"; do
curl --silent --output "${COMMON_DIR}/${i}" "${GITHUB_JASP_DESKTOP_FILES}/Common/${i}"
done
for i in "${JSON_FILES[@]}"; do
curl --silent --output "${COMMON_DIR}/json/${i}" "${GITHUB_JASP_DESKTOP_FILES}/Common/json/${i}"
done
DOWNLOAD_SUCCESS=$?
fi
if [ "${DOWNLOAD_SUCCESS}" -ne "0" ]; then
echo "seeing if wget is available"
if wget --version 2>&1 >/dev/null; then
echo 'Downloading jasp-desktop/Common with wget'
for i in "${COMMON_FILES[@]}"; do
wget --quiet -O "${COMMON_DIR}/${i}" "${GITHUB_JASP_DESKTOP_FILES}/Common/${i}"
done
for i in "${JSON_FILES[@]}"; do
wget --quiet -O "${COMMON_DIR}/json/${i}" "${GITHUB_JASP_DESKTOP_FILES}/Common/json/${i}"
done
DOWNLOAD_SUCCESS=$?
fi
fi
fi
if [ "${DOWNLOAD_SUCCESS}" -ne "0" ]; then
printf "Installing jaspBase failed because the required C++ dependency jasp-desktop/Common is missing.\n\
Normally this is downloaded automatically if either git, curl, or wget is available, but apparently this failed.\n\
Either download \"https://github.com/jasp-stats/jasp-desktop/Common\" manually and specify the path through configure.args,\
download git, or download curl.\n\
If you're specifying configure.args manually, note that you must provide the location of jasp-desktop/Common and the\
location of the parent directory (e.g., the default is '-I\"../inst/include/jasp-desktop/Common\" -I\"../inst/include\"'))
"
exit 1
fi
SRC_SOURCES="$(cd src/ && ls *.cpp | tr '\n' ' ')"
JASPCOMMON_SOURCES="../${COMMON_DIR}/columntype.cpp"
if [ "${JASP_R_INTERFACE_LIBRARY}" != "" ]; then
PKG_CXXFLAGS=-DJASP_R_INTERFACE_LIBRARY\ ${PKG_CXXFLAGS}
fi
PKG_CXXFLAGS=-DRCPP_NO_SUGAR\ ${PKG_CXXFLAGS}
sed -e "s|@cppflags@|${PKG_CXXFLAGS}|" -e "s|@src_sources@|${SRC_SOURCES}|" -e "s|@jaspCommon_sources@|${JASPCOMMON_SOURCES}|" src/Makevars.in > src/Makevars.win
exit 0