From 0f19a691c23426506d9057c279e371e186657962 Mon Sep 17 00:00:00 2001 From: Harvey Fong Date: Sat, 3 Jan 2026 20:53:58 +0000 Subject: [PATCH] MacOS build instruction rewrite to build third party libs from source --- Makefile | 19 +++++++++++++++---- README.md | 16 +++++++--------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 519219c..dd31786 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,8 @@ else endif # Common include and library paths -INCLUDE_PATHS = -I$(DPP_PATH)/include -I../sqlite3 +#INCLUDE_PATHS = -I$(DPP_PATH)/include -I../sqlite3 +INCLUDE_PATHS = -I$(DPP_PATH)/include DPP_BUILD_DIR = $(DPP_PATH)/build/library # Platform-specific versioned library filename @@ -59,8 +60,9 @@ else endif # Library flags -LIB_PATHS = -L$(DPP_BUILD_DIR) -L../sqlite3 -LIBRARIES = -ldpp -lsqlite3 +#LIB_PATHS = -L$(DPP_BUILD_DIR) -L../sqlite3 +LIB_PATHS = -L$(DPP_BUILD_DIR) -L. +LIBRARIES = -ldpp -lsqlite3 -lssl -lcrypto # Build type specific flags ifeq ($(BUILD_TYPE), debug) @@ -96,6 +98,14 @@ ifeq ($(PLATFORM), Darwin) else \ cp $(DPP_BUILD_DIR)/$(DPP_LIB_NAME) $(BIN_DIR)/$(DPP_LIB_NAME); \ fi + @# Fix library paths for OpenSSL dependencies + @if [ -f $(BIN_DIR)/$(DPP_VERSIONED_FILE) ]; then \ + install_name_tool -change /Users/harvey/learndir/libssl/install/lib/libssl.4.dylib @executable_path/libssl.dylib $(BIN_DIR)/$(DPP_VERSIONED_FILE); \ + install_name_tool -change /Users/harvey/learndir/libssl/install/lib/libcrypto.4.dylib @executable_path/libcrypto.dylib $(BIN_DIR)/$(DPP_VERSIONED_FILE); \ + fi + @install_name_tool -change /Users/harvey/learndir/libssl/install/lib/libssl.4.dylib @executable_path/libssl.dylib $(OUTPUT_FILE); \ + install_name_tool -change /Users/harvey/learndir/libssl/install/lib/libcrypto.4.dylib @executable_path/libcrypto.dylib $(OUTPUT_FILE); \ + cp libssl.dylib libcrypto.dylib $(BIN_DIR)/ else @# Linux: Handle versioned libraries (follow standard convention) @if [ -f $(DPP_BUILD_DIR)/$(DPP_VERSIONED_FILE) ]; then \ @@ -149,4 +159,5 @@ cleanall: rmdir obj/* 2>/dev/null || true rmdir bin/* 2>/dev/null || true rmdir obj 2>/dev/null || true - rmdir bin 2>/dev/null || true \ No newline at end of file + rmdir bin 2>/dev/null || true + diff --git a/README.md b/README.md index 3599734..1c35a61 100644 --- a/README.md +++ b/README.md @@ -56,15 +56,13 @@ brew install openssl git clone https://github.com/brainboxdotcc/DPP.git cd DPP /Applications/CMake.app/Contents/bin/cmake -B ./build \ - -DOPENSSL_ROOT_DIR=../homebrew/opt/openssl@3 \ - -DOPENSSL_INCLUDE_DIR=../homebrew/opt/openssl@3/include \ - -DOPENSSL_CRYPTO_LIBRARY=../homebrew/opt/openssl@3/lib/libcrypto.a \ - -DOPENSSL_SSL_LIBRARY=../homebrew/opt/openssl@3/lib/libssl.a - - /Applications/CMake.app/Contents/bin/cmake --build ./build -j8 -cd .. -git clone https://git.indoodle.com/oomer/poomer-discord.git -cd poomer-discord + -DOPENSSL_INCLUDE_DIR="$PWD/../libssl/include" \ + -DOPENSSL_CRYPTO_LIBRARY="$PWD/../libssl/lib/libcrypto.dylib" \ + -DOPENSSL_SSL_LIBRARY="$PWD/../libssl/lib/libssl.dylib" \ + -DCMAKE_PREFIX_PATH="$PWD/../zlib" +/Applications/CMake.app/Contents/bin/cmake --build ./build -j8 +cd ../poomer-discord +git clone https://git.indoodle.com/oomer/poomer-discord.git . curl -LO https://raw.githubusercontent.com/nothings/stb/master/stb_image.h curl -LO https://raw.githubusercontent.com/nothings/stb/master/stb_image_write.h make all -j4