Skip to content

Commit

Permalink
Merge branch 'dev' into fix/bestorders-overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
smk762 committed Dec 19, 2024
2 parents 770c168 + 24aa744 commit c0f5cfe
Show file tree
Hide file tree
Showing 9 changed files with 584 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git
.github
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,4 @@ atomic_legacy_imgui
.vscode/settings.json
.vscode/tasks.json
bundled
build.log
121 changes: 121 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
FROM docker.io/ubuntu:20.04 AS base

LABEL authors=<[email protected]>

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
ENV SHELL=/bin/bash
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

WORKDIR /build/komodo-wallet-desktop
COPY . /build/komodo-wallet-desktop
RUN rm -rf .git build logs tmp

RUN apt-get update -y && \
apt-get install -y build-essential \
libgtk-3-dev \
libgdk-pixbuf2.0-dev \
libglib2.0-dev \
autoconf \
automake \
libtool \
libgl1-mesa-dev \
ca-certificates \
zip \
tar \
sudo \
python3-dev \
python3-venv \
python3-pip \
python-is-python3 \
curl \
wget \
zstd \
software-properties-common \
lsb-release \
libpulse-dev \
libtool \
autoconf \
unzip \
libfuse2 \
libssl-dev \
libxkbcommon-x11-0 \
libxcb-icccm4 \
libxcb-image0 \
qt5-gtk-platformtheme \
libxcb1-dev \
libxcb-keysyms1-dev \
libxcb-render-util0-dev \
libxcb-xinerama0 \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxcb-image0-dev \
libxcb-randr0-dev \
libxcb-xinerama0-dev \
libxcb-icccm4-dev \
libxcb-sync-dev \
libxcb-present-dev \
libxcb-dri3-dev \
libxcb-glx0-dev \
libxcomposite-dev \
libxdamage-dev \
libxrandr-dev \
libxcursor-dev \
libxi-dev \
libxtst-dev \
libx11-xcb-dev \
libxrender-dev \
gtk2-engines-pixbuf \
libgtk2.0-0 \
libgtk2.0-dev \
libgbm-dev \
git \
libnss3-dev \
libnspr4-dev \
libgstreamer-plugins-base1.0-dev \
libasound2-dev

RUN git config --global --add safe.directory /build/komodo-wallet-desktop
RUN cd /build/komodo-wallet-desktop && ./ci_tools_atomic_dex/ci_scripts/linux_script_docker.sh


ENV CXX=clang++-12
ENV CC=clang-12
#ENV CXXFLAGS="-stdlib=libc++ -std=c++20"
#ENV LDFLAGS="-stdlib=libc++"

# Install Qt
RUN python3 -m venv /build/.venv && \
/build/.venv/bin/pip install aqtinstall==3.1.1 && \
/build/.venv/bin/python -m aqt install-qt linux desktop 5.15.2 -O $HOME/Qt -b https://qt-mirror.dannhauer.de/ -m qtcharts debug_info qtwebengine

ENV DEBIAN_FRONTEND=noninteractive
ENV SHELL=/bin/bash
ENV QT_INSTALL_CMAKE_PATH=/root/Qt/5.15.2/gcc_64/lib/cmake
ENV QT_ROOT=/root/Qt/5.15.2
ENV PATH=/root/Qt/5.15.2/gcc_64/bin:$PATH


