1DOLLY 72TOOLCHAIN zero-ad-deps3REQUIRES HOST runtime@04REQUIRES HOST audio@05REQUIRES HOST display@06REQUIRES HOST input@07REQUIRES HOST download@08REQUIRES HOST http@09REQUIRES HOST upload@01011# Build-only: the libraries the 0 A.D. engine links, and pkgconf for its premake12# scripts, built from the pinned upstream sources of build-sources.tsv.13FROM /v0.1.2/demos/zero-ad/Dollyfile-openal-build 9b9af98eca62cb22d08c8c987ae1f0947f0b624cbc4b5188f2de63060116a50114COPY /v0.1.2/demos/sdl2/Dollyfile-sdl2 a6b39d45ce2763ebe31f99bb42c1784769fb9ec66752f7148cb0900d339422e1 /usr/include/SDL2 /usr/include/SDL215COPY /v0.1.2/demos/sdl2/Dollyfile-sdl2 a6b39d45ce2763ebe31f99bb42c1784769fb9ec66752f7148cb0900d339422e1 /usr/lib/libSDL2.a /usr/lib/libSDL2.a16REQUIRES HEADER libc17REQUIRES HEADER cpp18REQUIRES HEADER zlib19REQUIRES LIB z20REQUIRES TOOL cc21REQUIRES TOOL c++22REQUIRES TOOL ar23REQUIRES TOOL cmake24REQUIRES TOOL make25REQUIRES TOOL gzip26REQUIRES TOOL tar27REQUIRES TOOL patch28REQUIRES TOOL find29REQUIRES TOOL cp30REQUIRES TOOL ln31REQUIRES TOOL mkdir3233SOURCE /v0.1.2/dist/static/zero-ad-build/deps.tar.gz 70cd7adb14d05e83a61b096a3515cf11b93dd95b2d31ef705896998d8712ac77 /tmp/zad/deps.tar.gz34SLOP gzip -dc /tmp/zad/deps.tar.gz | tar -xf - -C /35# Licences of the libraries the engine links; zero-ad copies them.36COPY /v0.1.2/demos/sdl2/Dollyfile-sdl2 a6b39d45ce2763ebe31f99bb42c1784769fb9ec66752f7148cb0900d339422e1 /usr/share/licenses/SDL2 /usr/share/licenses/SDL237FOLDER /usr/share/licenses3839# Upstream builds pkgconf with Meson; these are the values its configure step finds here.40FILE /tmp/zad/pkgconf/libpkgconf/config.h41    #define HAVE_STRLCAT 142    #define HAVE_STRLCPY 143    #define HAVE_STRNDUP 144    #define HAVE_REALLOCARRAY 145    #define HAVE_DECL_STRLCAT 146    #define HAVE_DECL_STRLCPY 147    #define HAVE_DECL_STRNDUP 148    #define HAVE_DECL_REALLOCARRAY 149    #define HAVE_DECL_PLEDGE 050    #define HAVE_DECL_UNVEIL 051    #define PACKAGE_NAME "pkgconf"52    #define PACKAGE_VERSION "2.5.1"53    #define PACKAGE_BUGREPORT "https://todo.sr.ht/~kaniini/pkgconf"54    #define PKG_DEFAULT_PATH "/usr/lib/pkgconfig:/usr/share/pkgconfig"55    #define SYSTEM_INCLUDEDIR "/usr/include"56    #define SYSTEM_LIBDIR "/usr/lib"57    #define PERSONALITY_PATH "/usr/lib/pkgconfig/personality.d:/usr/share/pkgconfig/personality.d"5859# Libraries without a build system usable here (autotools; ICU's port list) compile60# every source of their directories, as Emscripten's ports and libsodium's build.zig do.61FILE /tmp/zad/objects.mk62    SOURCES := $(foreach d,$(DIRS),$(wildcard $(d)/*.c $(d)/*.cpp))63    OBJECTS := $(patsubst /tmp/zad/%,/tmp/zad/objects/%.o,$(SOURCES))64    $(LIB): $(OBJECTS)65    	ar rcs $@ $^66    /tmp/zad/objects/%.c.o: /tmp/zad/%.c67    	@mkdir -p $(dir $@)68    	cc $(CFLAGS) -c $< -o $@69    /tmp/zad/objects/%.cpp.o: /tmp/zad/%.cpp70    	@mkdir -p $(dir $@)71    	c++ $(CXXFLAGS) -c $< -o $@7273FILE /tmp/zad/build.slop74    set -ex75    cd /tmp/zad/pkgconf76    cc -O2 -std=gnu99 -D_BSD_SOURCE -D_DEFAULT_SOURCE -DPKGCONFIG_IS_STATIC -I. libpkgconf/*.c cli/main.c cli/getopt_long.c cli/renderer-msvc.c -o /usr/bin/pkgconf77    ln -s pkgconf /usr/bin/pkg-config78    cmake_build() {79      name=$180      shift81      cmake -S /tmp/zad/$name -B /tmp/zad/build/$name -DCMAKE_SYSTEM_NAME=Dolly -DCMAKE_SYSTEM_PROCESSOR=wasm64 \82        -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release \83        -DBUILD_SHARED_LIBS=OFF -DCMAKE_POLICY_VERSION_MINIMUM=3.5 "$@"84      cmake --build /tmp/zad/build/$name -j485      cmake --install /tmp/zad/build/$name86    }87    cmake_build png -DPNG_SHARED=OFF -DPNG_TESTS=OFF -DPNG_TOOLS=OFF -DPNG_EXECUTABLES=OFF88    cmake_build freetype -DFT_DISABLE_BZIP2=ON -DFT_DISABLE_HARFBUZZ=ON -DFT_DISABLE_BROTLI=ON -DFT_REQUIRE_ZLIB=ON -DFT_REQUIRE_PNG=ON89    cmake_build ogg -DINSTALL_DOCS=OFF -DBUILD_TESTING=OFF90    cmake_build vorbis91    cmake_build fmt -DFMT_TEST=OFF -DFMT_DOC=OFF92    cmake_build xml2 -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_TESTS=OFF -DLIBXML2_WITH_PROGRAMS=OFF \93      -DLIBXML2_WITH_THREADS=OFF -DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_HTTP=OFF -DLIBXML2_WITH_ICONV=OFF -DLIBXML2_WITH_ZLIB=ON94    icu=/tmp/zad/icu95    # ICU knows no Dolly platform: its charset default is the one hook it offers, and96    # its bundled double-conversion lists architectures (wasm32 but not wasm64).97    sed 's/defined(__EMSCRIPTEN__) || defined(__wasm32__)$/defined(__EMSCRIPTEN__) || defined(__wasm32__) || defined(__wasm64__)/' $icu/i18n/double-conversion-utils.h > /tmp/zad/dcu.h98    grep -q __wasm64__ /tmp/zad/dcu.h && mv /tmp/zad/dcu.h $icu/i18n/double-conversion-utils.h99    icu_flags="-O2 -std=c++11 -DU_USING_ICU_NAMESPACE=0 -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit -DU_STATIC_IMPLEMENTATION -DU_CHARSET_IS_UTF8=1 -I$icu/common"100    make -f /tmp/zad/objects.mk -j4 LIB=/usr/lib/libicuuc.a DIRS=$icu/common "CXXFLAGS=$icu_flags -DU_COMMON_IMPLEMENTATION=1"101    make -f /tmp/zad/objects.mk -j4 LIB=/usr/lib/libicudata.a DIRS=$icu/stubdata "CXXFLAGS=$icu_flags"102    make -f /tmp/zad/objects.mk -j4 LIB=/usr/lib/libicui18n.a DIRS=$icu/i18n "CXXFLAGS=$icu_flags -I$icu/i18n -DU_I18N_IMPLEMENTATION=1"103    mkdir -p /usr/include/unicode104    cp $icu/common/unicode/* $icu/i18n/unicode/* /usr/include/unicode/105    sodium=/tmp/zad/sodium/src/libsodium106    cp /tmp/zad/sodium/builds/msvc/version.h $sodium/include/sodium/version.h107    sodium_dirs=108    for directory in $(find $sodium -type d); do sodium_dirs="$sodium_dirs $directory"; done109    make -f /tmp/zad/objects.mk -j4 LIB=/usr/lib/libsodium.a "DIRS=$sodium_dirs" "CFLAGS=-O2 -I$sodium/include/sodium -DCONFIGURED=1 -D_GNU_SOURCE=1 -DNATIVE_LITTLE_ENDIAN=1 -DHAVE_ATOMIC_OPS=1 -DHAVE_C11_MEMORY_FENCES=1 -DHAVE_GCC_MEMORY_FENCES=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_SYS_MMAN_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_RANDOM_H=1 -DHAVE_MMAP=1 -DHAVE_MLOCK=1 -DHAVE_MADVISE=1 -DHAVE_MPROTECT=1 -DHAVE_RAISE=1 -DHAVE_SYSCONF=1 -DHAVE_GETENTROPY=1 -DHAVE_GETPID=1 -DHAVE_POSIX_MEMALIGN=1 -DHAVE_NANOSLEEP=1 -DHAVE_CLOCK_GETTIME=1 -DHAVE_EXPLICIT_BZERO=1 -DHAVE_LINUX_COMPATIBLE_GETRANDOM -fvisibility=hidden -fno-strict-aliasing -fwrapv"110    cp -R $sodium/include/sodium $sodium/include/sodium.h /usr/include/111    # ENet keeps its protocol; dolly.c replaces the unix.c and win32.c socket backends.112    cp /tmp/zad/enet-dolly.c /tmp/zad/enet/dolly.c113    rm /tmp/zad/enet/unix.c /tmp/zad/enet/win32.c114    make -f /tmp/zad/objects.mk -j4 LIB=/usr/lib/libenet.a DIRS=/tmp/zad/enet "CFLAGS=-O2 -I/tmp/zad/enet/include"115    cp -R /tmp/zad/enet/include/enet /usr/include/116    cp -R /tmp/zad/boost/boost /usr/include/117SLOP time slop -e /tmp/zad/build.slop118119# pkg-config descriptions of SDL2 (copied without its own) and of the libraries120# built without their upstream build system.121FILE /usr/lib/pkgconfig/sdl2.pc122    Name: sdl2123    Description: Simple DirectMedia Layer124    Version: 2.32.10125    Cflags: -I/usr/include/SDL2126    Libs: -lSDL2 -lm127FILE /usr/lib/pkgconfig/zlib.pc128    Name: zlib129    Description: zlib compression library130    Version: 1.3.2131    Libs: -lz132FILE /usr/lib/pkgconfig/libcurl.pc133    Name: libcurl134    Description: Dolly's libcurl over the HTTP broker135    Version: 8.21.0136    Libs: -lcurl137FILE /usr/lib/pkgconfig/icu-uc.pc138    Name: icu-uc139    Description: International Components for Unicode: Common and Data libraries140    Version: 68.2141    Cflags: -DU_STATIC_IMPLEMENTATION142    Libs: -licuuc -licudata143FILE /usr/lib/pkgconfig/icu-i18n.pc144    Name: icu-i18n145    Description: International Components for Unicode: Internationalization library146    Version: 68.2147    Requires: icu-uc148    Libs: -licui18n149FILE /usr/lib/pkgconfig/libsodium.pc150    Name: libsodium151    Description: A modern and easy-to-use crypto library152    Version: 1.0.20153    Libs: -lsodium154FILE /usr/lib/pkgconfig/libenet.pc155    Name: libenet156    Description: Low-latency UDP networking library supporting optional reliability157    Version: 1.3.18158    Libs: -lenet159SLOP pkg-config --exists zlib libcurl icu-i18n libsodium libenet libpng freetype2 vorbisfile fmt libxml-2.0 openal sdl2160161# Probes for test/0ad-enet-browser.mjs and test/0ad-openal-browser.mjs.162SLOP mkdir -p /usr/libexec/zero-ad163SLOP cc -O1 /tmp/zad/enet-check.c -lenet -o /usr/libexec/zero-ad/enet-check164SLOP c++ -O1 /tmp/zad/openal-check.cpp -lopenal -lm -o /usr/libexec/zero-ad/openal-check165FOLDER /usr/libexec/zero-ad166167EXPORTS TOOL pkgconf168EXPORTS TOOL pkg-config169EXPORTS FOLDER zero-ad-pkgconfig /usr/lib/pkgconfig170EXPORTS HEADER png /usr/include/png.h171EXPORTS HEADER pngconf /usr/include/pngconf.h172EXPORTS HEADER pnglibconf /usr/include/pnglibconf.h173EXPORTS HEADER libpng16 /usr/include/libpng16174EXPORTS HEADER freetype2 /usr/include/freetype2175EXPORTS HEADER ogg /usr/include/ogg176EXPORTS HEADER vorbis /usr/include/vorbis177EXPORTS HEADER fmt /usr/include/fmt178EXPORTS HEADER libxml2 /usr/include/libxml2179EXPORTS HEADER unicode /usr/include/unicode180EXPORTS HEADER sodium /usr/include/sodium181EXPORTS HEADER sodium.h /usr/include/sodium.h182EXPORTS HEADER enet /usr/include/enet183EXPORTS HEADER boost /usr/include/boost184EXPORTS LIB png16 /usr/lib/libpng16.a185EXPORTS LIB freetype /usr/lib/libfreetype.a186EXPORTS LIB ogg /usr/lib/libogg.a187EXPORTS LIB vorbis /usr/lib/libvorbis.a188EXPORTS LIB vorbisfile /usr/lib/libvorbisfile.a189EXPORTS LIB fmt /usr/lib/libfmt.a190EXPORTS LIB xml2 /usr/lib/libxml2.a191EXPORTS LIB icuuc /usr/lib/libicuuc.a192EXPORTS LIB icui18n /usr/lib/libicui18n.a193EXPORTS LIB icudata /usr/lib/libicudata.a194EXPORTS LIB sodium /usr/lib/libsodium.a195EXPORTS LIB enet /usr/lib/libenet.a196197ENTRY /bin/foreground -i /bin/slop198