From 98668355af8412c79dc29abf0a936ccb55f37d10 Mon Sep 17 00:00:00 2001 From: Timmy Welch Date: Sun, 2 Mar 2025 23:14:26 -0800 Subject: [PATCH] Updates --- .gitignore | 2 + Dockerfile | 2 +- Makefile | 16 +++++-- docker_build.sh | 6 +-- include/bash-musl.patch | 83 ++++++++++++++++++++++++++++++++++++ include/bash.mak | 10 ++++- include/busybox.mak | 2 +- include/curl.mak | 16 +++---- include/expat.mak | 2 +- include/git-2.35.1.patch | 92 ---------------------------------------- include/git.mak | 12 +++--- include/iproute2.mak | 61 ++++++++++++++++++++++++++ include/libmnl.mak | 64 ++++++++++++++++++++++++++++ include/libressl.mak | 2 +- include/musl.mak | 4 +- include/ncurses.mak | 2 +- include/nmap.mak | 2 +- include/openssl.mak | 2 +- include/readline.mak | 2 +- include/socat.mak | 2 +- include/strace.mak | 2 +- include/wolfssl.mak | 3 +- include/zlib.mak | 2 +- include/zstd.mak | 2 +- 24 files changed, 265 insertions(+), 128 deletions(-) create mode 100644 include/bash-musl.patch delete mode 100644 include/git-2.35.1.patch create mode 100644 include/iproute2.mak create mode 100644 include/libmnl.mak diff --git a/.gitignore b/.gitignore index 33b7d25..e6e5880 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,5 @@ Temporary Items # Built Visual Studio Code Extensions *.vsix + +work/ diff --git a/Dockerfile b/Dockerfile index 5c43430..a00a3eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN apt-get update && apt-get upgrade -y \ make autoconf automake libtool patch \ flex bison \ curl \ - tar gzip bzip2 xz-utils + tar gzip bzip2 xz-utils cmake build-essential pkg-config linux-headers-generic RUN mkdir -p "/build" && chown 1000:1000 /build COPY "Makefile" "/build/" diff --git a/Makefile b/Makefile index 1c3e850..2d13e42 100644 --- a/Makefile +++ b/Makefile @@ -108,6 +108,7 @@ MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) MAKEFILE_DIR := $(patsubst %/,%,$(dir $(MAKEFILE_PATH))) SOURCE_ROOT := $(MAKEFILE_DIR)/sources +WORK_ROOT := $(MAKEFILE_DIR)/work OUTPUT_ROOT := $(MAKEFILE_DIR)/output TOOLCHAIN_ROOT := $(MAKEFILE_DIR)/sysroot @@ -115,6 +116,7 @@ SYSROOT := $(TOOLCHAIN_ROOT)/$(TARGET) OUTPUT := $(OUTPUT_ROOT)/$(TARGET) PKG_CONFIG_PATH := $(TOOLCHAIN_ROOT)/lib/pkgconfig +CMAKE_DEFAULTS = -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=$(SYSROOT) -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_FIND_ROOT_PATH=$(TOOLCHAIN_ROOT) -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY # Having whitespace in our build paths _will_ result in failures. # In addition to failures, a path containing whitespace may cause an # improperly quoted $(RM) to delete things outside of the build directory. @@ -152,7 +154,7 @@ define untar_to_dir mkdir -p "$(dir $(2))" $(DOWNLOAD) "$(2).tgz" "$(1)" mkdir -p "$(2).tmp" -tar --strip-components=1 -C "$(2).tmp" -xf "$(2).tgz" +tar xf "$(2).tgz" --strip-components=1 -C "$(2).tmp" $(RM) "$(2).tgz" mv "$(2).tmp" "$(2)" endef @@ -192,7 +194,9 @@ else all_recipes += $$(name) endif -src := $$(SOURCE_ROOT)/$$(name)-$$(version) +orig_src := $$(SOURCE_ROOT)/$$(name)-$$(version) +work_src := $$(WORK_ROOT)/$$(name)-$$(version) +src := $$(work_src) bin_paths := $$(addprefix $$(OUTPUT)/bin/,$$(bin_names)) lib_paths := $$(addprefix $$(SYSROOT)/lib/,$$(lib_names)) @@ -208,6 +212,7 @@ $$(bin_names) $$(lib_names): | $$(bin_paths) $$(lib_paths) # so binding them here the only way to guarantee the correct value. $$(bin_paths) $$(lib_paths): override URL := $$(url) $$(bin_paths) $$(lib_paths): override SRC := $$(src) +$$(bin_paths) $$(lib_paths): override ORIG_SRC := $$(orig_src) # We potentially have multiple output files generated from one recipe. # If not handled correctly, building one program from the list can result in the @@ -238,8 +243,13 @@ endif # Here we merely provide the recipe definition and base dependencies. $$(BUILD_FLAG): $$(src) | $$$$(MUSL) -$$(src): +$$(orig_src): + echo orig $$(ORIG_SRC) $$(call untar_to_dir,$$(URL),$$@) + +$$(work_src): $$(orig_src) + rm -rf $$(SRC) + cp -a $$(ORIG_SRC) $$(SRC) endef # Never implicitly pass this makefile's command-line variables diff --git a/docker_build.sh b/docker_build.sh index 8b88adf..c519941 100755 --- a/docker_build.sh +++ b/docker_build.sh @@ -7,7 +7,7 @@ set -e if [ -e .docker_context ]; then rm -r .docker_context/* fi -mkdir -p .docker_context output sources sysroot -cp -r Dockerfile Makefile include .docker_context +mkdir -p .docker_context output sources work sysroot +cp -a Dockerfile Makefile include .docker_context docker build -t static-builder .docker_context -docker run -it -v "${PWD}/output":"/build/output:Z" -v "${PWD}/sources":"/build/sources:Z" --rm static-builder "$@" +docker run -it -v "${PWD}/output":"/build/output:Z" -v "${PWD}/sources":"/build/sources:Z" -v "${PWD}/work":"/build/work:Z" -v "${PWD}/sysroot":"/build/sysroot:Z" --rm static-builder "$@" diff --git a/include/bash-musl.patch b/include/bash-musl.patch new file mode 100644 index 0000000..5f41e22 --- /dev/null +++ b/include/bash-musl.patch @@ -0,0 +1,83 @@ +diff --git a/builtins/wait.def b/builtins/wait.def +index b066d78..1a49430 100644 +--- a/builtins/wait.def ++++ b/builtins/wait.def +@@ -1,4 +1,4 @@ +-'This file is wait.def, from which is created wait.c. ++This file is wait.def, from which is created wait.c. + It implements the builtin "wait" in Bash. + + Copyright (C) 1987-2021 Free Software Foundation, Inc. +diff --git a/configure b/configure +index 28e0913..0c3ef2c 100755 +--- a/configure ++++ b/configure +@@ -20432,7 +20432,6 @@ printf "%s\n" "#define HAVE_DECL_STRTOIMAX $ac_have_decl" >>confdefs.h + if test "$ac_cv_have_decl_strtoimax" = "yes" ; then + HAVE_DECL_STRTOIMAX=1 + fi +- + if test "$HAVE_STRTOIMAX" = 0 || test "$HAVE_DECL_STRTOIMAX" = 0 ; then + bash_cv_func_strtoimax=no REPLACE_STRTOIMAX=1 + else +@@ -20443,7 +20442,11 @@ fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_func_strtoimax" >&5 + printf "%s\n" "$bash_cv_func_strtoimax" >&6; } +-if test $bash_cv_func_strtoimax = yes; then ++if test "$ac_cv_have_decl_strtoimax" = "yes" ; then ++printf "%s\n" "#define HAVE_DECL_STRTOIMAX 1" >>confdefs.h ++ ++fi ++if test $bash_cv_func_strtoimax = no; then + case " $LIBOBJS " in + *" strtoimax.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtoimax.$ac_objext" +diff --git a/m4/strtoimax.m4 b/m4/strtoimax.m4 +index 3098572..4d6cb3b 100644 +--- a/m4/strtoimax.m4 ++++ b/m4/strtoimax.m4 +@@ -21,7 +21,6 @@ AC_CACHE_VAL(bash_cv_func_strtoimax, + if test "$ac_cv_have_decl_strtoimax" = "yes" ; then + HAVE_DECL_STRTOIMAX=1 + fi +- + if test "$HAVE_STRTOIMAX" = 0 || test "$HAVE_DECL_STRTOIMAX" = 0 ; then + bash_cv_func_strtoimax=no REPLACE_STRTOIMAX=1 + else +@@ -29,7 +28,10 @@ AC_CACHE_VAL(bash_cv_func_strtoimax, + fi + ]) + AC_MSG_RESULT($bash_cv_func_strtoimax) +-if test $bash_cv_func_strtoimax = yes; then ++if test "$ac_cv_have_decl_strtoimax" = "yes" ; then ++AC_DEFINE([HAVE_DECL_STRTOIMAX], [1]) ++fi ++if test $bash_cv_func_strtoimax = no; then + AC_LIBOBJ(strtoimax) + fi + ]) +diff --git a/tests/array.right b/tests/array.right +index 6227885..36d4936 100644 +--- a/tests/array.right ++++ b/tests/array.right +@@ -757,6 +757,8 @@ declare -A A=([$'\t']="X" ["*"]="X" [" "]="X" ["@"]="X" ) + declare -A A=(["*"]="X" ["@"]="X" ) + ./array27.sub: line 76: declare: `A[]]=X': not a valid identifier + declare -A A=(["*"]="X" ["@"]="X" ) ++./array27.sub: line 81: y[]: bad array subscript ++./array27.sub: line 81: y[]: bad array subscript + declare -a bug4=([0]="" [1]="5" [2]="" [3]="1" [4]="") + declare -a bug=([0]="" [1]="5" [2]="" [3]="1" [4]="") + declare -a bug2=([0]="") +diff --git a/tests/array27.sub b/tests/array27.sub +index e2a1e70..8564564 100644 +--- a/tests/array27.sub ++++ b/tests/array27.sub +@@ -76,3 +76,6 @@ for k in ']' '*' '@'; do + declare "A[$k]=X" + done + declare -p A ++ ++# empty arrays in arith contexts ++(( y[$none] )) diff --git a/include/bash.mak b/include/bash.mak index 2d34f8b..0bcf0d3 100644 --- a/include/bash.mak +++ b/include/bash.mak @@ -1,5 +1,5 @@ NAME := bash -BASH_VERSION := 5.1.16 +BASH_VERSION := 5.2.32 BASH_URL := https://ftp.gnu.org/gnu/bash/bash-$(BASH_VERSION).tar.gz BASH_PROGRAMS := bash BASH_LIBRARIES := @@ -14,10 +14,16 @@ $(eval $(call create_recipes, \ $(BASH_LIBRARIES), \ )) +BASH_MUSL_PATCH := $(src)/.musl + +$(BASH_MUSL_PATCH): $(src) + cd "$(SRC)" && patch -p1 < $(MAKEFILE_DIR)/include/bash-musl.patch + touch $(BASH_MUSL_PATCH) + $(BUILD_FLAG): $(eval $(call activate_toolchain,$@)) cd "$(SRC)" && ./configure \ - $(CONFIGURE_DEFAULTS) \ + $(CONFIGURE_DEFAULTS) --without-bash-malloc \ --enable-static-link \ $(BASH_CONFIG) \ CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" diff --git a/include/busybox.mak b/include/busybox.mak index cd89381..de8618b 100644 --- a/include/busybox.mak +++ b/include/busybox.mak @@ -1,5 +1,5 @@ NAME := busybox -BUSYBOX_VERSION := 1.36.0 +BUSYBOX_VERSION := 1.36.1 BUSYBOX_URL := https://busybox.net/downloads/busybox-$(BUSYBOX_VERSION).tar.bz2 BUSYBOX_PROGRAMS := busybox BUSYBOX_LIBRARIES := diff --git a/include/curl.mak b/include/curl.mak index f929cd4..a397b1d 100644 --- a/include/curl.mak +++ b/include/curl.mak @@ -1,16 +1,16 @@ NAME := curl -CURL_VERSION := 8.0.1 +CURL_VERSION := 8.9.1 CURL_URL := https://github.com/curl/curl/releases/download/curl-$(subst .,_,$(CURL_VERSION))/curl-$(CURL_VERSION).tar.gz CURL_PROGRAMS := curl CURL_LIBRARIES := libcurl.a -CURL_CONFIG = --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt +CURL_CONFIG = --with-ca-bundle=/etc/ssl/ca-bundle.pem # WolfSSL results in a much smaller binary (around 1MB). # The only reason you'd use OpenSSL here is if you already # need the library for other things and don't care about size. -CURL_SSL := wolfssl -# CURL_SSL := openssl +LIB_SSL := wolfssl +# LIB_SSL := openssl $(eval $(call create_recipes, \ $(NAME), \ @@ -29,7 +29,7 @@ $(BUILD_FLAG): $$(libz) $(eval $(call activate_toolchain,$@)) cd "$(SRC)" && ./configure \ $(CONFIGURE_DEFAULTS) \ - --disable-shared --enable-static --with-$(CURL_SSL) \ + --disable-shared --enable-static --with-$(LIB_SSL) \ $(CURL_CONFIG) \ CFLAGS="$(CFLAGS)" LDFLAGS="$(filter -L%,$(LDFLAGS))" $(MAKE) -C "$(SRC)" clean @@ -37,12 +37,12 @@ $(BUILD_FLAG): $$(libz) $(MAKE) -C "$(SRC)" install # Update dependencies based on chosen SSL library. -ifeq ($(CURL_SSL),wolfssl) +ifeq ($(LIB_SSL),wolfssl) $(BUILD_FLAG): $$(libwolfssl) -else ifeq ($(CURL_SSL),openssl) +else ifeq ($(LIB_SSL),openssl) $(BUILD_FLAG): $$(libssl) else -$(error Invalid CURL_SSL selection: $(CURL_SSL)) +$(error Invalid LIB_SSL selection: $(LIB_SSL)) endif ALL_PROGRAMS += $(CURL_PROGRAMS) diff --git a/include/expat.mak b/include/expat.mak index c4d7566..e9fc946 100644 --- a/include/expat.mak +++ b/include/expat.mak @@ -1,5 +1,5 @@ NAME := libexpat -EXPAT_VERSION := 2.5.0 +EXPAT_VERSION := 2.6.2 # The download URL should point to a tar archive of some sort. # On most systems, tar will handle most compression formats, so diff --git a/include/git-2.35.1.patch b/include/git-2.35.1.patch deleted file mode 100644 index ad2bf14..0000000 --- a/include/git-2.35.1.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 011ef3e69ecc641d085cdba424e7312b8dfc49a8 Mon Sep 17 00:00:00 2001 -From: Juliusz Sosinowicz -Date: Fri, 1 Apr 2022 11:32:23 +0200 -Subject: [PATCH] Patch for wolfSSL - -This patch is made for git version 2.35.1/ - -Compile wolfSSL with: -``` -./configure --enable-opensslextra -make -make install -``` - -Compile git with: -``` -patch -p1 < /path/to/this/patch -make USE_WOLFSSL=1 OPENSSL_SHA1=1 OPENSSL_SHA256=1 -make USE_WOLFSSL=1 OPENSSL_SHA1=1 OPENSSL_SHA256=1 install -``` - -If you gave installed wolfSSL in a non-standard directory then you can use the `WOLFSSSLDIR` variable to point git to that directory as such: -``` -make USE_WOLFSSL=1 OPENSSL_SHA1=1 OPENSSL_SHA256=1 WOLFSSSLDIR=/path/to/wolfssl/install -make USE_WOLFSSL=1 OPENSSL_SHA1=1 OPENSSL_SHA256=1 WOLFSSSLDIR=/path/to/wolfssl/install install -``` - -All of the tests run with `make USE_WOLFSSL=1 OPENSSL_SHA1=1 OPENSSL_SHA256=1 test` should pass ---- - Makefile | 21 +++++++++++++++++++-- - 1 file changed, 19 insertions(+), 2 deletions(-) - -diff --git a/Makefile b/Makefile -index 5580859afd..ad4114759d 100644 ---- a/Makefile -+++ b/Makefile -@@ -27,6 +27,9 @@ all:: - # - # Define NO_OPENSSL environment variable if you do not have OpenSSL. - # -+# Define USE_WOLFSSL environment variable if you want to use wolfSSL instead -+# of OpenSSL -+# - # Define USE_LIBPCRE if you have and want to use libpcre. Various - # commands such as log and grep offer runtime options to use - # Perl-compatible regular expressions instead of standard or extended -@@ -1458,7 +1461,7 @@ else - endif - endif - endif --IMAP_SEND_LDFLAGS += $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO) -+IMAP_SEND_LDFLAGS += $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO) $(WOLFSSL_LINK) - - ifdef ZLIB_PATH - BASIC_CFLAGS += -I$(ZLIB_PATH)/include -@@ -1466,6 +1469,15 @@ ifdef ZLIB_PATH - endif - EXTLIBS += -lz - -+ifdef USE_WOLFSSL -+ NO_OPENSSL = YesPlease -+ ifndef WOLFSSSLDIR -+ WOLFSSSLDIR = /usr/local -+ endif -+ BASIC_CFLAGS += -I$(WOLFSSSLDIR)/include -I$(WOLFSSSLDIR)/include/wolfssl -DEXTERNAL_OPTS_OPENVPN -DUSE_WOLFSSL -+ WOLFSSL_LINK = -L$(WOLFSSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(WOLFSSSLDIR)/$(lib) -+endif -+ - ifndef NO_OPENSSL - OPENSSL_LIBSSL = -lssl - ifdef OPENSSLDIR -@@ -1478,11 +1490,16 @@ ifndef NO_OPENSSL - OPENSSL_LIBSSL += -lcrypto - endif - else -- BASIC_CFLAGS += -DNO_OPENSSL -+ ifndef NO_OPENSSL -+ BASIC_CFLAGS += -DNO_OPENSSL -+ endif - OPENSSL_LIBSSL = - endif - ifdef NO_OPENSSL - LIB_4_CRYPTO = -+ ifdef USE_WOLFSSL -+ LIB_4_CRYPTO = $(WOLFSSL_LINK) -lwolfssl -+ endif - else - ifdef NEEDS_SSL_WITH_CRYPTO - LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl --- -2.25.1 - diff --git a/include/git.mak b/include/git.mak index 48e6ac8..e90e886 100644 --- a/include/git.mak +++ b/include/git.mak @@ -1,5 +1,5 @@ NAME := git -GIT_VERSION := 2.40.1 +GIT_VERSION := 2.46.0 # The download URL should point to a tar archive of some sort. # On most systems, tar will handle most compression formats, so @@ -41,8 +41,8 @@ GIT_WOLFSSL_PATCH := $(src)/.wolfssl # depends on any libraries, add their variable representations to this target's # dependency list. For example, if the package depends on libsomething.a, # add $$(libsomething) to $(BUILD_FLAG)'s dependencies. -$(GIT_WOLFSSL_PATCH): - cd "$(SRC)" && patch -p1 < $(MAKEFILE_DIR)/include/git-wolfssl.patch +$(GIT_WOLFSSL_PATCH): $(src) + cd "$(SRC)" && patch -N -p1 < $(MAKEFILE_DIR)/include/git-wolfssl.patch touch $(GIT_WOLFSSL_PATCH) TOOLS = AR=$(SYSROOT)/bin/$(TARGET)-ar AS=$(SYSROOT)/bin/$(TARGET)-as CC=$(SYSROOT)/bin/$(TARGET)-cc CXX=$(SYSROOT)/bin/$(TARGET)-g++ LD=$(SYSROOT)/bin/$(TARGET)-ld NM=$(SYSROOT)/bin/$(TARGET)-nm OBJCOPY=$(SYSROOT)/bin/$(TARGET)-objcopy OBJDUMP=$(SYSROOT)/bin/$(TARGET)-objdump RANLIB=$(SYSROOT)/bin/$(TARGET)-ranlib READELF=$(SYSROOT)/bin/$(TARGET)-readelf STRIP=$(SYSROOT)/bin/$(TARGET)-strip prefix="$(SYSROOT)" @@ -57,6 +57,7 @@ $(BUILD_FLAG): $$(libz) $$(libcurl) $$(libssl) $$(openssl) $$(curl) $(libexpat) # Optional flags should be put in GIT_CONFIG so the user can override them. $(MAKE) -C "$(SRC)" clean + - $(RM) -rf /tmp/git $(MAKE) -C "$(SRC)" V=1 $(TOOLS) \ NO_REGEX=YesPlease NO_ICONV=YesPlease NO_GETTEXT=YesPlease NO_TCLTK=YesPlease NO_PERL=1 $(SSL_FLAGS) \ CURL_LDFLAGS="-L/build/sysroot/aarch64-linux-musl/lib -lcurl $(SSL_CURL_FLAGS) -lm -lz" \ @@ -69,11 +70,12 @@ $(BUILD_FLAG): $$(libz) $$(libcurl) $$(libssl) $$(openssl) $$(curl) $(libexpat) NO_REGEX=YesPlease NO_ICONV=YesPlease NO_GETTEXT=YesPlease NO_TCLTK=YesPlease NO_PERL=1 $(SSL_FLAGS) \ CURL_LDFLAGS="-L/build/sysroot/aarch64-linux-musl/lib -lcurl $(SSL_CURL_FLAGS) -lm -lz" \ CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(GIT_CONFIG) DESTDIR=/tmp/git install - tar czf $(SYSROOT)/bin/git.tar.gz -C /tmp/git . + cd /tmp/git && tar czf $(SYSROOT)/bin/git.tar.gz * + cd "$(SRC)" && patch -R -p1 < $(MAKEFILE_DIR)/include/git-wolfssl.patch SSL_FLAGS := SSL_CURL_FLAGS := -lssl -lcrypto -ifeq (wolfssl,$(OPENSSL)) +ifeq (wolfssl,$(LIB_SSL)) SSL_FLAGS := USE_WOLFSSL=1 OPENSSL_SHA1=1 OPENSSL_SHA256=1 WOLFSSSLDIR="$(SYSROOT)" SSL_CURL_FLAGS := -lwolfssl diff --git a/include/iproute2.mak b/include/iproute2.mak new file mode 100644 index 0000000..ef542e7 --- /dev/null +++ b/include/iproute2.mak @@ -0,0 +1,61 @@ +NAME := iproute2 +IPROUTE2_VERSION := 6.10.0 + +# The download URL should point to a tar archive of some sort. +# On most systems, tar will handle most compression formats, so +# tar/gzip, tar/bzip2, etc, are fine. If the archive is in a different +# format, a recipe to create $(SRC) will need to be provided. +IPROUTE2_URL := https://mirrors.edge.kernel.org/pub/linux/utils/net/iproute2/iproute2-$(IPROUTE2_VERSION).tar.xz + +# The list of all programs that the package builds. +# These targets can be called and built from the command line. +# If the package provides no programs, leave this list empty. +IPROUTE2_PROGRAMS := ip iproute2.tar.gz + +# The list of library names that the package builds. +# If the package provides no libraries, leave this list empty. +# Libraries will be represented as variables so that other packages may use them. +# For example, libsomething.a will be available as $$(libsomething). +IPROUTE2_LIBRARIES := + +# Allow the user to add any make, autoconf, or configure options that they want. +# Feel free to put any reasonable default values here. +IPROUTE2_CONFIG = + +# This creates the recipe chain that downloads, extracts, builds, and strips +# the binaries created by this package. This makes it so that only the main +# build recipe's contents need to be provided by the package author. +$(eval $(call create_recipes, \ + $(NAME), \ + $(IPROUTE2_VERSION), \ + $(IPROUTE2_URL), \ + $(IPROUTE2_PROGRAMS), \ + $(IPROUTE2_LIBRARIES), \ +)) + +# This is the main build recipe! +# Using $(BUILD_FLAG) as a target, it must compile the sources in $(SRC) and +# install the resulting programs and libraries into $(SYSROOT). If the package +# depends on any libraries, add their variable representations to this target's +# dependency list. For example, if the package depends on libsomething.a, +# add $$(libsomething) to $(BUILD_FLAG)'s dependencies. +$(BUILD_FLAG): $$(libmnl) +# This activates the cross-compiler toolchain by setting/exporting a lot of variables. +# Without this, builds would default to the system's compilers and libraries. + $(eval $(call activate_toolchain,$@)) +# The configure step defines what features should be enabled for the program. +# If available, the --host and --prefix values should always be the values below. +# Try to only hard-code the flags that are critical to a successful static build. +# Optional flags should be put in IPROUTE2_CONFIG so the user can override them. + cd "$(SRC)" && PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:$(SYSROOT)/lib/pkgconfig" ./configure + $(MAKE) -C "$(SRC)" clean EXTRA_CFLAGS="$(CFLAGS)" PREFIX="" LDFLAGS="$(LDFLAGS)" DESTDIR=/tmp/iproute2 + $(MAKE) -C "$(SRC)" HOSTCC=gcc EXTRA_CFLAGS="$(CFLAGS)" PREFIX="" LDFLAGS="$(LDFLAGS)" DESTDIR=/tmp/iproute2 + $(MAKE) -C "$(SRC)" install EXTRA_CFLAGS="$(CFLAGS)" PREFIX="" LDFLAGS="$(LDFLAGS)" DESTDIR=/tmp/iproute2 SUBDIRS="ip misc tc netem" + cd /tmp/iproute2 && rm -rf share/bash-completion/ share/bash include && tar czf $(SYSROOT)/bin/iproute2.tar.gz * + cp -a /tmp/iproute2/sbin/ip $(SYSROOT)/bin/ + +# All programs should add themselves to the ALL_PROGRAMS list. +ALL_PROGRAMS += $(IPROUTE2_PROGRAMS) + +# Only programs that most users would want should be added to DEFAULT_PROGRAMS. +# DEFAULT_PROGRAMS += $(IPROUTE2_PROGRAMS) diff --git a/include/libmnl.mak b/include/libmnl.mak new file mode 100644 index 0000000..cd91ff3 --- /dev/null +++ b/include/libmnl.mak @@ -0,0 +1,64 @@ +NAME := libmnl +LIBMNL_VERSION := 1.0.5 + +# The download URL should point to a tar archive of some sort. +# On most systems, tar will handle most compression formats, so +# tar/gzip, tar/bzip2, etc, are fine. If the archive is in a different +# format, a recipe to create $(SRC) will need to be provided. +LIBMNL_URL := https://www.netfilter.org/projects/libmnl/files/libmnl-$(LIBMNL_VERSION).tar.bz2 + +# The list of all programs that the package builds. +# These targets can be called and built from the command line. +# If the package provides no programs, leave this list empty. +LIBMNL_PROGRAMS := + +# The list of library names that the package builds. +# If the package provides no libraries, leave this list empty. +# Libraries will be represented as variables so that other packages may use them. +# For example, libsomething.a will be available as $$(libsomething). +LIBMNL_LIBRARIES := libmnl.a + +# Allow the user to add any make, autoconf, or configure options that they want. +# Feel free to put any reasonable default values here. +LIBMNL_CONFIG = + +# This creates the recipe chain that downloads, extracts, builds, and strips +# the binaries created by this package. This makes it so that only the main +# build recipe's contents need to be provided by the package author. +$(eval $(call create_recipes, \ + $(NAME), \ + $(LIBMNL_VERSION), \ + $(LIBMNL_URL), \ + $(LIBMNL_PROGRAMS), \ + $(LIBMNL_LIBRARIES), \ +)) + +# This is the main build recipe! +# Using $(BUILD_FLAG) as a target, it must compile the sources in $(SRC) and +# install the resulting programs and libraries into $(SYSROOT). If the package +# depends on any libraries, add their variable representations to this target's +# dependency list. For example, if the package depends on libsomething.a, +# add $$(libsomething) to $(BUILD_FLAG)'s dependencies. +$(BUILD_FLAG): $$(libz) +# This activates the cross-compiler toolchain by setting/exporting a lot of variables. +# Without this, builds would default to the system's compilers and libraries. + $(eval $(call activate_toolchain,$@)) +# The configure step defines what features should be enabled for the program. +# If available, the --host and --prefix values should always be the values below. +# Try to only hard-code the flags that are critical to a successful static build. +# Optional flags should be put in LIBMNL_CONFIG so the user can override them. + cd "$(SRC)" && ./configure \ + $(CONFIGURE_DEFAULTS) \ + --enable-static --disable-shared \ + --with-zlib="$(SYSROOT)" \ + $(LIBMNL_CONFIG) \ + CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" + $(MAKE) -C "$(SRC)" clean + $(MAKE) -C "$(SRC)" + $(MAKE) -C "$(SRC)" install + +# All programs should add themselves to the ALL_PROGRAMS list. +# ALL_PROGRAMS += $(LIBMNL_PROGRAMS) + +# Only programs that most users would want should be added to DEFAULT_PROGRAMS. +# DEFAULT_PROGRAMS += $(LIBMNL_PROGRAMS) diff --git a/include/libressl.mak b/include/libressl.mak index cee0205..c852894 100644 --- a/include/libressl.mak +++ b/include/libressl.mak @@ -1,7 +1,7 @@ ifeq (libressl,$(OPENSSL)) NAME := libressl -LIBRESSL_VERSION := 3.7.1 +LIBRESSL_VERSION := 3.9.2 LIBRESSL_URL := https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-$(LIBRESSL_VERSION).tar.gz LIBRESSL_PROGRAMS := openssl LIBRESSL_LIBRARIES := libssl.a libcrypto.a libtls.a diff --git a/include/musl.mak b/include/musl.mak index f017b5a..d4a221d 100644 --- a/include/musl.mak +++ b/include/musl.mak @@ -1,7 +1,7 @@ # musl-cross-make hasn't had an official release since 2020 but has had many # updates and bigfixes since then. Instead, we'll download a commit directly. NAME := musl-cross-make -MUSL_VERSION := fe91582 +MUSL_VERSION := fd6be58 MUSL_URL := https://github.com/richfelker/musl-cross-make/tarball/$(MUSL_VERSION) MUSL_SRC := $(SOURCE_ROOT)/$(NAME)-$(MUSL_VERSION) MUSL := $(SYSROOT)/bin/$(TARGET)-cc @@ -27,4 +27,4 @@ $(MUSL): | $(MUSL_SRC) OUTPUT="$(SYSROOT)" $(MUSL_SRC): - $(call untar_to_dir,$(MUSL_URL),$@) \ No newline at end of file + $(call untar_to_dir,$(MUSL_URL),$@) diff --git a/include/ncurses.mak b/include/ncurses.mak index c05b966..0fef98d 100644 --- a/include/ncurses.mak +++ b/include/ncurses.mak @@ -1,5 +1,5 @@ NAME := ncurses -NCURSES_VERSION := 6.4 +NCURSES_VERSION := 6.5 NCURSES_URL := https://ftp.gnu.org/gnu/ncurses/ncurses-$(NCURSES_VERSION).tar.gz NCURSES_PROGRAMS := NCURSES_LIBRARIES := libncurses.a libncurses++.a libform.a libmenu.a libpanel.a diff --git a/include/nmap.mak b/include/nmap.mak index 923e308..503059d 100644 --- a/include/nmap.mak +++ b/include/nmap.mak @@ -1,5 +1,5 @@ NAME := nmap -NMAP_VERSION := 7.93 +NMAP_VERSION := 7.95 NMAP_URL := https://nmap.org/dist/nmap-$(NMAP_VERSION).tgz NMAP_PROGRAMS := nmap nping ncat NMAP_LIBRARIES := diff --git a/include/openssl.mak b/include/openssl.mak index 137cb82..8f959ef 100644 --- a/include/openssl.mak +++ b/include/openssl.mak @@ -1,7 +1,7 @@ ifeq (openssl,$(OPENSSL)) NAME := openssl -OPENSSL_VERSION := 3.1.0 +OPENSSL_VERSION := 3.3.1 OPENSSL_URL := https://github.com/openssl/openssl/archive/refs/tags/openssl-$(OPENSSL_VERSION).tar.gz OPENSSL_PROGRAMS := openssl OPENSSL_LIBRARIES := libssl.a libcrypto.a diff --git a/include/readline.mak b/include/readline.mak index 257f62e..d64c764 100644 --- a/include/readline.mak +++ b/include/readline.mak @@ -1,5 +1,5 @@ NAME := readline -READLINE_VERSION := 8.2 +READLINE_VERSION := 8.3 READLINE_URL := https://ftp.gnu.org/gnu/readline/readline-$(READLINE_VERSION).tar.gz READLINE_PROGRAMS := READLINE_LIBRARIES := libreadline.a libhistory.a diff --git a/include/socat.mak b/include/socat.mak index 7bf248b..d6e7470 100644 --- a/include/socat.mak +++ b/include/socat.mak @@ -1,5 +1,5 @@ NAME := socat -SOCAT_VERSION := 1.7.4.4 +SOCAT_VERSION := 1.8.0.0 SOCAT_URL := http://www.dest-unreach.org/socat/download/socat-$(SOCAT_VERSION).tar.gz SOCAT_PROGRAMS := socat procan filan SOCAT_LIBRARIES := diff --git a/include/strace.mak b/include/strace.mak index dcb7a9b..613ff7a 100644 --- a/include/strace.mak +++ b/include/strace.mak @@ -1,5 +1,5 @@ NAME := strace -STRACE_VERSION := 6.2 +STRACE_VERSION := 6.10 STRACE_URL := https://github.com/strace/strace/releases/download/v$(STRACE_VERSION)/strace-$(STRACE_VERSION).tar.xz STRACE_PROGRAMS := strace STRACE_LIBRARIES := diff --git a/include/wolfssl.mak b/include/wolfssl.mak index 546b3cf..c39487b 100644 --- a/include/wolfssl.mak +++ b/include/wolfssl.mak @@ -1,5 +1,5 @@ NAME := wolfssl -WOLFSSL_VERSION := 5.5.0 +WOLFSSL_VERSION := 5.7.2 WOLFSSL_URL := https://github.com/wolfSSL/wolfssl/archive/refs/tags/v$(WOLFSSL_VERSION)-stable.tar.gz WOLFSSL_PROGRAMS := WOLFSSL_LIBRARIES := libwolfssl.a @@ -14,6 +14,7 @@ $(eval $(call create_recipes, \ $(BUILD_FLAG): $(eval $(call activate_toolchain,$@)) + cd "$(SRC)" && sed -i 's@cut >/dev/null 2>&1 /dev/null 2>\&1