Skip to content

Commit

Permalink
docker compile libuv
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemeowx2 committed Sep 8, 2018
1 parent c94146a commit f2eb6aa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ pipeline:
commands:
- mkdir build.linux && cd build.linux
- cmake ..
- make -j
- make -j$$(nproc)
lan-play-windows:
group: build
image: switch-lan-play-build:win
commands:
- mkdir build.win && cd build.win
- cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw32.cmake ..
- make -j
- make -j$$(nproc)
server:
group: build
image: node:alpine
Expand Down
2 changes: 1 addition & 1 deletion cmake/toolchain-mingw64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")

set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX i686-w64-mingw64)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)

# cross compilers to use for C and C++
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
Expand Down
20 changes: 12 additions & 8 deletions docker/Dockerfile.win
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ RUN apt update
RUN apt install -y cmake make
RUN apt install -y mingw-w64 unzip
COPY ./cmake/toolchain-mingw64.cmake /
RUN curl -L -o /tmp/libevent-2.1.8-stable.tar.gz https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
RUN tar xvf /tmp/libevent-2.1.8-stable.tar.gz -C /tmp
ENV HOST=i686-w64-mingw64
ENV TARGET=i686-w64-mingw64
ENV PREFIX=/usr/i686-w64-mingw64/
RUN cd /tmp/libevent-2.1.8-stable \
&& ./configure --host=$HOST --target=$TARGET --prefix=$PREFIX --disable-openssl --enable-shared=no \
&& make -j \
RUN curl -L -o /tmp/libev-v1.23.0.tar.gz https://github.com/libuv/libuv/archive/v1.23.0.tar.gz
RUN tar xvf /tmp/libev-v1.23.0.tar.gz -C /tmp
# I can't `make install` by using cmake, so ...
# RUN cd /tmp/libuv-1.23.0/build \
# && cmake -DCMAKE_TOOLCHAIN_FILE=/toolchain-mingw64.cmake -DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32/ ..
ENV HOST=x86_64-w64-mingw32
ENV TARGET=x86_64-w64-mingw32
ENV PREFIX=/usr/x86_64-w64-mingw32/
RUN cd /tmp/libuv-1.23.0 \
&& ./autogen.sh \
&& ./configure --host=$HOST --target=$TARGET --prefix=$PREFIX --disable-shared --enable-static \
&& make -j$(nproc) \
&& make install

0 comments on commit f2eb6aa

Please sign in to comment.