summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fankhauser hiddenalpha.ch2023-09-29 02:43:45 +0200
committerAndreas Fankhauser hiddenalpha.ch2023-09-29 02:43:45 +0200
commit03082d8efdaadbc95f57161979d7d4c62181a0c8 (patch)
tree04734ddb01edc3a4a07d96a5daecb0b967181325
parenta63dfdd054ec94bc88bf46f742d8dbed4d246c0c (diff)
downloadgateleen-resclone-03082d8efdaadbc95f57161979d7d4c62181a0c8.zip
gateleen-resclone-03082d8efdaadbc95f57161979d7d4c62181a0c8.tar.gz
(qemu) Begun support for windoof.
-rw-r--r--contrib/build-env-setup/README.md55
1 files changed, 47 insertions, 8 deletions
diff --git a/contrib/build-env-setup/README.md b/contrib/build-env-setup/README.md
index e1007e3..ec41e9a 100644
--- a/contrib/build-env-setup/README.md
+++ b/contrib/build-env-setup/README.md
@@ -70,6 +70,18 @@ true \
&& HOST= \
&& true
+### Config for alpine with mingw
+true \
+ && PKGS_TO_ADD="git make mingw-w64-gcc curl tar musl-dev cmake autoconf automake libtool m4" \
+ && PKGS_TO_DEL="cmake autoconf automake libtool m4" \
+ && SUDO="/home/$USER/mysudo" \
+ && PKGINIT=true \
+ && PKGADD="$SUDO apk add" \
+ && PKGDEL="$SUDO apk del" \
+ && PKGCLEAN="$SUDO apk clean" \
+ && HOST=x86_64-w64-mingw32 \
+ && true
+
## make, install
@@ -80,9 +92,11 @@ true \
&& LIBARCHIVE_VERSION="3.6.2" \
&& CURL_VERSION="8.3.0" \
&& CJSON_VERSION="1.7.15" \
+ && PCRE_VERSION="8.45" \
\
&& WORKDIR="/home/${USER}/work" \
&& INSTALL_ROOT="/usr/${HOST:-local}" \
+ && if test -n "$HOST"; then HOST_="${HOST:?}-" ;fi \
&& CJSON_URL="https://github.com/DaveGamble/cJSON/archive/refs/tags/v${CJSON_VERSION:?}.tar.gz" \
&& CJSON_SRCTGZ="/var/tmp/cJSON-${CJSON_VERSION:?}.tgz" \
&& CJSON_BINTGZ="${CJSON_SRCTGZ%.*}-bin.tgz" \
@@ -93,6 +107,9 @@ true \
&& LIBARCHIVE_URL="https://github.com/libarchive/libarchive/archive/refs/tags/v${LIBARCHIVE_VERSION:?}.tar.gz" \
&& LIBARCHIVE_SRCTGZ="/var/tmp/libarchive-${LIBARCHIVE_VERSION:?}.tgz" \
&& LIBARCHIVE_BINTGZ="${LIBARCHIVE_SRCTGZ%.*}-bin.tgz" \
+ && PCRE_URL="https://sourceforge.net/projects/pcre/files/pcre/${PCRE_VERSION:?}/pcre-${PCRE_VERSION:?}.tar.gz/download" \
+ && PCRE_SRCTGZ="/var/tmp/pcre-${PCRE_VERSION:?}.tgz" \
+ && PCRE_BINTGZ="${PCRE_SRCTGZ%.*}-bin.tgz" \
\
&& ${PKGINIT:?} && ${PKGADD:?} $PKGS_TO_ADD \
&& printf '\n Download Dependency Sources\n\n' \
@@ -108,6 +125,10 @@ true \
&& echo "Download ${CURL_URL:?}" \
&& curl -sSLo "${CURL_SRCTGZ:?}" "${CURL_URL:?}" \
;fi \
+ && if test ! -e "${PCRE_SRCTGZ:?}"; then true \
+ && echo "Download ${PCRE_URL:?}" \
+ && curl -sSLo "${PCRE_SRCTGZ:?}" "${PCRE_URL:?}" \
+ ;fi \
&& if test ! -e "${CJSON_BINTGZ:?}"; then (true \
&& printf '\n Build cJSON\n\n' \
&& cd /tmp \
@@ -123,26 +144,27 @@ true \
&& ln -s libcJSON.so.${CJSON_VERSION:?} libcJSON.so.${MIN:?} \
&& ln -s libcJSON.so.${MIN:?} libcJSON.so.${MAJ} \
) \
- && ar rcs build/lib/libcJSON.a build/obj/cJSON.o \
+ && ${HOST_}ar rcs build/lib/libcJSON.a build/obj/cJSON.o \
&& cp -t build/. LICENSE README.md \
&& cp -t build/include/. cJSON.h \
&& rm -rf build/obj \
&& (cd build && tar --owner=0 --group=0 -czf "${CJSON_BINTGZ:?}" *) \
&& cd /tmp \
&& rm -rf "cJSON-${CJSON_VERSION:?}" \
- && $SUDO tar -C /usr/local -xzf "${CJSON_BINTGZ:?}" \
+ && $SUDO tar -C "${INSTALL_ROOT:?}" -xzf "${CJSON_BINTGZ:?}" \
);fi \
&& if test ! -e "${LIBARCHIVE_BINTGZ}"; then (true \
&& printf '\n Build libarchive\n\n' \
&& cd /tmp \
&& tar xf "${LIBARCHIVE_SRCTGZ:?}" \
&& cd "libarchive-${LIBARCHIVE_VERSION:?}" \
- && cmake -D CMAKE_INSTALL_PREFIX="${PWD:?}/build/usr_local" . \
+ && if test -n "$HOST"; then HORSCHT="-D CC=$HOST-cc" ;fi \
+ && cmake -D CMAKE_INSTALL_PREFIX="${PWD:?}/build/usr_local" $HORSCHT . \
&& make -j$(nproc) && make install \
&& rm -rf build/usr_local/lib/pkgconfig \
&& (cd build/usr_local && tar --owner=0 --group=0 -czf "${LIBARCHIVE_BINTGZ:?}" *) \
&& cd /tmp && rm -rf "libarchive-${LIBARCHIVE_VERSION:?}" \
- && $SUDO tar -C /usr/local -xzf "${LIBARCHIVE_BINTGZ:?}" \
+ && $SUDO tar -C "${INSTALL_ROOT:?}" -xzf "${LIBARCHIVE_BINTGZ:?}" \
);fi \
&& if test ! -e "${CURL_BINTGZ:?}"; then (true \
&& printf '\n Build curl\n\n' \
@@ -150,21 +172,38 @@ true \
&& tar xf "${CURL_SRCTGZ:?}" \
&& cd "curl-curl-${CURL_VERSION_UGLY:?}" \
&& autoreconf -fi \
- && ./configure --prefix="$PWD/build/usr_local" --enable-http --with-nghttp2 --with-nghttp3 --disable-alt-svc --disable-ares --disable-aws --disable-basic-auth --disable-bearer-auth --disable-bindlocal --disable-cookies --disable-curldebug --disable-dateparse --disable-debug --disable-dependency-tracking --disable-dict --disable-digest-auth --disable-dnsshuffle --disable-doh --disable-ech --disable-file --disable-form-api --disable-ftp --disable-get-easy-options --disable-gopher --disable-headers-api --disable-hsts --disable-http-auth --disable-imap --enable-ipv6 --disable-kerberos-auth --disable-largefile --disable-ldap --disable-ldaps --disable-libcurl-option --disable-libtool-lock --enable-manual --disable-mime --disable-mqtt --disable-negotiate-auth --disable-netrc --enable-ntlm --enable-ntlm-wb --disable-openssl-auto-load-config --disable-optimize --disable-pop3 --disable-progress-meter --enable-proxy --disable-pthreads --disable-rt --disable-rtsp --disable-smb --enable-smtp --disable-socketpair --disable-sspi --disable-symbol-hiding --disable-telnet --disable-tftp --disable-threaded-resolver --disable-tls-srp --disable-unix-sockets --disable-verbose --disable-versioned-symbols --disable-warnings --disable-websockets --disable-werror --without-schannel --without-secure-transport --without-amissl --without-ssl --without-openssl --without-gnutls --without-mbedtls --without-wolfssl --without-bearssl --without-rustls --without-test-nghttpx --without-test-caddy --without-test-httpd --without-pic --without-aix-soname --without-gnu-ld --without-sysroot --without-mingw1-deprecated --without-hyper --without-zlib --without-brotli --without-zstd --without-ldap-lib --without-lber-lib --without-gssapi-includes --without-gssapi-libs --without-gssapi --without-default-ssl-backend --without-random --without-ca-bundle --without-ca-path --without-ca-fallback --without-libpsl --without-libgsasl --without-librtmp --without-winidn --without-libidn2 --without-ngtcp2 --without-quiche --without-msh3 --without-zsh-functions-dir --without-fish-functions-dir CFLAGS=-fPIC \
+ && if test -n "$HOST"; then HORSCHT="--host=${HOST:?}";fi \
+ && ./configure --prefix="$PWD/build/usr_local" --enable-http --with-nghttp2 --with-nghttp3 --disable-alt-svc --disable-ares --disable-aws --disable-basic-auth --disable-bearer-auth --disable-bindlocal --disable-cookies --disable-curldebug --disable-dateparse --disable-debug --disable-dependency-tracking --disable-dict --disable-digest-auth --disable-dnsshuffle --disable-doh --disable-ech --disable-file --disable-form-api --disable-ftp --disable-get-easy-options --disable-gopher --disable-headers-api --disable-hsts --disable-http-auth --disable-imap --enable-ipv6 --disable-kerberos-auth --disable-largefile --disable-ldap --disable-ldaps --disable-libcurl-option --disable-libtool-lock --enable-manual --disable-mime --disable-mqtt --disable-negotiate-auth --disable-netrc --enable-ntlm --enable-ntlm-wb --disable-openssl-auto-load-config --disable-optimize --disable-pop3 --disable-progress-meter --enable-proxy --disable-pthreads --disable-rt --disable-rtsp --disable-smb --enable-smtp --disable-socketpair --disable-sspi --disable-symbol-hiding --disable-telnet --disable-tftp --disable-threaded-resolver --disable-tls-srp --disable-unix-sockets --disable-verbose --disable-versioned-symbols --disable-warnings --disable-websockets --disable-werror --without-schannel --without-secure-transport --without-amissl --without-ssl --without-openssl --without-gnutls --without-mbedtls --without-wolfssl --without-bearssl --without-rustls --without-test-nghttpx --without-test-caddy --without-test-httpd --without-pic --without-aix-soname --without-gnu-ld --without-sysroot --without-mingw1-deprecated --without-hyper --without-zlib --without-brotli --without-zstd --without-ldap-lib --without-lber-lib --without-gssapi-includes --without-gssapi-libs --without-gssapi --without-default-ssl-backend --without-random --without-ca-bundle --without-ca-path --without-ca-fallback --without-libpsl --without-libgsasl --without-librtmp --without-winidn --without-libidn2 --without-ngtcp2 --without-quiche --without-msh3 \
+ --without-zsh-functions-dir --without-fish-functions-dir CFLAGS=-fPIC $HORSCHT \
&& make clean && make -j$(nproc) && make install \
&& (cd build/usr_local && rm -rf share/aclocal bin/curl-config lib/libcurl.la lib/pkgconfig) \
&& (cd build/usr_local && tar --owner=0 --group=0 -czf "${CURL_BINTGZ:?}" *) \
&& cd /tmp \
&& rm -rf "curl-curl-${CURL_VERSION_UGLY:?}" \
- && $SUDO tar -C /usr/local -xzf "${CURL_BINTGZ:?}" \
+ && $SUDO tar -C "${INSTALL_ROOT:?}" -xzf "${CURL_BINTGZ:?}" \
+ );fi \
+ && if test -n "$HOST" -a ! -e "${PCRE_BINTGZ:?}"; then (true \
+ && printf '\n Build curl\n\n' \
+ && cd /tmp \
+ && tar xf "${PCRE_SRCTGZ:?}" \
+ && cd "pcre-${PCRE_VERSION:?}" \
+ && ./configure --prefix="$PWD/build/usr_local" --host=${HOST:?} --disable-cpp --enable-utf \
+ && make clean && make -j$(nproc) && make install \
+ && (cd build/usr_local \
+ && rm -rf lib/libpcre.la lib/pkgconfig lib/libpcreposix.la bin/pcre-config \
+ && tar --owner=0 --group=0 -czf "${PCRE_BINTGZ:?}" * \
+ ) \
+ && cd /tmp \
+ && rm -rf "pcre-${PCRE_VERSION:?}" \
+ && $SUDO tar -C "${INSTALL_ROOT:?}" -xzf "${PCRE_BINTGZ:?}" \
);fi \
&& printf '\n Build project itself\n\n' \
&& mkdir -p "${WORKDIR:?}" && cd "${WORKDIR:?}" \
&& git clone --depth 42 --branch "${GIT_TAG:?}" https://github.com/hiddenalpha/GateleenResclone.git . \
&& git config advice.detachedHead false \
&& git checkout --detach "${GIT_TAG:?}" \
- && make clean && make -j$(nproc) \
- && if test -z "$HOST"; then $SUDO make install; fi \
+ && if test -n "$HOST"; then HORSCHT="TOOLCHAIN=mingw CC=$HOST-cc LD=$HOST-ld AR=$HOST-ar BINEXT=.exe LIBSEXT=.lib" ;fi \
+ && make clean $HORSCHT && make -j$(nproc) $HORSCHT \
&& find . -not -wholename './dist*' -delete \
&& ${PKGDEL:?} $PKGS_TO_DEL && ${PKGCLEAN:?} \
&& dirOfDistBundle="$(realpath dist)" \