File tree Expand file tree Collapse file tree 5 files changed +75
-5
lines changed
Expand file tree Collapse file tree 5 files changed +75
-5
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ argv=(" $@ " )
4+ if [ -z " ${argv[0]} " ]
5+ then
6+ echo " Usage: $0 <docker git image: rtcwpro/rtcwpro> <branch name>"
7+ exit 1
8+ fi
9+
10+ RTCWPRO_SRC=$( dirname ` pwd` )
11+
12+
13+ # build the files from github branch (these are baked into the image)
14+ docker build \
15+ --build-arg BRANCH=" ${argv[1]} " \
16+ -t ${argv[0]} :${argv[1]} \
17+ -f dockerfiles/rtcwpro-compile-18 ./dockerfiles
18+
19+ # build the files from the local volume inside the container
20+ # artifacts go to <repo>/build/
21+ docker run -it \
22+ -v $RTCWPRO_SRC :/home/compile/code \
23+ --workdir /home/compile/code/src \
24+ ${argv[0]} :${argv[1]} \
25+ make all
26+
27+ rm -rf $RTCWPRO_SRC /build/objs
28+
29+ mv $RTCWPRO_SRC /build/rtcwpro/rtcwpro_bin.pk3 $RTCWPRO_SRC /build/rtcwpro/rtcwpro_bin-$( date +%Y%m%d) .pk3
30+ mv $RTCWPRO_SRC /build/rtcwpro/rtcwpro_assets.pk3 $RTCWPRO_SRC /build/rtcwpro/rtcwpro_assets-$( date +%Y%m%d) .pk3
31+ mv $RTCWPRO_SRC /build/rtcwpro/rtcwpro_models.pk3 $RTCWPRO_SRC /build/rtcwpro/rtcwpro_models-$( date +%Y%m%d) .pk3
32+ mv $RTCWPRO_SRC /build/rtcwpro/rtcwpro_xhairs.pk3 $RTCWPRO_SRC /build/rtcwpro/rtcwpro_xhairs-$( date +%Y%m%d) .pk3
33+
34+ # load a shell into the image
35+ # docker run -it -v /var/run/docker.sock:/var/run/docker.sock \
36+ # -v $(dirname `pwd`):/home/compile/code \
37+ # --workdir /home/compile/code/src \
38+ # snappas/rtcwpro:develop /bin/bash
39+
40+
41+ # bash build-image-git-server.sh ${argv[0]} ${argv[1]}
Original file line number Diff line number Diff line change 1+ FROM ubuntu:18.04
2+
3+ ARG BRANCH
4+ ENV BRANCH=${BRANCH}
5+
6+ ENV DEBIAN_FRONTEND noninteractive
7+
8+ RUN useradd -ms /bin/bash compile
9+
10+ RUN dpkg --add-architecture i386 && \
11+ apt-get update && \
12+ apt-get -y upgrade && \
13+ apt-get install -y wget libc6:i386 zip \
14+ unzip git gdb-multiarch gcc cmake perl curl gcc-multilib g++-multilib \
15+ autoconf libtool nasm mingw-w64 mingw-w64-tools g++ \
16+ libgl-dev libsdl2-dev:i386 clang-tools-10 lld-10
17+
18+ RUN ln -s /usr/bin/clang-10 /usr/bin/clang && \
19+ ln -s /usr/bin/clang-cl-10 /usr/bin/clang-cl && \
20+ ln -s /usr/bin/llvm-lib-10 /usr/bin/llvm-lib && \
21+ ln -s /usr/bin/lld-link-10 /usr/bin/lld-link && \
22+ ln -s /usr/bin/llvm-rc-10 /usr/bin/llvm-rc
23+
24+ RUN mkdir /output
25+ RUN chown compile:compile /output
26+
27+ USER compile
28+ WORKDIR /home/compile
Original file line number Diff line number Diff line change @@ -83,11 +83,11 @@ make -j
8383make install
8484
8585autoreconf -i
86- CFLAGS=" -m32" ./configure --prefix=${JANSSON_DIR} /build-win --target=i686-w64-mingw32 --host=i686-w64-mingw32
86+ CFLAGS=" -m32" LDFLAGS= " -static-libgcc -static-libstdc++ " ./configure --prefix=${JANSSON_DIR} /build-win --target=i686-w64-mingw32 --host=i686-w64-mingw32
8787make -j
8888make install
8989cd $JANSSON_DIR
90- cd build-win
90+ cd build-win/bin
9191gendef libjansson-4.dll
9292i686-w64-mingw32-dlltool -d libjansson-4.def -l libjansson-4.lib
9393fi
@@ -141,13 +141,13 @@ mkdir build-win
141141cd build
142142CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 cmake -G" Unix Makefiles" ..
143143make -j
144- cp ../* .h .
144+ cp ../src/ * .h .
145145
146146cd ../build-win
147147echo " ${CMAKEMINGW} " > toolchain.cmake
148148cmake -G" Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=./toolchain.cmake -DCMAKE_INSTALL_PREFIX=${LIBJPEG_DIR} /build-win ..
149149LDFLAGS=" -static -static-libgcc -static-libstdc++" make -j
150- cp ../* .h .
150+ cp ../src/ * .h .
151151gendef libjpeg-62.dll
152152i686-w64-mingw32-dlltool -d libjpeg-62.def -l libjpeg-62.lib
153153fi
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ dependencies:
77 mkdir -p ../build
88 cp ../deps/libjpeg-turbo/build-win/libjpeg-62.dll ../build
99 cp ../deps/curl-win/curl/bin/libcurl.dll ../build
10+ cp ../deps/jansson/build-win/bin/libjansson-4.dll ../build
1011
1112binaries :
1213 mkdir -p ../build/rtcwpro
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ client: NASM := nasm
125125client : CFLAGS := $(CFLAGSREL ) -m32 -DBOTLIB -DDLL_ONLY -I../../deps/libunwind/build/include/ -I../../deps/curl/build/include/ -I../../deps/libjpeg-turbo/build/
126126client : CPPFLAGS := $(CFLAGS )
127127client : LDFLAGS := \
128- -m32 -ldl -lm -lstdc++ -lSDL2 -lc
128+ -m32 -ldl -lm -lstdc++ -lSDL2 -lc -pthread
129129client : $(CLOBJS )
130130 $(CC ) -g -o wolfMP.x86 $(CLOBJS ) ../../deps/libunwind/build/lib/libunwind.a ../../deps/curl/build/lib/libcurl.a ../../deps/openssl/build/lib/libssl.a ../../deps/openssl/build/lib/libcrypto.a ../../deps/libjpeg-turbo/build/libturbojpeg.a $(LDFLAGS )
131131 # strip -s wolfMP.x86
You can’t perform that action at this time.
0 commit comments