# Install Nim
ENV CHOOSENIM_CHOOSE_VERSION=1.6.2
RUN /build/komodo-wallet-desktop/ci_tools_atomic_dex/ci_scripts/choosenim.sh -y && \
export PATH=/root/.nimble/bin:$PATH && \
chmod +x /root/.choosenim/toolchains/nim-1.6.2/bin/*
ENV PATH=/root/.nimble/bin:$PATH

RUN cd /build/komodo-wallet-desktop/ci_tools_atomic_dex/vcpkg-repo && ./bootstrap-vcpkg.sh


# USAGE: ###
#
# To build the build container
# docker build -t kw-build-container . --progress=plain --no-cache
#
# To build the app
# ./docker-build-linux.sh
#
# To enter container for debugging
# docker run -it kw-build-container bash
###

CMD [ "bash" ]
52 changes: 52 additions & 0 deletions ci_tools_atomic_dex/ci_scripts/linux_script_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash


# Update `ninja` to the latest compatible version (>= 1.10.2)
wget https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip
sudo unzip -o ninja-linux.zip -d /usr/bin/
sudo chmod +x /usr/bin/ninja

# Install LLVM/Clang
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 12

# Set Clang as the default compiler
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 777
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-12 777

# Set GCC/G++ 9 as the fallback compiler
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 777
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 777

# Install libc++ for C++20 support
sudo apt-get install -y libc++-11-dev libc++abi-11-dev

# Set environment variables for Clang
export CXX=clang++-12
export CC=clang-12

# Install CMake 3.27.1
wget https://github.com/Kitware/CMake/releases/download/v3.27.1/cmake-3.27.1-linux-x86_64.tar.gz
tar -xvzf cmake-3.27.1-linux-x86_64.tar.gz
sudo cp -r cmake-3.27.1-linux-x86_64/* /usr/local/
sudo cp -r cmake-3.27.1-linux-x86_64/* /usr/
cmake --version

## tar
wget --timeout=10 --tries=3 https://ftp.gnu.org/gnu/tar/tar-1.32.tar.gz || wget --timeout=10 --tries=3 https://mirrors.sjtug.sjtu.edu.cn/gnu/tar/tar-1.32.tar.gz
tar xvf tar-1.32.tar.gz
cd tar-1.32
export FORCE_UNSAFE_CONFIGURE=1
./configure
sudo make -j install
sudo ln -sf /bin/tar /usr/local/bin/tar
sudo update-alternatives --install /usr/bin/tar tar /usr/local/bin/tar 777

# get libwally
git clone https://github.com/KomodoPlatform/libwally-core.git --recurse-submodules
cd libwally-core
./tools/autogen.sh
./configure --disable-shared
sudo make -j3 install
cd ..
8 changes: 6 additions & 2 deletions ci_tools_atomic_dex/dmg-packager/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# Edited for KomodoPlatform/atomicDEX-Pro

set -x

# Original version is by Andy Maloney
# http://asmaloney.com/2013/07/howto/packaging-a-mac-os-x-application-using-a-dmg/

Expand Down Expand Up @@ -69,9 +71,11 @@ if [ $? -ne 0 ]; then
exit
fi

sleep 5
# create the temp DMG file
hdiutil create -srcfolder "${STAGING_DIR}" -volname "${VOL_NAME}" -fs HFS+ \
-fsargs "-c c=64,a=16,e=16" -format UDRW -size ${SIZE}M "${DMG_TMP}"
for i in {1..5}; do hdiutil create -srcfolder "${STAGING_DIR}" -volname "${VOL_NAME}" -fs HFS+ \
-fsargs "-c c=64,a=16,e=16" -format UDRW -size ${SIZE}M "${DMG_TMP}" && break || echo "DMG create attempt $i" && sleep 15; done


echo "Created DMG: ${DMG_TMP}"

Expand Down
8 changes: 4 additions & 4 deletions cmake/install/linux/linux_post_install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ execute_process(COMMAND ${LINUX_DEPLOY_PATH} ${PROJECT_BIN_PATH} -qmldir=${PROJE
ECHO_OUTPUT_VARIABLE
ECHO_ERROR_VARIABLE)

message(STATUS "Renaming ${CMAKE_SOURCE_DIR}/${DEX_PROJECT_NAME}-${VERSION_ID}-x86_64.AppImage to ${CMAKE_SOURCE_DIR}/${DEX_PROJECT_NAME}-linux-${VERSION_ID}-x86_64.AppImage")
file(RENAME ${CMAKE_SOURCE_DIR}/${DEX_PROJECT_NAME}-${VERSION_ID}-x86_64.AppImage ${CMAKE_SOURCE_DIR}/${DEX_PROJECT_NAME}-linux-${VERSION_ID}-x86_64.AppImage)

message(STATUS "Copying ${PROJECT_APP_PATH} to ${TARGET_APP_PATH}/${PROJECT_APP_DIR}")
file(COPY ${PROJECT_APP_PATH} DESTINATION ${TARGET_APP_PATH})
execute_process(COMMAND zip -r ${DEX_PROJECT_NAME}-linux-${VERSION_ID}.zip AntaraAtomicDexAppDir
Expand All @@ -83,4 +80,7 @@ execute_process(COMMAND tar --zstd -cf ${DEX_PROJECT_NAME}-linux-${VERSION_ID}.t
ECHO_OUTPUT_VARIABLE
ECHO_ERROR_VARIABLE)

file(COPY ${CMAKE_SOURCE_DIR}/${DEX_PROJECT_NAME}-linux-${VERSION_ID}-x86_64.AppImage DESTINATION ${TARGET_APP_PATH})
message(STATUS "Renaming ${CMAKE_SOURCE_DIR}/${DEX_PROJECT_NAME}-${VERSION_ID}-x86_64.AppImage to ${CMAKE_SOURCE_DIR}/${DEX_PROJECT_NAME}-linux-${VERSION_ID}-x86_64.AppImage")
file(RENAME ${CMAKE_SOURCE_DIR}/${DEX_PROJECT_NAME}-${VERSION_ID}-x86_64.AppImage ${CMAKE_SOURCE_DIR}/${DEX_PROJECT_NAME}-linux-${VERSION_ID}-x86_64.AppImage)

file(COPY ${CMAKE_SOURCE_DIR}/${DEX_PROJECT_NAME}-linux-${VERSION_ID}-x86_64.AppImage DESTINATION ${TARGET_APP_PATH})
20 changes: 20 additions & 0 deletions docker-build-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# Define the target for the build (Debug or Release)
TARGET="${1:-Debug}"

docker run -v "$(pwd)":/build/komodo-wallet-desktop \
kw-build-container \
bash -c "cd /build/komodo-wallet-desktop/ci_tools_atomic_dex && \
nimble build -y && \
./ci_tools_atomic_dex build $TARGET && \
./ci_tools_atomic_dex bundle $TARGET" 2>&1 | tee build.log

# Check if the build was successful
if [ "${PIPESTATUS[0]}" -eq 0 ]; then
echo "Build completed successfully!"
else
echo "Build failed. Check build.log for details."
echo "Make sure you run 'docker build -t kw-build-container -f .docker/Dockerfile .' first"
exit 1
fi
Loading

0 comments on commit c0f5cfe

Please sign in to comment.