depends: build fixes + script exec bits

This commit is contained in:
2026-02-24 16:59:17 +00:00
parent b4f1e4161c
commit 36a98abebd
147 changed files with 441053 additions and 19 deletions
+134
View File
@@ -0,0 +1,134 @@
.DEFAULT_GOAL := all
# Copyright (c) 2026 Agrarian Developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php.
SHELL := /bin/bash
BASEDIR := $(CURDIR)
BUILD ?= $(shell ./config.guess)
HOST ?= $(BUILD)
build := $(BUILD)
host := $(HOST)
PATCHES_PATH ?= $(BASEDIR)/patches
SOURCES_PATH ?= $(BASEDIR)/sources
BASE_CACHE ?= $(BASEDIR)/built
workdir ?= $(BASEDIR)/work
base_build_dir ?= $(workdir)/build
base_staging_dir ?= $(workdir)/staging
base_download_dir ?= $(workdir)/download
HASH_LENGTH ?= 8
# Derive build_os for builder tooling (host_os comes from hosts/$(host).mk)
build_os :=
ifneq (,$(findstring linux,$(build)))
build_os := linux
else ifneq (,$(findstring darwin,$(build)))
build_os := darwin
else
build_os := linux
endif
# Host-triplet file (must exist)
HOST_MK := hosts/$(host).mk
ifeq ($(wildcard $(HOST_MK)),)
$(error Missing $(HOST_MK). Create it under depends/hosts/.)
endif
# Common recipe dependencies for build-id hashing
meta_depends = \
Makefile \
funcs.mk \
builders/default.mk \
builders/$(build_os).mk \
hosts/default.mk \
$(HOST_MK) \
packages/packages.mk
include $(HOST_MK)
include builders/default.mk
include builders/$(build_os).mk
include packages/packages.mk
include funcs.mk
# --------------------------------------------------------------------
# IMPORTANT:
# Do NOT depend on $($(p)_cached_checksum) here — those vars are created
# later (inside funcs.mk macros), so they'd expand to empty at parse-time.
# Instead depend on the package phony targets (boost, openssl, etc).
# --------------------------------------------------------------------
.PHONY: all
all: $(packages)
# Optional convenience targets (only build what you need)
.PHONY: base wallet zmq upnp qt
base: $(packages)
wallet: $(wallet_packages)
zmq: $(zmq_packages)
upnp: $(upnp_packages)
qt: $(qt_packages) $(qt_$(host_os)_packages)
# Download-only: uses stage targets generated by funcs.mk
.PHONY: download
download: $(addsuffix _fetched,$(all_packages))
# --------------------------------------------------------------------
# Beginner-friendly: populate depends/$(HOST)/ prefix from built cache
# and generate share/config.site for top-level ./configure.
# --------------------------------------------------------------------
.PHONY: install install-clean reinstall
install: all
@echo "== Installing depends into: $(host_prefix)"
@rm -rf "$(host_prefix)"
@mkdir -p "$(host_prefix)"
@set -euo pipefail; \
for p in $(packages); do \
f="$(BASE_CACHE)/$(HOST)/$$p/"*.tar.gz; \
if ! ls $$f >/dev/null 2>&1; then \
echo "ERROR: missing built artifact for $$p (expected: $$f)"; \
exit 1; \
fi; \
echo " - $$p: $$f"; \
tar -xzf $$f -C "$(host_prefix)"; \
done
@echo "== Writing config.site: $(host_prefix)/share/config.site"
@mkdir -p "$(host_prefix)/share"
@{ \
echo "# Autoconf site defaults for Agrarian depends (generated)"; \
echo "CPPFLAGS='-I$(host_prefix)/include'"; \
echo "LDFLAGS='-L$(host_prefix)/lib'"; \
echo "PKG_CONFIG_LIBDIR='$(host_prefix)/lib/pkgconfig:$(host_prefix)/share/pkgconfig'"; \
echo "PKG_CONFIG_PATH=\"$$PKG_CONFIG_LIBDIR\""; \
echo "BDB_CFLAGS='-I$(host_prefix)/include'"; \
echo "BDB_LIBS='-L$(host_prefix)/lib -ldb_cxx-4.8 -ldb-4.8'"; \
} > "$(host_prefix)/share/config.site"
@echo "== Done."
install-clean:
@rm -rf "$(host_prefix)"
reinstall: install-clean install
# --------------------------------------------------------------------
# Cleaning
# - clean: removes working dirs only (keeps built cache + sources)
# - clean-cache: removes built cache too
# - distclean: removes everything generated by depends
# --------------------------------------------------------------------
.PHONY: clean clean-cache distclean
clean:
@rm -rf "$(workdir)"
clean-cache: clean
@rm -rf "$(BASE_CACHE)"
distclean: clean-cache
@rm -rf "$(SOURCES_PATH)" "$(BASEDIR)/SDKs"
+15
View File
@@ -18,3 +18,18 @@ build_$(build_arch)_$(build_os)_$1 += $(build_$(build_os)_$1)
build_$1=$$(build_$(build_arch)_$(build_os)_$1)
endef
$(foreach flags, CFLAGS CXXFLAGS LDFLAGS, $(eval $(call add_build_flags_func,$(flags))))
# -----------------------------------------------------------------------------
# Network / download defaults
# -----------------------------------------------------------------------------
#
# Some older depends trees relied on these being provided via the environment.
# On newer distros, passing curl options without numeric values will hard-fail
# (e.g. "--connect-timeout" or "--retry" with an empty argument).
DOWNLOAD_CONNECT_TIMEOUT ?= 30
DOWNLOAD_RETRIES ?= 3
# Generic source mirror used when a primary upstream is down.
# You can override this at make time: make FALLBACK_DOWNLOAD_PATH=...
FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources
@@ -0,0 +1 @@
412e5a7ef02f2b543b1c38c9df675b1009de60ecd9012f617d18c2fa1daa4979 bdb-4.8.30-df2bbef2.tar.gz
@@ -0,0 +1 @@
4dd485972c9dce0e3730b51595570e83c9988a4b8022c8b1b20a26410d07255b boost-1_64_0-435c48bb.tar.gz
@@ -0,0 +1 @@
4a9de30729a57712ede52a07eb779c3e5da2565776de22fe6d3b1bb48b24e526 gmp-6.1.2-a0c3cd6c.tar.gz
@@ -0,0 +1 @@
c8bbd13de351dec92df839faa1305ded3cf7cbabd94ddb9b89dfce14cb7f6966 libevent-2.1.8-stable-75430d39.tar.gz
@@ -0,0 +1 @@
ccc3f8517a3a8b40a7f5de62894a8ee2975b3f7586288312a5c41862f462700e miniupnpc-2.0.20180203-4b75ae22.tar.gz
@@ -0,0 +1 @@
e2f67e0ef8a22fdcad4973d4c275ab20eb9e4555210ef7cd4cfca2c5a760f662 openssl-1.0.1k-ad10dd7c.tar.gz
@@ -0,0 +1 @@
00d47d8a14f0572c7132d469b74e2bccdfa679772dd4423e60b15dab7b90fdcf bdb-4.8.30-a0854a13.tar.gz
@@ -0,0 +1 @@
73544b5dc96aefbc5ced201b929707d84b5a5e6b8ea2c627a13c5bfbca923b0a boost-1_64_0-264637de.tar.gz
@@ -0,0 +1 @@
6db95612ea751fae63a53faaf803afbc2c01b03b07f47025a4ea268f9d9133c6 gmp-6.1.2-5783556c.tar.gz
@@ -0,0 +1 @@
310dbc2e9f5140def1d60cc8395dfd82e85f6701041422d7ba3c1c9a3775afd6 libevent-2.1.8-stable-3b2691a6.tar.gz
@@ -0,0 +1 @@
165ff9c3683896b847d2f2105d8ad1b787164ed0de7c46ac751823cf906ff4e4 miniupnpc-2.0.20180203-29612468.tar.gz
@@ -0,0 +1 @@
95569fc56cd838cdc5d6076a926017d1359cf8a8e0a358e28c494f66031d62d2 openssl-1.0.1k-5861b390.tar.gz
@@ -0,0 +1 @@
e68ccb227c634a1725d74fd5bc398093503f83b47badb36c7156490ff9d79b63 bdb-4.8.30-22e079e7.tar.gz
@@ -0,0 +1 @@
bacee41e1583a37f61acc9f4a5a449aebba007c61edd78fcca69d67112b52599 boost-1_64_0-0c65b3a0.tar.gz
@@ -0,0 +1 @@
ab3124c21687f21053168f74b1ff43bbe9f4e37e1f83e7041b1d1ebbe2887d3e gmp-6.1.2-0410e67a.tar.gz
@@ -0,0 +1 @@
e2c7bb2365760b5863561dbe5b6b8e32ad2146fdedaea3dfff96b864a55fc53b libevent-2.1.8-stable-3c8fbf74.tar.gz
@@ -0,0 +1 @@
17fbf8c83c57732c7b34283f9356ecd4c18673124d4b8e30e6dc3a42dcd1aac5 miniupnpc-2.0.20180203-07b315a2.tar.gz
@@ -0,0 +1 @@
25f8d118ea6292b8863f7a43387cf92f68d13d61aecdc5b9b1afceee95a65a28 openssl-1.0.1k-49e8f834.tar.gz
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
+3 -2
View File
@@ -35,7 +35,8 @@ define fetch_file
endef
define int_get_build_recipe_hash
$(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $(addprefix $(PATCHES_PATH)/$(1)/,$($(1)_patches)) | cut -d" " -f1))
$(eval $(1)_patch_files:=$(wildcard $(addprefix $(PATCHES_PATH)/$(1)/,$($(1)_patches))))
$(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $($(1)_patch_files) | cut -d" " -f1))
$(eval $(1)_recipe_hash:=$(shell echo -n "$($(1)_all_file_checksums)" | $(build_SHA256SUM) | cut -d" " -f1))
endef
@@ -251,4 +252,4 @@ $(foreach package,$(all_packages),$(eval $(call int_config_attach_build_config,$
$(foreach package,$(all_packages),$(eval $(call int_add_cmds,$(package))))
#special exception: if a toolchain package exists, all non-native packages depend on it
$(foreach package,$(packages),$(eval $($(package)_unpacked): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) ))
$(foreach package,$(packages),$(eval $($(package)_unpacked): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) ))
+23
View File
@@ -0,0 +1,23 @@
# Copyright (c) 2026 Agrarian Developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php.
host_arch := x86_64
host_os := linux
host_prefix := $(BASEDIR)/$(HOST)
build_prefix := $(BASEDIR)/build/$(BUILD)
x86_64_linux_host := $(BUILD)
x86_64_linux_prefix := $(host_prefix)
x86_64_linux_id_string := $(HOST)
include hosts/default.mk
include hosts/linux.mk
x86_64_linux_CC := gcc -m64
x86_64_linux_CXX := g++ -m64
x86_64_linux_AR := ar
x86_64_linux_RANLIB := ranlib
x86_64_linux_NM := nm
x86_64_linux_STRIP := strip
+21
View File
@@ -0,0 +1,21 @@
# x86_64 Linux native build (Ubuntu 22.04/24.04)
host_arch := x86_64
host_os := linux
# Where the final host prefix will live (this directory will be created at depends/<host>)
# This must NOT be empty.
host_prefix := $(BASEDIR)/$(HOST)
# Native/build tools prefix
build_prefix := $(BASEDIR)/build/$(BUILD)
# Tell depends what “type” means for this host
x86_64_linux_host := $(HOST)
x86_64_linux_prefix := $(host_prefix)
# Build system identity string (used in build-id hashing)
x86_64_linux_id_string := $(HOST)
# Pull in defaults + linux host settings
include hosts/default.mk
include hosts/linux.mk
+23
View File
@@ -0,0 +1,23 @@
# Copyright (c) 2026 Agrarian Developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php.
host_arch := x86_64
host_os := linux
host_prefix := $(BASEDIR)/$(HOST)
build_prefix := $(BASEDIR)/build/$(BUILD)
x86_64_linux_host := $(BUILD)
x86_64_linux_prefix := $(host_prefix)
x86_64_linux_id_string := $(HOST)
include hosts/default.mk
include hosts/linux.mk
x86_64_linux_CC := gcc -m64
x86_64_linux_CXX := g++ -m64
x86_64_linux_AR := ar
x86_64_linux_RANLIB := ranlib
x86_64_linux_NM := nm
x86_64_linux_STRIP := strip
+6 -3
View File
@@ -1,13 +1,16 @@
package=boost
$(package)_version=1_64_0
$(package)_download_path=https://dl.bintray.com/boostorg/release/1.64.0/source/
# Bintray was shut down; use the official Boost archives mirror.
# NOTE: download_path should NOT end with a trailing slash because the fetch
# helper appends "/$(file)".
$(package)_download_path=https://archives.boost.io/release/1.64.0/source
$(package)_file_name=$(package)_$($(package)_version).tar.bz2
$(package)_sha256_hash=7bcc5caace97baa948931d712ea5f37038dbb1c5d89b43ad4def4ed7cb683332
define $(package)_set_vars
$(package)_config_opts_release=variant=release
$(package)_config_opts_debug=variant=debug
$(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam
$(package)_config_opts=--layout=versioned --build-type=complete --user-config=user-config.jam
$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1
$(package)_config_opts_linux=threadapi=pthread runtime-link=shared
$(package)_config_opts_darwin=--toolset=darwin-4.2.1 runtime-link=shared
@@ -42,4 +45,4 @@ endef
define $(package)_stage_cmds
./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install
endef
endef
+2 -2
View File
@@ -1,6 +1,6 @@
package=openssl
$(package)_version=1.0.1k
$(package)_download_path=https://www.openssl.org/source
$(package)_download_path=https://openssl-library.org/source/old/1.0.1
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=8f9faeaebad088e772f4ef5e38252d472be4d878c6b3a2718c10a4fcebe7a41c
@@ -83,4 +83,4 @@ endef
define $(package)_postprocess_cmds
rm -rf share bin etc
endef
endef
+76 -12
View File
@@ -1,21 +1,85 @@
packages:=boost openssl libevent gmp
# Packages manifest for Agrarian depends system
# Derived from Bitcoin Core depends layout, adapted for this codebase.
#
# This file defines:
# - packages: the set of packages built for the target HOST
# - native_packages: build-machine tools needed during the build
# - all_packages: union of both
#
# Feature toggles (override on make command line if needed):
# NO_QT=1 -> disable Qt GUI deps
# USE_WALLET=1 -> enable BerkeleyDB wallet deps
# USE_ZMQ=1 -> enable ZeroMQ deps
# USE_UPNP=1 -> enable miniupnpc deps
qt_native_packages = native_protobuf
qt_packages = qrencode protobuf zlib
# ---- Base packages (always) ----
packages := boost openssl libevent gmp
qt_linux_packages:=qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans
# ---- Feature toggles (defaults) ----
NO_QT ?= 1
USE_WALLET ?= 1
USE_ZMQ ?= 0
USE_UPNP ?= 1
qt_darwin_packages=qt
qt_mingw32_packages=qt
# ---- Group definitions (as you had them) ----
qt_native_packages := native_protobuf
qt_packages := qrencode protobuf zlib
wallet_packages=bdb
qt_linux_packages := qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans
qt_darwin_packages := qt
qt_mingw32_packages := qt
zmq_packages=zeromq
upnp_packages=miniupnpc
darwin_native_packages = native_biplist native_ds_store native_mac_alias
wallet_packages := bdb
zmq_packages := zeromq
upnp_packages := miniupnpc
darwin_native_packages := native_biplist native_ds_store native_mac_alias
ifneq ($(build_os),darwin)
darwin_native_packages += native_cctools native_cdrkit native_libdmg-hfsplus
endif
# ---- Fold optional groups into 'packages' and 'native_packages' ----
native_packages :=
# Qt (and Qt-native tools)
ifeq ($(NO_QT),0)
packages += $(qt_packages)
native_packages += $(qt_native_packages)
# Host OS specific Qt dependency set
ifeq ($(host_os),linux)
packages += $(qt_linux_packages)
endif
ifeq ($(host_os),darwin)
packages += $(qt_darwin_packages)
native_packages += $(darwin_native_packages)
endif
ifeq ($(host_os),mingw32)
packages += $(qt_mingw32_packages)
endif
else
# Even if Qt is off, darwin native tools may still be required for packaging
ifeq ($(host_os),darwin)
native_packages += $(darwin_native_packages)
endif
endif
# Wallet / BerkeleyDB
ifeq ($(USE_WALLET),1)
packages += $(wallet_packages)
endif
# ZeroMQ
ifeq ($(USE_ZMQ),1)
packages += $(zmq_packages)
endif
# UPnP
ifeq ($(USE_UPNP),1)
packages += $(upnp_packages)
endif
# ---- Final sets ----
all_packages := $(sort $(packages) $(native_packages))
packages := $(sort $(packages))
native_packages := $(sort $(native_packages))
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz
@@ -0,0 +1 @@
7bcc5caace97baa948931d712ea5f37038dbb1c5d89b43ad4def4ed7cb683332 boost_1_64_0.tar.bz2
@@ -0,0 +1 @@
5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2 gmp-6.1.2.tar.bz2
@@ -0,0 +1 @@
316ddb401745ac5d222d7c529ef1eada12f58f6376a66c1118eee803cb70f83d release-2.1.8-stable.tar.gz
@@ -0,0 +1 @@
90dda8c7563ca6cd4a83e23b3c66dbbea89603a1675bfdb852897c2c9cc220b7 miniupnpc-2.0.20180203.tar.gz
@@ -0,0 +1 @@
8f9faeaebad088e772f4ef5e38252d472be4d878c6b3a2718c10a4fcebe7a41c openssl-1.0.1k.tar.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.