Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 4 additions & 20 deletions .github/workflows/pirate_build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,6 @@ jobs:
gcc-mingw-w64-x86-64-posix \
g++-mingw-w64-x86-64-posix \
binutils-mingw-w64-x86-64
- name: Ensure mingw-w64 tool aliases
shell: bash
run: |
for tool in ar ranlib strip nm gcc g++ windres dlltool objcopy; do
if ! command -v x86_64-w64-mingw64-$tool >/dev/null 2>&1; then
if command -v x86_64-w64-mingw32-$tool >/dev/null 2>&1; then
sudo ln -sf "$(command -v x86_64-w64-mingw32-$tool)" "/usr/bin/x86_64-w64-mingw64-$tool"
fi
fi
done
- name: Build daemon (cross)
run: |
chmod +x zcutil/build-win.sh
Expand Down Expand Up @@ -258,6 +248,8 @@ jobs:
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: |
brew untap aws/tap 2>/dev/null || true

install_brew_formulae() {
missing=()
for formula in "$@"; do
Expand Down Expand Up @@ -420,16 +412,6 @@ jobs:
gcc-mingw-w64-x86-64-posix \
g++-mingw-w64-x86-64-posix \
binutils-mingw-w64-x86-64
- name: Ensure mingw-w64 tool aliases
shell: bash
run: |
for tool in ar ranlib strip nm gcc g++ windres dlltool objcopy; do
if ! command -v x86_64-w64-mingw64-$tool >/dev/null 2>&1; then
if command -v x86_64-w64-mingw32-$tool >/dev/null 2>&1; then
sudo ln -sf "$(command -v x86_64-w64-mingw32-$tool)" "/usr/bin/x86_64-w64-mingw64-$tool"
fi
fi
done
- name: Build QT (Windows cross)
run: |
chmod +x zcutil/build-qt-win.sh
Expand Down Expand Up @@ -543,6 +525,8 @@ jobs:
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: |
brew untap aws/tap 2>/dev/null || true

install_brew_formulae() {
missing=()
for formula in "$@"; do
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
| Target | CLI | QT |
| --- | --- | --- |
| Linux x86_64 | [![CLI Linux x86_64](https://img.shields.io/github/check-runs/PirateNetwork/pirate/dev?nameFilter=CLI%20%28Linux%20x86_64%29&label=CLI)](https://github.com/PirateNetwork/pirate/actions/workflows/pirate_build_all.yml) | [![QT Linux x86_64](https://img.shields.io/github/check-runs/PirateNetwork/pirate/dev?nameFilter=QT%20%28Linux%20x86_64%29&label=QT)](https://github.com/PirateNetwork/pirate/actions/workflows/pirate_build_all.yml) |
| Windows x86_64 cross | [![CLI Windows x86_64 cross](https://img.shields.io/github/check-runs/PirateNetwork/pirate/dev?nameFilter=CLI%20%28Windows%20x86_64%20cross%29&label=CLI)](https://github.com/PirateNetwork/pirate/actions/workflows/pirate_build_all.yml) | [![QT Windows x86_64 cross](https://img.shields.io/github/check-runs/PirateNetwork/pirate/dev?nameFilter=QT%20%28Windows%20x86_64%20cross%29&label=QT)](https://github.com/PirateNetwork/pirate/actions/workflows/pirate_build_all.yml) |
| Linux AArch64 cross | [![CLI Linux AArch64 cross](https://img.shields.io/github/check-runs/PirateNetwork/pirate/dev?nameFilter=CLI%20%28Linux%20AArch64%20cross%29&label=CLI)](https://github.com/PirateNetwork/pirate/actions/workflows/pirate_build_all.yml) | [![QT Linux AArch64 cross](https://img.shields.io/github/check-runs/PirateNetwork/pirate/dev?nameFilter=QT%20%28Linux%20AArch64%20cross%29&label=QT)](https://github.com/PirateNetwork/pirate/actions/workflows/pirate_build_all.yml) |
| macOS | [![CLI macOS](https://img.shields.io/github/check-runs/PirateNetwork/pirate/dev?nameFilter=CLI%20%28macOS%29&label=CLI)](https://github.com/PirateNetwork/pirate/actions/workflows/pirate_build_all.yml) | [![QT macOS](https://img.shields.io/github/check-runs/PirateNetwork/pirate/dev?nameFilter=QT%20%28macOS%29&label=QT)](https://github.com/PirateNetwork/pirate/actions/workflows/pirate_build_all.yml) |
| Linux x86_64 | [![CLI Linux x86_64](https://img.shields.io/github/check-runs/PirateNetwork/pirate/dev?nameFilter=CLI%20%28Linux%20x86_64%29&label=CLI&cacheSeconds=30)](https://github.com/PirateNetwork/pirate/actions/workflows/pirate_build_all.yml) | [![QT Linux x86_64](https://img.shields.io/github/check-runs/PirateNetwork/pirate/dev?nameFilter=QT%20%28Linux%20x86_64%29&label=QT&cacheSeconds=30)](https://github.com/PirateNetwork/pirate/actions/workflows/pirate_build_all.yml) |
| Windows x86_64 cross | [![CLI Windows x86_64 cross](https://img.shields.io/github/check-runs/PirateNetwork/pirate/dev?nameFilter=CLI%20%28Windows%20x86_64%20cross%29&label=CLI&cacheSeconds=30)](https://github.com/PirateNetwork/pirate/actions/workflows/pirate_build_all.yml) | [![QT Windows x86_64 cross](https://img.shields.io/github/check-runs/PirateNetwork/pirate/dev?nameFilter=QT%20%28Windows%20x86_64%20cross%29&label=QT&cacheSeconds=30)](https://github.com/PirateNetwork/pirate/actions/workflows/pirate_build_all.yml) |
| Linux AArch64 cross | [![CLI Linux AArch64 cross](https://img.shields.io/github/check-runs/PirateNetwork/pirate/dev?nameFilter=CLI%20%28Linux%20AArch64%20cross%29&label=CLI&cacheSeconds=30)](https://github.com/PirateNetwork/pirate/actions/workflows/pirate_build_all.yml) | [![QT Linux AArch64 cross](https://img.shields.io/github/check-runs/PirateNetwork/pirate/dev?nameFilter=QT%20%28Linux%20AArch64%20cross%29&label=QT&cacheSeconds=30)](https://github.com/PirateNetwork/pirate/actions/workflows/pirate_build_all.yml) |
| macOS | [![CLI macOS](https://img.shields.io/github/check-runs/PirateNetwork/pirate/dev?nameFilter=CLI%20%28macOS%29&label=CLI&cacheSeconds=30)](https://github.com/PirateNetwork/pirate/actions/workflows/pirate_build_all.yml) | [![QT macOS](https://img.shields.io/github/check-runs/PirateNetwork/pirate/dev?nameFilter=QT%20%28macOS%29&label=QT&cacheSeconds=30)](https://github.com/PirateNetwork/pirate/actions/workflows/pirate_build_all.yml) |

![Pirate Logo](https://i.ibb.co/F7Dgnxy/Pirate-Logo-Wordmark-Gold.png "Pirate Chain Logo")

Expand Down
14 changes: 12 additions & 2 deletions depends/config.site.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@ ac_tool_prefix=${host_alias}-
if test -z $with_boost; then
with_boost=$depends_prefix
fi

case @host_os@ in
mingw32|mingw64)
embedded_bin_suffix=.exe
;;
*)
embedded_bin_suffix=
;;
esac

if test -z $with_tor_bin; then
with_tor_bin=$depends_prefix/bin/tor
with_tor_bin=$depends_prefix/bin/tor$embedded_bin_suffix
fi
if test -z $with_i2pd_bin; then
with_i2pd_bin=$depends_prefix/bin/i2pd
with_i2pd_bin=$depends_prefix/bin/i2pd$embedded_bin_suffix
fi
if test -z $with_qt_plugindir; then
with_qt_plugindir=$depends_prefix/plugins
Expand Down
12 changes: 11 additions & 1 deletion depends/packages/i2pd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ $(package)_download_file=$($(package)_version).tar.gz
$(package)_file_name=i2pd-$($(package)_version).tar.gz
$(package)_sha256_hash=ef32100c5ffdf4d23dfe78a2f6c08f65574fd79f992eb2ac8cfea0b6440deabd
$(package)_dependencies=boost openssl zlib
$(package)_patches=platform-linking.patch

define $(package)_set_vars
$(package)_config_opts_mingw32=-DCMAKE_SYSTEM_NAME=Windows
endef

define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/platform-linking.patch
endef

# i2pd's CMakeLists.txt lives under build/, with the project's own source tree
# as a sibling directory, so it must be pointed at explicitly. Building with
Expand Down Expand Up @@ -35,7 +44,8 @@ define $(package)_config_cmds
-DWITH_STATIC=ON \
-DWITH_UPNP=OFF \
-DWITH_HARDENING=ON \
-DWITH_GIT_VERSION=OFF
-DWITH_GIT_VERSION=OFF \
$($(package)_config_opts)
endef

define $(package)_build_cmds
Expand Down
1 change: 1 addition & 0 deletions depends/packages/tor.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ define $(package)_set_vars
$(package)_config_opts=--disable-unittests --disable-system-torrc --disable-asciidoc
$(package)_config_opts+=--disable-tool-name-check --disable-dependency-tracking --enable-option-checking
$(package)_config_opts+=--enable-static-tor
$(package)_config_opts_darwin=--disable-static-tor --enable-static-openssl --enable-static-libevent --enable-static-zlib
$(package)_config_opts+=--with-openssl-dir=$(host_prefix)
$(package)_config_opts+=--with-libevent-dir=$(host_prefix)
$(package)_config_opts+=--with-zlib-dir=$(host_prefix)
Expand Down
28 changes: 28 additions & 0 deletions depends/patches/i2pd/platform-linking.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt
index 156e54a..36b745e 100644
--- a/build/CMakeLists.txt
+++ b/build/CMakeLists.txt
@@ -236,7 +236,7 @@ if(WITH_STATIC)
endif()

set(Boost_USE_STATIC_LIBS ON)
- if(MSVC)
+ if(MSVC OR MINGW)
set(Boost_USE_STATIC_RUNTIME ON)
else()
set(Boost_USE_STATIC_RUNTIME OFF)
@@ -374,12 +374,12 @@ if(WITH_BINARY)
endif()

if(WITH_STATIC)
- if(NOT MSVC)
+ if(NOT MSVC AND NOT APPLE)
set_target_properties("${PROJECT_NAME}" PROPERTIES LINK_FLAGS "-static")
endif()
endif()

- if(WITH_HARDENING AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ if(WITH_HARDENING AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT MINGW)
set_target_properties("${PROJECT_NAME}" PROPERTIES LINK_FLAGS "-z relro -z now")
endif()

8 changes: 4 additions & 4 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -1006,17 +1006,17 @@ install-exec-hook:
if ENABLE_EMBEDDED_TOR
@if test -f "$(TOR_BINARY_PATH)"; then \
$(MKDIR_P) "$(DESTDIR)$(bindir)"; \
$(INSTALL_PROGRAM) "$(TOR_BINARY_PATH)" "$(DESTDIR)$(bindir)/tor"; \
$(STRIP) "$(DESTDIR)$(bindir)/tor" 2>/dev/null || true; \
$(INSTALL_PROGRAM) "$(TOR_BINARY_PATH)" "$(DESTDIR)$(bindir)/tor$(EXEEXT)"; \
$(STRIP) "$(DESTDIR)$(bindir)/tor$(EXEEXT)" 2>/dev/null || true; \
else \
echo "warning: embedded Tor enabled but no tor binary found at '$(TOR_BINARY_PATH)', skipping bundling"; \
fi
endif
if ENABLE_EMBEDDED_I2PD
@if test -f "$(I2PD_BINARY_PATH)"; then \
$(MKDIR_P) "$(DESTDIR)$(bindir)"; \
$(INSTALL_PROGRAM) "$(I2PD_BINARY_PATH)" "$(DESTDIR)$(bindir)/i2pd"; \
$(STRIP) "$(DESTDIR)$(bindir)/i2pd" 2>/dev/null || true; \
$(INSTALL_PROGRAM) "$(I2PD_BINARY_PATH)" "$(DESTDIR)$(bindir)/i2pd$(EXEEXT)"; \
$(STRIP) "$(DESTDIR)$(bindir)/i2pd$(EXEEXT)" 2>/dev/null || true; \
else \
echo "warning: embedded I2P enabled but no i2pd binary found at '$(I2PD_BINARY_PATH)', skipping bundling"; \
fi
Expand Down
15 changes: 4 additions & 11 deletions zcutil/build-qt-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,8 @@ make "$@" -C ./depends/ V=1

./autogen.sh

# Detect architecture and set appropriate flags
# Detect architecture for the Rust target.
ARCH=$(uname -m)
if [ "$ARCH" = "arm64" ]; then
# Apple Silicon (M1/M2)
ARCH_FLAGS="-arch arm64"
else
# Intel x86_64
ARCH_FLAGS="-arch x86_64"
fi

if command -v rustup >/dev/null 2>&1; then
if [ "$ARCH" = "arm64" ]; then
Expand All @@ -67,10 +60,10 @@ if command -v rustup >/dev/null 2>&1; then
export CARGO="$(rustup which cargo)"
fi

CPPFLAGS="-I$PREFIX/include $ARCH_FLAGS" LDFLAGS="-L$PREFIX/lib $ARCH_FLAGS -Wl,-no_pie" \
CXXFLAGS="$ARCH_FLAGS -I$PREFIX/include -fwrapv -fno-strict-aliasing \
CONFIG_SITE="$PREFIX/share/config.site" \
CXXFLAGS="-fwrapv -fno-strict-aliasing \
-Wno-deprecated-declarations -Wno-deprecated-builtins -Wno-enum-constexpr-conversion \
-Wno-unknown-warning-option -Werror -Wno-error=attributes -g" \
-Wno-unknown-warning-option -Wno-error=attributes -g" \
./configure --prefix="${PREFIX}" --disable-bip70 --with-gui=qt5 --enable-tests=no "$HARDENING_ARG" "$LCOV_ARG" "$DEBUGGING_ARG"

make "$@" NO_GTEST=0 STATIC=1
Expand Down
6 changes: 3 additions & 3 deletions zcutil/build-qt-win64.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
HOST=x86_64-w64-mingw64
HOST=x86_64-w64-mingw32
CXX=x86_64-w64-mingw32-g++-posix
CC=x86_64-w64-mingw32-gcc-posix
PREFIX="$(pwd)/depends/$HOST"
Expand All @@ -15,9 +15,9 @@ cd ../

./autogen.sh

CONFIG_SITE=$PWD/depends/x86_64-w64-mingw64/share/config.site \
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site \
CXXFLAGS="-DPTW32_STATIC_LIB -DCURL_STATICLIB -DCURVE_ALT_BN128 -pthread" \
./configure --prefix="${PREFIX}" --host=x86_64-w64-mingw64 --enable-static --disable-shared \
./configure --prefix="${PREFIX}" --host=x86_64-w64-mingw32 --enable-static --disable-shared \
--with-gui=qt5 --disable-bip70 --enable-tests=no

sed -i 's/-lboost_system-mt /-lboost_system-mt-s /' configure
Expand Down
4 changes: 2 additions & 2 deletions zcutil/build-win-dtest.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
export HOST=x86_64-w64-mingw64
export HOST=x86_64-w64-mingw32
CXX=x86_64-w64-mingw32-g++-posix
CC=x86_64-w64-mingw32-gcc-posix

Expand All @@ -15,7 +15,7 @@ make HOST=$HOST NO_QT=1 "$@"
cd $BASE_DIR

./autogen.sh
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw64/share/config.site CXXFLAGS="-DPTW32_STATIC_LIB -DCURL_STATICLIB -DCURVE_ALT_BN128 -pthread" CPPFLAGS=-DTESTMODE ./configure --prefix="${PREFIX}" --host=x86_64-w64-mingw64 --enable-static --disable-shared
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site CXXFLAGS="-DPTW32_STATIC_LIB -DCURL_STATICLIB -DCURVE_ALT_BN128 -pthread" CPPFLAGS=-DTESTMODE ./configure --prefix="${PREFIX}" --host=x86_64-w64-mingw32 --enable-static --disable-shared
sed -i 's/-lboost_system-mt /-lboost_system-mt-s /' configure
cd src/
CC="${CC} -g " CXX="${CXX} -g " make V=1 pirated.exe pirate-cli.exe pirate-tx.exe
6 changes: 3 additions & 3 deletions zcutil/build-win.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
HOST=x86_64-w64-mingw64
HOST=x86_64-w64-mingw32
CXX=x86_64-w64-mingw32-g++-posix
CC=x86_64-w64-mingw32-gcc-posix
PREFIX="$(pwd)/depends/$HOST"
Expand All @@ -14,9 +14,9 @@ cd ../

./autogen.sh

CONFIG_SITE=$PWD/depends/x86_64-w64-mingw64/share/config.site \
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site \
CXXFLAGS="-DPTW32_STATIC_LIB -DCURL_STATICLIB -DCURVE_ALT_BN128 -pthread" \
./configure --prefix="${PREFIX}" --host=x86_64-w64-mingw64 --enable-static --disable-shared \
./configure --prefix="${PREFIX}" --host=x86_64-w64-mingw32 --enable-static --disable-shared \
--with-gui=no --disable-bip70 --enable-tests=yes

sed -i 's/-lboost_system-mt /-lboost_system-mt-s /' configure
Expand Down
Loading