From 9bd0f45f8295a8326c5b7728cc1ff0348a30dbe4 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 12 Jan 2019 04:06:05 +0100 Subject: [PATCH] WIP --- build-windows.dockerfile | 5 +++++ build-windows.sh | 4 ++++ entrypoint.sh | 28 ++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 build-windows.dockerfile create mode 100755 build-windows.sh create mode 100755 entrypoint.sh diff --git a/build-windows.dockerfile b/build-windows.dockerfile new file mode 100644 index 0000000..47552ec --- /dev/null +++ b/build-windows.dockerfile @@ -0,0 +1,5 @@ +FROM ubuntu:18.04 +RUN apt-get update && apt-get install -y build-essential mingw-w64 cmake unzip git +WORKDIR /app +COPY . . +ENTRYPOINT ["./entrypoint.sh"] diff --git a/build-windows.sh b/build-windows.sh new file mode 100755 index 0000000..fe7c772 --- /dev/null +++ b/build-windows.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +docker build -t uhub:windows -f build-windows.dockerfile . +docker run --rm --name uhub-windows-build -v $(pwd)/dist:/app/dist uhub:windows diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..9fd0d3e --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +mkdir -p dist +git submodule update --init + +cd thirdparty/sqlite +x86_64-w64-mingw32-gcc -shared -DWIN64 -DNDEBUG -D_WINDOWS -D_USRDLL -DNO_TCL -D_CRT_SECURE_NO_DEPRECATE -DTHREADSAFE=1 -DTEMP_STORE=1 -DSQLITE_MAX_EXPR_DEPTH=0 -I. shell.c sqlite3.c -o sqlite3.dll -Wl,--out-implib,libsqlite3.dll.a +cp sqlite3.h sqlite3ext.h /usr/x86_64-w64-mingw32/include/ +cp sqlite3.dll /usr/x86_64-w64-mingw32/lib/ +cp sqlite3.dll /app/dist/ +cd /app + +cd thirdparty/openssl +mkdir dist +./Configure --prefix=/app/thirdparty/openssl/dist shared mingw64 --cross-compile-prefix=x86_64-w64-mingw32- +make depend -j$(nproc) +make -j$(nproc) +make -j$(nproc) install +cp dist/lib/libcrypto.dll.a dist/lib/libssl.dll.a /usr/x86_64-w64-mingw32/lib/ +cp -R dist/include/openssl /usr/x86_64-w64-mingw32/include/openssl +cp dist/bin/libeay32.dll dist/bin/ssleay32.dll /app/dist/ +cd /app + +cmake -DCMAKE_TOOLCHAIN_FILE=toolchain-mingw64.cmake . +make -j$(nproc) +echo 'Welcome to uHub' > dist/motd.txt +cp doc/plugins.conf doc/uhub.conf doc/users.conf doc/rules.txt dist/ +cp uhub.exe uhub-passwd.exe mod_*.dll dist/