New linux build workflow, no precompile binaries, build all from source

This commit is contained in:
Harvey Fong 2026-01-03 18:35:34 +00:00
parent db37bce516
commit 4cc07f9112
2 changed files with 26 additions and 21 deletions

View File

@ -48,7 +48,7 @@ else
endif endif
# Common include and library paths # Common include and library paths
INCLUDE_PATHS = -I$(DPP_PATH)/include INCLUDE_PATHS = -I$(DPP_PATH)/include -I../sqlite3
DPP_BUILD_DIR = $(DPP_PATH)/build/library DPP_BUILD_DIR = $(DPP_PATH)/build/library
# Platform-specific versioned library filename # Platform-specific versioned library filename
@ -59,7 +59,7 @@ else
endif endif
# Library flags # Library flags
LIB_PATHS = -L$(DPP_BUILD_DIR) LIB_PATHS = -L$(DPP_BUILD_DIR) -L../sqlite3
LIBRARIES = -ldpp -lsqlite3 LIBRARIES = -ldpp -lsqlite3
# Build type specific flags # Build type specific flags
@ -76,7 +76,7 @@ C_FLAGS = $(COMMON_FLAGS) -std=c17
CXX_FLAGS = $(COMMON_FLAGS) -std=c++17 -Wno-deprecated-declarations CXX_FLAGS = $(COMMON_FLAGS) -std=c++17 -Wno-deprecated-declarations
# Objects # Objects
OBJECTS = $(EXECUTABLE_NAME).o OBJECTS = $(EXECUTABLE_NAME).o
OBJECT_FILES = $(patsubst %,$(OBJ_DIR)/%,$(OBJECTS)) OBJECT_FILES = $(patsubst %,$(OBJ_DIR)/%,$(OBJECTS))
# Build rules # Build rules

View File

@ -17,32 +17,37 @@ Prototype C++ Discord bot, that supports 2 features
## Build ## Build
### Ubuntu 24.04 LTS ### Ubuntu Linux
``` ```
sudo apt update sudo apt install build-essential git cmake -y
sudo apt upgrade -y mkdir workdir && cd workdir
sudo apt install build-essential curl git cmake zlib1g-dev libssl-dev -y mkdir zlib libssl DPP poomer-discord sqlite3 && cd zlib
mkdir workdir git clone https://github.com/madler/zlib.git .
cd workdir ./configure --static
git clone https://github.com/brainboxdotcc/DPP.git make -j4
cd DPP cd ../libssl && git clone https://github.com/openssl/openssl.git .
cmake -B ./build ./Configure linux-x86_64 no-shared
cmake --build ./build -j8 make -j4
cd .. cd ../DPP && git clone https://github.com/brainboxdotcc/DPP.git .
git clone https://git.indoodle.com/oomer/poomer-discord.git #zlib wants an absolute path to help cmake find_package work, ssl requires explicit vars
cd poomer-discord cmake -B ./build \
curl -LO https://raw.githubusercontent.com/nothings/stb/master/stb_image.h -DCMAKE_PREFIX_PATH="$PWD/../zlib;$PWD/../libssl"
curl -LO https://raw.githubusercontent.com/nothings/stb/master/stb_image_write.h cmake --build ./build -j4
cd ../sqlite3
wget https://www.sqlite.org/2025/sqlite-autoconf-3510100.tar.gz
tar xzf sqlite-autoconf-3510100.tar.gz --strip-components=1
./configure --enable-static --disable-shared && make -j4
cd ../poomer-discord && git clone https://git.indoodle.com/oomer/poomer-discord.git .
wget https://raw.githubusercontent.com/nothings/stb/master/stb_image.h
wget https://raw.githubusercontent.com/nothings/stb/master/stb_image_write.h
make all -j4 make all -j4
``` ```
### MacOS ### MacOS
``` ```
mkdir workdir mkdir workdir && cd workdir
cd workdir
mkdir homebrew mkdir homebrew
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip-components 1 -C homebrew curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip-components 1 -C homebrew
eval "$(homebrew/bin/brew shellenv)" eval "$(homebrew/bin/brew shellenv)"