Skip to content

Commit

Permalink
Single stage build, support stdc++fs for GCC8, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
strattondrs committed Jan 9, 2023
1 parent 5a40150 commit 049f931
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 21 deletions.
24 changes: 3 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,14 @@
#syntax = docker/dockerfile:1.4.0

FROM quay.io/centos/centos:stream AS buildbase
RUN yum -y install tar unzip glibc.i686 gcc dos2unix make gcc-c++ && yum clean all && rm -rf /var/cache/yum
RUN yum -y install tar unzip glibc.i686 gcc dos2unix cmake gcc-c++ && yum clean all && rm -rf /var/cache/yum
RUN mkdir -p ~/uox3

FROM buildbase AS buildjs
COPY automake.sh /root/uox3
COPY spidermonkey /root/uox3/spidermonkey/
RUN find /root/uox3 -name \* -type f -exec dos2unix {} \;
RUN cd /root/uox3 && ./automake.sh 1
CMD ["/bin/bash"]

FROM buildbase AS buildzlib
COPY automake.sh /root/uox3
COPY zlib /root/uox3/zlib/
RUN find /root/uox3 -name \* -type f -exec dos2unix {} \;
RUN cd /root/uox3 && ./automake.sh 2
CMD ["/bin/bash"]

FROM buildbase AS buildapp
WORKDIR /root/uox3
RUN mkdir -p spidermonkey && mkdir -p zlib
COPY automake.sh .
COPY source source/
COPY . .
RUN find /root/uox3 -name \* -type f -exec dos2unix {} \;
COPY --from=buildjs /root/uox3/spidermonkey spidermonkey/
COPY --from=buildzlib /root/uox3/zlib zlib/
RUN cd /root/uox3 && ./automake.sh 3
RUN cd /root/uox3 && ./automake.sh
CMD ["/bin/bash"]

FROM quay.io/centos/centos:stream
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Join the [UOX3 Discord](https://discord.gg/uBAXxhF) for support and/or a quick c
> * **Linux (Debian-based)** - Run `sudo apt install build-essential cmake` in a Terminal: (or use your Linux distro's package manager)
> * **FreeBSD** - Run `pkg install cmake` in a Terminal. Alternatively, build `cmake` via ports if desired.
> * **macOS** - Download [Xcode](https://apps.apple.com/us/app/xcode/id497799835?mt=12) (for building with an IDE) via the App Store, and/or [CMake](https://cmake.org/download/) (for command-line builds)
> * **Docker** - Ensure that it is downloaded and installed (Windows) or installed from your package manager
</details>
<details>
Expand Down Expand Up @@ -157,6 +158,11 @@ Join the [UOX3 Discord](https://discord.gg/uBAXxhF) for support and/or a quick c
</details>
</details>
<details>
<summary><strong>Docker</strong></summary>

Build and tag the image from the root of the repository like `docker buildx build --progress=plain -t uox3 .`
</details>

---
## UOX3 Compiled! Now what?
Expand Down
1 change: 1 addition & 0 deletions make/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ target_link_libraries(uox3 PRIVATE
$<$<PLATFORM_ID:Windows>:Kernel32>
$<$<PLATFORM_ID:Linux>:pthread>
$<$<PLATFORM_ID:FreeBSD>:pthread>
$<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:stdc++fs>
)

# *************************************************************************
Expand Down

0 comments on commit 049f931

Please sign in to comment.