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
9 changes: 5 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,8 @@ jobs:
depends/built
depends/sdk-sources
depends/${{ matrix.config.host }}
key: ${{ runner.os }}-depends-${{ matrix.config.host }}
restore-keys: ${{ runner.os }}-depends-${{ matrix.config.host }}
key: ${{ runner.os }}-depends-${{ matrix.config.host }}-v2
restore-keys: ${{ runner.os }}-depends-${{ matrix.config.host }}-v2

- name: Build Depends
run: |
Expand Down Expand Up @@ -603,6 +603,7 @@ jobs:
CCACHE_COMPRESS: 1
WINEDEBUG: fixme-all
BOOST_TEST_RANDOM: 1 # random seed based on the current time
SDK_URL: https://bitcoincore.org/depends-sources/sdks
defaults:
run:
shell: bash
Expand Down Expand Up @@ -688,8 +689,8 @@ jobs:
depends/built
depends/sdk-sources
depends/${{ matrix.config.host }}
key: ${{ runner.os }}-depends-${{ matrix.config.host }}
restore-keys: ${{ runner.os }}-depends-${{ matrix.config.host }}
key: ${{ runner.os }}-depends-${{ matrix.config.host }}-v2
restore-keys: ${{ runner.os }}-depends-${{ matrix.config.host }}-v2

- name: ccache cache files
uses: actions/cache@v4
Expand Down
2 changes: 1 addition & 1 deletion depends/funcs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ $(1)_config_env+=PKG_CONFIG_PATH=$($($(1)_type)_prefix)/share/pkgconfig
$(1)_config_env+=PATH="$(build_prefix)/bin:$(PATH)"
$(1)_build_env+=PATH="$(build_prefix)/bin:$(PATH)"
$(1)_stage_env+=PATH="$(build_prefix)/bin:$(PATH)"
$(1)_autoconf=./configure --host=$($($(1)_type)_host) --disable-dependency-tracking --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)"
$(1)_autoconf=./configure --host=$($($(1)_type)_host) --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)"

ifneq ($($(1)_nm),)
$(1)_autoconf += NM="$$($(1)_nm)"
Expand Down
35 changes: 35 additions & 0 deletions depends/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The package "mylib" will be used here as an example

General tips:
- mylib_foo is written as $(package)_foo in order to make recipes more similar.
- Secondary dependency packages relative to the PIVX binaries/libraries (i.e.
those not in `ALLOWED_LIBRARIES` in `contrib/devtools/symbol-check.py`) don't
need to be shared and should be built statically whenever possible. See
[below](#secondary-dependencies) for more details.

## Identifiers
Each package is required to define at least these variables:
Expand Down Expand Up @@ -146,3 +150,34 @@ $($(package)_config_opts) will be appended.
Most autotools projects can be properly staged using:

$(MAKE) DESTDIR=$($(package)_staging_dir) install

## Build outputs:

In general, the output of a depends package should not contain any libtool
archives. Instead, the package should output `.pc` (`pkg-config`) files where
possible.

From the [Gentoo Wiki entry](https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Handling_Libtool_Archives):

> Libtool pulls in all direct and indirect dependencies into the .la files it
> creates. This leads to massive overlinking, which is toxic to the Gentoo
> ecosystem, as it leads to a massive number of unnecessary rebuilds.

## Secondary dependencies:

Secondary dependency packages relative to the PIVX binaries/libraries (i.e.
those not in `ALLOWED_LIBRARIES` in `contrib/devtools/symbol-check.py`) don't
need to be shared and should be built statically whenever possible. This
improves general build reliability as illustrated by the following example:

When linking an executable against a shared library `libprimary` that has its
own shared dependency `libsecondary`, we may need to specify the path to
`libsecondary` on the link command using the `-rpath/-rpath-link` options, it is
not sufficient to just say `libprimary`.

For us, it's much easier to just link a static `libsecondary` into a shared
`libprimary`. Especially because in our case, we are linking against a dummy
`libprimary` anyway that we'll throw away. We don't care if the end-user has a
static or dynamic `libseconday`, that's not our concern. With a static
`libseconday`, when we need to link `libprimary` into our executable, there's no
dependency chain to worry about as `libprimary` has all the symbols.
2 changes: 1 addition & 1 deletion depends/packages/bdb.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $(package)_sha256_hash=12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b857327
$(package)_build_subdir=build_unix

define $(package)_set_vars
$(package)_config_opts=--disable-shared --enable-cxx --disable-replication
$(package)_config_opts=--disable-shared --enable-cxx --disable-replication --enable-option-checking
$(package)_config_opts_mingw32=--enable-mingw
$(package)_config_opts_linux=--with-pic
$(package)_config_opts_aarch64=--disable-atomicsupport
Expand Down
23 changes: 0 additions & 23 deletions depends/packages/dbus.mk

This file was deleted.

14 changes: 10 additions & 4 deletions depends/packages/expat.mk
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package=expat
$(package)_version=2.2.6
$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$($(package)_version))/
$(package)_version=2.2.7
$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_2_2_7/
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=17b43c2716d521369f82fc2dc70f359860e90fa440bea65b3b85f0b246ea81f2
$(package)_sha256_hash=cbc9102f4a31a8dafd42d642e9a3aa31e79a0aedaa1f6efd2795ebc83174ec18

