Skip to content

Commit 0f2fd3b

Browse files
authored
Sync master
2 parents b9bb7d8 + c2afb67 commit 0f2fd3b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1214
-9432
lines changed

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
6565
- job: Linux
6666
pool:
67-
vmImage: 'ubuntu-20.04'
67+
vmImage: 'ubuntu-22.04'
6868
strategy:
6969
matrix:
7070
GCC:

external_deps/build.sh

Lines changed: 60 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ LDFLAGS=''
8585

8686
log() {
8787
level="${1}"; shift
88-
printf '%s: %s\n' "${level^^}" "${@}" >&2
89-
[ "${level}" != 'error' ]
88+
printf '%s: %s\n' "${level}" "${@}" >&2
89+
[ "${level}" != 'ERROR' ]
9090
}
9191

9292
# Extract an archive into the given subdirectory of the build dir and cd to it
@@ -120,7 +120,7 @@ extract() {
120120
rmdir "${2}-dmg"
121121
;;
122122
*)
123-
log error "Unknown archive type for ${1}"
123+
log ERROR "Unknown archive type for ${1}"
124124
;;
125125
esac
126126
cd "${2}"
@@ -132,13 +132,13 @@ download() {
132132
while [ ! -f "${tarball_file}" ]; do
133133
if [ -z "${1:-}" ]
134134
then
135-
log error "No more mirror to download ${tarball_file} from"
135+
log ERROR "No more mirror to download ${tarball_file} from"
136136
fi
137137
local download_url="${1}"; shift
138138
log status "Downloading ${download_url}"
139139
if ! "${CURL}" -R -L --fail -o "${tarball_file}" "${download_url}"
140140
then
141-
log warning "Failed to download ${download_url}"
141+
log WARNING "Failed to download ${download_url}"
142142
rm -f "${tarball_file}"
143143
fi
144144
done
@@ -167,6 +167,7 @@ download_extract() {
167167
}
168168

169169
# Build pkg-config
170+
# Still needed, at least on macos, for opusfile
170171
build_pkgconfig() {
171172
local dir_name="pkg-config-${PKGCONFIG_VERSION}"
172173
local archive_name="${dir_name}.tar.gz"
@@ -178,7 +179,7 @@ build_pkgconfig() {
178179

179180
cd "${dir_name}"
180181
# The default -O2 is dropped when there's user-provided CFLAGS.
181-
CFLAGS="${CFLAGS} -O2" ./configure --host="${HOST}" --prefix="${PREFIX}" --libdir="${PREFIX}/lib" --with-internal-glib
182+
CFLAGS="${CFLAGS} -O2 -Wno-error=int-conversion" ./configure --host="${HOST}" --prefix="${PREFIX}" --libdir="${PREFIX}/lib" --with-internal-glib
182183
make
183184
make install
184185
}
@@ -198,7 +199,7 @@ build_nasm() {
198199
cp "${dir_name}/nasm" "${PREFIX}/bin"
199200
;;
200201
*)
201-
log error 'Unsupported platform for NASM'
202+
log ERROR 'Unsupported platform for NASM'
202203
;;
203204
esac
204205
}
@@ -340,7 +341,7 @@ build_sdl2() {
340341
case "${PLATFORM}" in
341342
windows-*-mingw)
342343
cd "${dir_name}"
343-
make install-package arch="${HOST}" prefix="${PREFIX}"
344+
cp -rv "${HOST}"/* "${PREFIX}/"
344345
;;
345346
windows-*-msvc)
346347
cd "${dir_name}"
@@ -357,7 +358,7 @@ build_sdl2() {
357358
local sdl2_lib_dir='lib/x64'
358359
;;
359360
*)
360-
log error 'Unsupported platform for SDL2'
361+
log ERROR 'Unsupported platform for SDL2'
361362
;;
362363
esac
363364

@@ -396,10 +397,16 @@ build_glew() {
396397
"${download_only}" && return
397398

398399
cd "${dir_name}"
400+
# env hack: CFLAGS.EXTRA is populated with some flags, which are sometimess necessary for
401+
# compilation, in the makefile with +=. If CFLAGS.EXTRA is set on the command line, those
402+
# += will be ignored. But if it is set via the environment, the two sources are actually
403+
# concatenated how we would like. Bash doesn't allow variables with a dot so use env.
404+
# The hack doesn't work on Mac's ancient Make (the env var has no effect), so we have to
405+
# manually re-add the required flags there.
399406
case "${PLATFORM}" in
400407
windows-*-*)
401-
make SYSTEM="linux-mingw${BITNESS}" GLEW_DEST="${PREFIX}" CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" STRIP="${HOST}-strip" LD="${LD}" CFLAGS.EXTRA="${CFLAGS}" LDFLAGS.EXTRA="${LDFLAGS}"
402-
make install SYSTEM="linux-mingw${BITNESS}" GLEW_DEST="${PREFIX}" CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" STRIP="${HOST}-strip" LD="${LD}" CFLAGS.EXTRA="${CFLAGS}" LDFLAGS.EXTRA="${LDFLAGS}"
408+
env CFLAGS.EXTRA="${CFLAGS}" LDFLAGS.EXTRA="${LDFLAGS}" make SYSTEM="linux-mingw${BITNESS}" GLEW_DEST="${PREFIX}" CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" STRIP="${HOST}-strip" LD="${LD}"
409+
env CFLAGS.EXTRA="${CFLAGS}" LDFLAGS.EXTRA="${LDFLAGS}" make install SYSTEM="linux-mingw${BITNESS}" GLEW_DEST="${PREFIX}" CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" STRIP="${HOST}-strip" LD="${LD}"
403410
mv "${PREFIX}/lib/glew32.dll" "${PREFIX}/bin/"
404411
rm "${PREFIX}/lib/libglew32.a"
405412
cp lib/libglew32.dll.a "${PREFIX}/lib/"
@@ -410,11 +417,12 @@ build_glew() {
410417
install_name_tool -id "@rpath/libGLEW.${GLEW_VERSION}.dylib" "${PREFIX}/lib/libGLEW.${GLEW_VERSION}.dylib"
411418
;;
412419
linux-*-*)
413-
make GLEW_DEST="${PREFIX}" CC="${CC}" LD="${CC}" CFLAGS.EXTRA="${CFLAGS}" LDFLAGS.EXTRA="${LDFLAGS}"
414-
make install GLEW_DEST="${PREFIX}" CC="${CC}" LD="${CC}" CFLAGS.EXTRA="${CFLAGS}" LDFLAGS.EXTRA="${LDFLAGS}" LIBDIR="${PREFIX}/lib"
420+
local strip="${HOST/-unknown-/-}-strip"
421+
env CFLAGS.EXTRA="${CFLAGS}" LDFLAGS.EXTRA="${LDFLAGS}" make GLEW_DEST="${PREFIX}" CC="${CC}" LD="${CC}" STRIP="${strip}"
422+
env CFLAGS.EXTRA="${CFLAGS}" LDFLAGS.EXTRA="${LDFLAGS}" make install GLEW_DEST="${PREFIX}" CC="${CC}" LD="${CC}" LIBDIR="${PREFIX}/lib"
415423
;;
416424
*)
417-
log error 'Unsupported platform for GLEW'
425+
log ERROR 'Unsupported platform for GLEW'
418426
;;
419427
esac
420428
}
@@ -460,7 +468,7 @@ build_jpeg() {
460468
# Other platforms can build but we need need to explicitly
461469
# set CMAKE_SYSTEM_NAME for CMAKE_CROSSCOMPILING to be set
462470
# and CMAKE_SYSTEM_PROCESSOR to not be ignored by cmake.
463-
log error 'Unsupported platform for JPEG'
471+
log ERROR 'Unsupported platform for JPEG'
464472
;;
465473
esac
466474

@@ -482,7 +490,7 @@ build_jpeg() {
482490
local SYSTEM_PROCESSOR='arm'
483491
;;
484492
*)
485-
log error 'Unsupported platform for JPEG'
493+
log ERROR 'Unsupported platform for JPEG'
486494
;;
487495
esac
488496

@@ -539,7 +547,7 @@ build_openal() {
539547
-DCMAKE_BUILD_TYPE=Release -DALSOFT_EXAMPLES=OFF)
540548
;;
541549
*)
542-
log error 'Unsupported platform for OpenAL'
550+
log ERROR 'Unsupported platform for OpenAL'
543551
;;
544552
esac
545553

@@ -695,7 +703,7 @@ build_wasisdk() {
695703
*-amd64-*)
696704
;;
697705
*)
698-
log error "wasi doesn't have release for ${PLATFORM}"
706+
log ERROR "wasi doesn't have release for ${PLATFORM}"
699707
;;
700708
esac
701709

@@ -735,7 +743,7 @@ build_wasmtime() {
735743
local WASMTIME_ARCH=aarch64
736744
;;
737745
*)
738-
log error "wasmtime doesn't have release for ${PLATFORM}"
746+
log ERROR "wasmtime doesn't have release for ${PLATFORM}"
739747
;;
740748
esac
741749

@@ -863,7 +871,7 @@ build_naclruntime() {
863871
local NACL_ARCH=x86-64
864872
;;
865873
*)
866-
log error 'Unsupported platform for naclruntime'
874+
log ERROR 'Unsupported platform for naclruntime'
867875
;;
868876
esac
869877

@@ -881,6 +889,30 @@ build_naclruntime() {
881889
cp "scons-out/opt-linux-${NACL_ARCH}/staging/sel_ldr" "${PREFIX}/nacl_loader"
882890
}
883891

892+
# Check for DLL dependencies on MinGW stuff. For MSVC platforms this is bad because it should work
893+
# without having MinGW installed. For MinGW platforms it is still bad because it might not work
894+
# when building with different flavors, or newer/older versions.
895+
build_depcheck() {
896+
"${download_only}" && return
897+
898+
case "${PLATFORM}" in
899+
windows-*-*)
900+
local good=true
901+
for dll in $(find "${PREFIX}/bin" -type f -name '*.dll'); do
902+
# https://wiki.unvanquished.net/wiki/MinGW#Built-in_DLL_dependencies
903+
if objdump -p "${dll}" | grep -oP '(?<=DLL Name: )(libgcc_s|libstdc|libssp|libwinpthread).*'; then
904+
echo "${dll} depends on above DLLs"
905+
good=false
906+
fi
907+
done
908+
"${good}" || log ERROR 'Built DLLs depend on MinGW runtime DLLs'
909+
;;
910+
*)
911+
log ERROR 'Unsupported platform for depcheck'
912+
;;
913+
esac
914+
}
915+
884916
# The import libraries generated by MinGW seem to have issues, so we use LLVM's version instead.
885917
# So LLVM must be installed, e.g. 'sudo apt install llvm'
886918
build_genlib() {
@@ -903,7 +935,7 @@ build_genlib() {
903935
local MACHINE='i386:x86-64'
904936
;;
905937
*)
906-
log error 'Unsupported platform for genlib'
938+
log ERROR 'Unsupported platform for genlib'
907939
;;
908940
esac
909941

@@ -917,7 +949,7 @@ build_genlib() {
917949
done
918950
;;
919951
*)
920-
log error 'Unsupported platform for genlib'
952+
log ERROR 'Unsupported platform for genlib'
921953
;;
922954
esac
923955
}
@@ -971,6 +1003,9 @@ build_install() {
9711003
find "${PKG_PREFIX}/bin" -name '*.dll' -execdir "${HOST}-strip" --strip-unneeded -- {} \;
9721004
find "${PKG_PREFIX}/lib" -name '*.a' -execdir rm -f -- {} \;
9731005
find "${PKG_PREFIX}/lib" -name '*.exp' -execdir rm -f -- {} \;
1006+
1007+
# Fix import lib paths to use MSVC-style instead of MinGW ones (see 'genlib' target)
1008+
find "${PKG_PREFIX}/lib/cmake" -name '*.cmake' -execdir sed -i -E 's@[.]dll[.]a\b@.lib@g' {} \;
9741009
;;
9751010
esac
9761011

@@ -1038,7 +1073,7 @@ common_setup_arch() {
10381073
CXXFLAGS+=' -march=armv7-a -mfpu=neon'
10391074
;;
10401075
*)
1041-
log error 'Unsupported platform'
1076+
log ERROR 'Unsupported platform'
10421077
;;
10431078
esac
10441079
}
@@ -1140,13 +1175,13 @@ setup_linux-arm64-default() {
11401175
common_setup linux aarch64-unknown-linux-gnu
11411176
}
11421177

1143-
base_windows_amd64_msvc_packages='pkgconfig zlib gmp nettle curl sdl2 glew png jpeg webp openal ogg vorbis opus opusfile naclsdk genlib'
1178+
base_windows_amd64_msvc_packages='zlib gmp nettle curl sdl2 glew png jpeg webp openal ogg vorbis opus opusfile naclsdk depcheck genlib'
11441179
all_windows_amd64_msvc_packages="${base_windows_amd64_msvc_packages}"
11451180

11461181
base_windows_i686_msvc_packages="${base_windows_amd64_msvc_packages}"
11471182
all_windows_i686_msvc_packages="${base_windows_amd64_msvc_packages}"
11481183

1149-
base_windows_amd64_mingw_packages='zlib gmp nettle curl sdl2 glew png jpeg webp openal ogg vorbis opus opusfile naclsdk'
1184+
base_windows_amd64_mingw_packages='zlib gmp nettle curl sdl2 glew png jpeg webp openal ogg vorbis opus opusfile naclsdk depcheck'
11501185
all_windows_amd64_mingw_packages="${base_windows_amd64_mingw_packages}"
11511186

11521187
base_windows_i686_mingw_packages="${base_windows_amd64_mingw_packages}"

external_deps/cygtar.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2
1+
#!/usr/bin/env python3
22
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
33
# Use of this source code is governed by a BSD-style license that can be
44
# found in the LICENSE file.
@@ -78,12 +78,12 @@ def CreateCygwinSymlink(filepath, target):
7878
lnk.close()
7979
break
8080
except EnvironmentError:
81-
print 'Try %d: Failed open %s -> %s\n' % (cnt, filepath, target)
81+
print('Try %d: Failed open %s -> %s\n' % (cnt, filepath, target))
8282

8383
# Verify the file was created
8484
if not os.path.isfile(filepath):
85-
print 'Try %d: Failed create %s -> %s\n' % (cnt, filepath, target)
86-
print 'Giving up.'
85+
print('Try %d: Failed create %s -> %s\n' % (cnt, filepath, target))
86+
print('Giving up.')
8787
return False
8888

8989
# Now set the system attribute bit so that Cygwin knows it's a link.
@@ -92,8 +92,8 @@ def CreateCygwinSymlink(filepath, target):
9292
return subprocess.call(['cmd', '/C', 'C:\\Windows\\System32\\attrib.exe',
9393
'+S', ToNativePath(filepath)])
9494
except EnvironmentError:
95-
print 'Try %d: Failed attrib %s -> %s\n' % (cnt, filepath, target)
96-
print 'Giving up.'
95+
print('Try %d: Failed attrib %s -> %s\n' % (cnt, filepath, target))
96+
print('Giving up.')
9797
return False
9898

9999

@@ -122,8 +122,8 @@ def CreateWin32Hardlink(filepath, targpath, try_mklink):
122122
shutil.copyfile(targpath, filepath)
123123
return False
124124
except EnvironmentError:
125-
print 'Try %d: Failed hardlink %s -> %s\n' % (cnt, filepath, targpath)
126-
print 'Giving up.'
125+
print('Try %d: Failed hardlink %s -> %s\n' % (cnt, filepath, targpath))
126+
print('Giving up.')
127127
return try_mklink
128128

129129

@@ -170,7 +170,7 @@ def __DumpInfo(self, tarinfo):
170170
if tarinfo.isfile():
171171
typeinfo = 'F'
172172
reable_size = ReadableSizeOf(tarinfo.size)
173-
print '%s %s : %s %s' % (reable_size, typeinfo, tarinfo.name, lnk)
173+
print('%s %s : %s %s' % (reable_size, typeinfo, tarinfo.name, lnk))
174174
return tarinfo
175175

176176
def __AddFile(self, tarinfo, fileobj=None):
@@ -232,7 +232,7 @@ def Add(self, filepath, prefix=None):
232232

233233
# At this point we only allow addition of "FILES"
234234
if not tarinfo.isfile():
235-
print 'Failed to add non real file: %s' % filepath
235+
print('Failed to add non real file: %s' % filepath)
236236
return False
237237

238238
# Now check if it is a Cygwin style link disguised as a file.
-1.14 KB
Binary file not shown.
-1.03 KB
Binary file not shown.
-23.7 KB
Binary file not shown.
-8.22 KB
Binary file not shown.

pkg/daemon_src.dpkdir/scripts/engine.shader

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -28,46 +28,3 @@ gfx/2d/bigchars
2828
rgbgen vertex
2929
}
3030
}
31-
32-
lights/defaultDynamicLight
33-
{
34-
{
35-
stage attenuationMapZ
36-
map lights/mkintsquarelight1a
37-
edgeClamp
38-
}
39-
{
40-
stage attenuationMapXY
41-
forceHighQuality
42-
map lights/round
43-
colored
44-
zeroClamp
45-
}
46-
}
47-
48-
lights/defaultPointLight
49-
{
50-
// this will also be the falloff for any
51-
// point light shaders that don't specify one
52-
lightFalloffImage lights/mkintsquarelight1a
53-
{
54-
stage attenuationMapXY
55-
forceHighQuality
56-
map lights/squarelight1
57-
colored
58-
zeroClamp
59-
}
60-
}
61-
62-
lights/defaultProjectedLight
63-
{
64-
// by default, stay bright almost all the way to the end
65-
lightFalloffImage lights/mkintsquarelight1b
66-
{
67-
stage attenuationMapXY
68-
forceHighQuality
69-
map lights/squarelight1
70-
colored
71-
zeroClamp
72-
}
73-
}

0 commit comments

Comments
 (0)