-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmakerelease.sh
executable file
·283 lines (200 loc) · 9.04 KB
/
makerelease.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
#!/bin/bash
dir="$1"
tag="$2"
if [ ! -d "${dir}" ]; then
echo "${dir}: Directory not found"
echo "Usage: $(basename $0) <glfwpath> <version>"
exit 1
fi
if [ -z "${tag}" ]; then
echo "No version specified"
echo "Usage: $(basename $0) <glfwpath> <version>"
exit 1
fi
if [ -e ${tag} ]; then
echo "$(basename $0): ${tag}: tree already exists"
exit 1
fi
srcdir=glfw-${tag}
w32dir=glfw-${tag}.bin.WIN32
w64dir=glfw-${tag}.bin.WIN64
macdir=glfw-${tag}.bin.MACOS
mkdir -p ${tag}/${srcdir}
mkdir -p ${tag}/build/docs
mkdir -p ${tag}/${w32dir}/docs
mkdir -p ${tag}/${w32dir}/include/GLFW
mkdir -p ${tag}/${w64dir}/docs
mkdir -p ${tag}/${w64dir}/include/GLFW
mkdir -p ${tag}/${macdir}/docs
mkdir -p ${tag}/${macdir}/include/GLFW
if ! ( git archive --remote "${dir}/.git" ${tag} | tar x -C ${tag}/${srcdir} ); then
echo "${tag}: failed to export source tree"
exit 1
fi
rm -rf ${tag}/${srcdir}/.[a-z]*
cp build-macos.sh build-windows.bat ${tag}/
cat > ${tag}/makepackages.sh <<EOF
#!/bin/bash
target_src_gz=glfw-${tag}.tar.gz
target_src_bz2=glfw-${tag}.tar.bz2
target_src_zip=glfw-${tag}.zip
target_bin_WIN32=glfw-${tag}.bin.WIN32.zip
target_bin_WIN64=glfw-${tag}.bin.WIN64.zip
target_bin_MACOS=glfw-${tag}.bin.MACOS.zip
rm -f \$target_src_gz \$target_src_bz2 \$target_src_zip
rm -f \$target_bin_WIN32
rm -f \$target_bin_WIN64
rm -f \$target_bin_MACOS
for dir in ${srcdir} ${w32dir} ${w64dir} ${macdir}; do
find \${dir} -name '*.swo' -o -name '*.swp' -exec rm {} \;
chmod -R -x+X \${dir}
done
if ! tar -czf \$target_src_gz ${srcdir}; then
echo "\${target_src_gz}: failed to create package"
exit 1
fi
if ! tar -cjf \$target_src_bz2 ${srcdir}; then
echo "\${target_src_bz2}: failed to create package"
exit 1
fi
if ! zip -rq \$target_src_zip ${srcdir}; then
echo "\${target_src_zip}: failed to create package"
exit 1
fi
if ! zip -rq \$target_bin_WIN32 ${w32dir}; then
echo "\${target_bin_WIN32}: failed to create package"
exit 1
fi
if ! zip -rq \$target_bin_WIN64 ${w64dir}; then
echo "\${target_bin_WIN64}: failed to create package"
exit 1
fi
if ! zip -rq \$target_bin_MACOS ${macdir}; then
echo "\${target_bin_MACOS}: failed to create package"
exit 1
fi
EOF
chmod +x ${tag}/makepackages.sh
cat > ${tag}/${macdir}/README.md <<EOF
# GLFW binaries for macOS
This archive contains documentation, headers and pre-compiled static and dynamic
libraries for GLFW ${tag}, targeting macOS 10.8 and later. Both Intel
(x86\_64), Apple Silicon (arm64) and Universal binaries are provided.
EOF
cat > ${tag}/${w32dir}/README.md <<EOF
# GLFW binaries for 32-bit Windows
This archive contains documentation, headers, pre-compiled static libraries,
import libraries and DLLs for GLFW ${tag}.
Binaries for the following compilers are included
- Visual C++ 2022 (built with 17.9.0)
- Visual C++ 2019 (built with 16.11.34)
- Visual C++ 2017 (built with 15.9.60)
- Visual C++ 2015 (built with 14.0.25431.01)
- Visual C++ 2013 (built with 12.0.40629.00)
- MinGW-w64 (built with 13.2.0-win32-dwarf-msvcrt)
Binaries for Visual C++ 2010 and 2012 are no longer included. These versions
are no longer supported by Microsoft and should not be used. This release of
GLFW can still be compiled with them if necessary, but future releases will drop
this support.
Binaries for the original MinGW distribution are no longer included. MinGW
appears to no longer be maintained and should not be used. The much more
capable MinGW-w64 project should be used instead. This release of GLFW can
still be compiled with the original MinGW if necessary, but future releases will
drop this support.
## Binaries for Visual C++
All binaries for Visual C++ 2017 and earlier are compatible with Windows XP, but
this is not supported by Visual C++ 2019. This support has been deprecated by
Microsoft and GLFW will also drop support for Windows XP in a future release.
### GLFW as a DLL
To use GLFW as a DLL, link against the \`glfw3dll.lib\` file for your
environment. This will add a load time dependency on \`glfw3.dll\`. The
remaining files in the same directory are not needed.
This DLL is built in release mode for the Multithreaded DLL runtime library.
There is also a GLFW DLL and import library pair in the \`lib-static-ucrt\`
directory. These are built with Visual C++ 2019 and the static Multithreaded
runtime library.
### GLFW as a static library
To use GLFW as a static library, link against \`glfw3.lib\` if your application
is using the Multithreaded DLL runtime library, or \`glfw3_mt.lib\` if it is
using the static Multithreaded runtime library. The remaining files in the same
directory are not needed.
The static libraries are built in release mode and do not contain debug
information but can still be linked with the debug versions of the runtime
library.
## Binaries for MinGW-w64
### GLFW as a DLL
To use GLFW as a DLL, link against the \`libglfw3dll.a\` file for your
environment. This will add a load time dependency on \`glfw3.dll\`. The
remaining files in the same directory are not needed.
The DLLs are built in release mode.
The DLLs depend on the \`msvcrt.dll\` C runtime library. There is also a GLFW
DLL and import library in the \`lib-static-ucrt\` directory that is built with
Visual C++ 2019 and statically linked against the UCRT.
All DLLs in this archive provide the same ABI and can be used as drop-in
replacements for one another, as long as the C runtime library they depend on is
available.
### GLFW as a static library
To use GLFW as a static library, link against the \`libglfw3.a\` file for your
environment. The other files in the same directory are not needed.
The library is built in release mode and do not contain debug information.
EOF
cat > ${tag}/${w64dir}/README.md <<EOF
# GLFW binaries for 64-bit Windows
This archive contains documentation, headers, pre-compiled static libraries,
import libraries and DLLs for GLFW ${tag}.
Binaries for the following compilers are included
- Visual C++ 2022 (built with 17.9.0)
- Visual C++ 2019 (built with 16.11.34)
- Visual C++ 2017 (built with 15.9.60)
- Visual C++ 2015 (built with 14.0.25431.01)
- Visual C++ 2013 (built with 12.0.40629.00)
- MinGW-w64 (built with 13.2.0-win32-dwarf-msvcrt)
Binaries for Visual C++ 2012 are no longer included. This version is no longer
supported by Microsoft and should not be used. This release of GLFW can still
be compiled with it if necessary, but future releases will drop this support.
## Binaries for Visual C++
All binaries for Visual C++ 2017 and earlier are compatible with Windows XP, but
this is not supported by Visual C++ 2019. This support has been deprecated by
Microsoft and GLFW will also drop support for Windows XP in a future release.
### GLFW as a DLL
To use GLFW as a DLL, link against the \`glfw3dll.lib\` file for your
environment. This will add a load time dependency on \`glfw3.dll\`. The
remaining files in the same directory are not needed.
This DLL is built in release mode for the Multithreaded DLL runtime library.
There is also a GLFW DLL and import library pair in the \`lib-static-ucrt\`
directory. These are built with Visual C++ 2019 and the static Multithreaded
runtime library.
### GLFW as a static library
To use GLFW as a static library, link against \`glfw3.lib\` if your application
is using the Multithreaded DLL runtime library, or \`glfw3_mt.lib\` if it is
using the static Multithreaded runtime library. The remaining files in the same
directory are not needed.
The static libraries are built in release mode and do not contain debug
information but can still be linked with the debug versions of the runtime
library.
## Binaries for MinGW-w64
### GLFW as a DLL
To use GLFW as a DLL, link against the \`libglfw3dll.a\` file for your
environment. This will add a load time dependency on \`glfw3.dll\`. The
remaining files in the same directory are not needed.
The DLLs are built in release mode.
The DLLs depend on the \`msvcrt.dll\` C runtime library. There is also a GLFW
DLL and import library in the \`lib-static-ucrt\` directory that is built with
Visual C++ 2019 and statically linked against the UCRT.
All DLLs in this archive provide the same ABI and can be used as drop-in
replacements for one another, as long as the C runtime library they depend on is
available.
### GLFW as a static library
To use GLFW as a static library, link against the \`libglfw3.a\` file for your
environment. The other files in the same directory are not needed.
The library is built in release mode and do not contain debug information.
EOF
cp ${tag}/${srcdir}/include/GLFW/glfw3.h ${tag}/${w32dir}/include/GLFW/
cp ${tag}/${srcdir}/include/GLFW/glfw3native.h ${tag}/${w32dir}/include/GLFW/
cp ${tag}/${srcdir}/LICENSE.md ${tag}/${w32dir}/
cp ${tag}/${srcdir}/include/GLFW/glfw3.h ${tag}/${w64dir}/include/GLFW/
cp ${tag}/${srcdir}/include/GLFW/glfw3native.h ${tag}/${w64dir}/include/GLFW/
cp ${tag}/${srcdir}/LICENSE.md ${tag}/${w64dir}/
cp ${tag}/${srcdir}/include/GLFW/glfw3.h ${tag}/${macdir}/include/GLFW/
cp ${tag}/${srcdir}/include/GLFW/glfw3native.h ${tag}/${macdir}/include/GLFW/
cp ${tag}/${srcdir}/LICENSE.md ${tag}/${macdir}/