define $(package)_set_vars
$(package)_config_opts=--disable-static --without-docbook
$(package)_config_opts=--disable-shared --without-docbook
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
$(package)_config_opts_linux=--with-pic
endef

define $(package)_config_cmds
Expand All @@ -19,3 +21,7 @@ endef
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
endef

define $(package)_postprocess_cmds
rm lib/*.la
endef
7 changes: 6 additions & 1 deletion depends/packages/fontconfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ $(package)_sha256_hash=b449a3e10c47e1d1c7a6ec6e2016cca73d3bd68fbbd4f0ae5cc6b573f
$(package)_dependencies=freetype expat

define $(package)_set_vars
$(package)_config_opts=--disable-docs --disable-static
$(package)_config_opts=--disable-docs --disable-static --disable-libxml2 --disable-iconv
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
endef

define $(package)_config_cmds
Expand All @@ -26,3 +27,7 @@ endef
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
endef

define $(package)_postprocess_cmds
rm lib/*.la
endef
5 changes: 5 additions & 0 deletions depends/packages/freetype.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ $(package)_sha256_hash=3a3bb2c4e15ffb433f2032f50a5b5a92558206822e22bfe8cbe339af4

define $(package)_set_vars
$(package)_config_opts=--without-zlib --without-png --without-harfbuzz --without-bzip2 --disable-static
$(package)_config_opts += --enable-option-checking
$(package)_config_opts_linux=--with-pic
endef

Expand All @@ -20,3 +21,7 @@ endef
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
endef

define $(package)_postprocess_cmds
rm lib/*.la
endef
6 changes: 5 additions & 1 deletion depends/packages/gmp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $(package)_file_name=$(package)-$($(package)_version).tar.xz
$(package)_sha256_hash=fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2

define $(package)_set_vars
$(package)_config_opts+=--enable-cxx --enable-fat --with-pic --disable-shared
$(package)_config_opts+=--enable-cxx --enable-fat --with-pic --disable-shared --enable-option-checking
$(package)_config_opts_mingw32+=--enable-mingw
endef

Expand All @@ -21,3 +21,7 @@ define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
endef

define $(package)_postprocess_cmds
rm lib/*.la
endef

9 changes: 8 additions & 1 deletion depends/packages/libXau.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ $(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=fdd477320aeb5cdd67272838722d6b7d544887dfe7de46e1e7cc0c27c2bea4f2
$(package)_dependencies=xproto

# When updating this package, check the default value of
# --disable-xthreads. It is currently enabled.
define $(package)_set_vars
$(package)_config_opts=--disable-shared
$(package)_config_opts=--disable-shared --disable-lint-library --without-lint
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
$(package)_config_opts_linux=--with-pic
endef

Expand All @@ -25,3 +28,7 @@ endef
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
endef

define $(package)_postprocess_cmds
rm lib/*.la
endef
4 changes: 3 additions & 1 deletion depends/packages/libevent.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ endef

define $(package)_set_vars
$(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress --disable-samples
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
$(package)_config_opts_release=--disable-debug-mode
$(package)_config_opts_linux=--with-pic
endef
Expand All @@ -27,4 +28,5 @@ define $(package)_stage_cmds
endef

define $(package)_postprocess_cmds
endef
rm lib/*.la
endef
6 changes: 5 additions & 1 deletion depends/packages/libsodium.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ define $(package)_preprocess_cmds
endef

define $(package)_config_cmds
$($(package)_autoconf) --enable-static --disable-shared
$($(package)_autoconf) --enable-static --disable-shared --disable-dependency-tracking --enable-option-checking
endef

define $(package)_build_cmds
Expand All @@ -21,3 +21,7 @@ endef
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
endef

define $(package)_postprocess_cmds
rm lib/*.la
endef
17 changes: 15 additions & 2 deletions depends/packages/libxcb.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@ $(package)_sha256_hash=98d9ab05b636dd088603b64229dd1ab2d2cc02ab807892e107d674f9c
$(package)_dependencies=xcb_proto libXau

define $(package)_set_vars
$(package)_config_opts=--disable-static
$(package)_config_opts=--disable-static --disable-build-docs --without-doxygen --without-launchd
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
# Because we pass -qt-xcb to Qt, it will compile in a set of xcb helper libraries and extensions,
# so we skip building all of the extensions here.
# More info is available from: https://doc.qt.io/qt-5.9/linux-requirements.html
$(package)_config_opts += --disable-composite --disable-damage --disable-dpms
$(package)_config_opts += --disable-dri2 --disable-dri3 --disable-glx
$(package)_config_opts += --disable-present --disable-randr --disable-record
$(package)_config_opts += --disable-render --disable-resource --disable-screensaver
$(package)_config_opts += --disable-shape --disable-shm --disable-sync
$(package)_config_opts += --disable-xevie --disable-xfixes --disable-xfree86-dri
$(package)_config_opts += --disable-xinerama --disable-xinput --disable-xkb
$(package)_config_opts += --disable-xprint --disable-selinux --disable-xtest
$(package)_config_opts += --disable-xv --disable-xvmc
endef

define $(package)_preprocess_cmds
Expand All @@ -32,5 +45,5 @@ define $(package)_stage_cmds
endef

define $(package)_postprocess_cmds
rm -rf share/man share/doc
rm -rf share/man share/doc lib/*.la
endef
2 changes: 1 addition & 1 deletion depends/packages/packages.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ native_packages := native_rust

qt_packages = qrencode zlib

qt_linux_packages:=qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig
qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig

qt_darwin_packages=qt
qt_mingw32_packages=qt
Expand Down
8 changes: 7 additions & 1 deletion depends/packages/qrencode.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ $(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=efe5188b1ddbcbf98763b819b146be6a90481aac30cfc8d858ab78a19cde1fa5

define $(package)_set_vars
$(package)_config_opts=--disable-shared -without-tools --disable-sdltest
$(package)_config_opts=--disable-shared --without-tools --without-tests --disable-sdltest
$(package)_config_opts += --disable-gprof --disable-gcov --disable-mudflap
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
$(package)_config_opts_linux=--with-pic
endef

Expand All @@ -24,3 +26,7 @@ endef
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
endef

define $(package)_postprocess_cmds
rm lib/*.la
endef
5 changes: 0 additions & 5 deletions depends/packages/xcb_proto.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ $(package)_download_path=https://xcb.freedesktop.org/dist
$(package)_file_name=xcb-proto-$($(package)_version).tar.bz2
$(package)_sha256_hash=7ef40ddd855b750bc597d2a435da21e55e502a0fefa85b274f2c922800baaf05

define $(package)_set_vars
$(package)_config_opts=--disable-shared
$(package)_config_opts_linux=--with-pic
endef

define $(package)_config_cmds
$($(package)_autoconf)
endef
Expand Down
3 changes: 2 additions & 1 deletion depends/packages/xproto.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ $(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=636162c1759805a5a0114a369dffdeccb8af8c859ef6e1445f26a4e6e046514f

define $(package)_set_vars
$(package)_config_opts=--disable-shared
$(package)_config_opts=--without-fop --without-xmlto --without-xsltproc --disable-specs
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
endef

define $(package)_preprocess_cmds
Expand Down
7 changes: 5 additions & 2 deletions depends/packages/zeromq.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ $(package)_sha256_hash=bcbabe1e2c7d0eec4ed612e10b94b112dd5f06fcefa994a0c79a45d83
$(package)_patches=0001-fix-build-with-older-mingw64.patch 0002-disable-pthread_set_name_np.patch

define $(package)_set_vars
$(package)_config_opts=--without-docs --disable-shared --without-libsodium --disable-curve --disable-curve-keygen --disable-perf --disable-Werror
$(package)_config_opts=--without-docs --disable-shared --disable-curve --disable-curve-keygen --disable-perf
$(package)_config_opts += --without-libsodium --without-libgssapi_krb5 --without-pgm --without-norm --without-vmci
$(package)_config_opts += --disable-libunwind --disable-radix-tree --without-gcov --disable-dependency-tracking
$(package)_config_opts += --disable-Werror --disable-drafts --enable-option-checking
$(package)_config_opts_linux=--with-pic
$(package)_cxxflags=-std=c++11
endef
Expand All @@ -31,5 +34,5 @@ endef

define $(package)_postprocess_cmds
sed -i.old "s/ -lstdc++//" lib/pkgconfig/libzmq.pc && \
rm -rf bin share
rm -rf bin share lib/*.la
endef
1 change: 0 additions & 1 deletion doc/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ These are the dependencies currently used by PIVX Core. You can find instruction
| Berkeley DB | [4.8.30](https://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index.html) | 4.8.x | No | | |
| Boost | [1.71.0](https://www.boost.org/users/download/) | [1.57.0](https://github.com/PIVX-Project/PIVX/pull/1703) | No | | |
| Clang | | [3.3+](https://llvm.org/releases/download.html) (C++11 support) | | | |
| D-Bus | [1.10.18](https://cgit.freedesktop.org/dbus/dbus/tree/NEWS?h=dbus-1.10) | | No | Yes | |
| Expat | [2.2.6](https://libexpat.github.io/) | | No | Yes | |
| fontconfig | [2.12.1](https://www.freedesktop.org/software/fontconfig/release/) | | No | Yes | |
| FreeType | [2.7.1](https://download.savannah.gnu.org/releases/freetype) | | No | | |
Expand Down