From 39ba23f5728bb7075c6483fbd15bd0f0e38e062c Mon Sep 17 00:00:00 2001 From: Matheus Date: Wed, 10 Sep 2025 21:39:57 -0300 Subject: [PATCH] ports: xbps --- host-recipes/xbinutils | 2 +- patches/libarchive/jinx-working-patch.patch | 20 ++++++++++++++++ patches/xbps/jinx-working-patch.patch | 26 +++++++++++++++++++++ recipes/binutils | 2 +- recipes/libarchive | 26 +++++++++++++++++++++ recipes/xbps | 21 +++++++++++++++++ source-recipes/libarchive | 9 +++++++ source-recipes/xbps | 9 +++++++ 8 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 patches/libarchive/jinx-working-patch.patch create mode 100644 patches/xbps/jinx-working-patch.patch create mode 100644 recipes/libarchive create mode 100644 recipes/xbps create mode 100644 source-recipes/libarchive create mode 100644 source-recipes/xbps diff --git a/host-recipes/xbinutils b/host-recipes/xbinutils index 01b645d2..e0af673c 100644 --- a/host-recipes/xbinutils +++ b/host-recipes/xbinutils @@ -5,7 +5,7 @@ imagedeps="build-essential gcc" hostdeps="automake autoconf" configure() { - ${source_dir}/configure --target=x86_64-astral --prefix=${prefix} --with-sysroot=${sysroot_dir} --disable-werror + ${source_dir}/configure --target=x86_64-astral --prefix=${prefix} --with-sysroot=${sysroot_dir} --disable-werror --enable-default-execstack=no } build() { diff --git a/patches/libarchive/jinx-working-patch.patch b/patches/libarchive/jinx-working-patch.patch new file mode 100644 index 00000000..0e13a65c --- /dev/null +++ b/patches/libarchive/jinx-working-patch.patch @@ -0,0 +1,20 @@ +diff --git libarchive-clean/build/autoconf/config.sub libarchive-workdir/build/autoconf/config.sub +index dba16e8..564ee86 100755 +--- libarchive-clean/build/autoconf/config.sub ++++ libarchive-workdir/build/autoconf/config.sub +@@ -1723,7 +1723,7 @@ case $os in + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. +- gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ ++ gnu* | astral* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ +diff --git libarchive-workdir/build/cmake/Platform/Astral.cmake libarchive-workdir/build/cmake/Platform/Astral.cmake +new file mode 100644 +index 0000000..54a156b +--- /dev/null ++++ libarchive-workdir/build/cmake/Platform/Astral.cmake +@@ -0,0 +1 @@ ++include(Platform/UnixPaths) diff --git a/patches/xbps/jinx-working-patch.patch b/patches/xbps/jinx-working-patch.patch new file mode 100644 index 00000000..7bc9ef75 --- /dev/null +++ b/patches/xbps/jinx-working-patch.patch @@ -0,0 +1,26 @@ +diff --git xbps-clean/configure xbps-workdir/configure +index 8e6b2db..7079ab8 100755 +--- xbps-clean/configure ++++ xbps-workdir/configure +@@ -3,6 +3,8 @@ + + VERSION=0.60 + ++alias pkg-config=${ASTRAL_XBPS_PKG_CONFIG} ++ + # Ensure that we do not inherit these from env + OS= + BUILD= +diff --git xbps-clean/lib/fetch/ftp.c xbps-workdir/lib/fetch/ftp.c +index 877b70d..a303d18 100644 +--- xbps-clean/lib/fetch/ftp.c ++++ xbps-workdir/lib/fetch/ftp.c +@@ -138,7 +138,7 @@ unmappedaddr(struct sockaddr_in6 *sin6, socklen_t *len) + sin4->sin_port = port; + sin4->sin_family = AF_INET; + *len = sizeof(struct sockaddr_in); +-#ifndef __linux__ ++#if !defined(__linux__) && !defined(__astral__) + sin4->sin_len = sizeof(struct sockaddr_in); + #endif + } diff --git a/recipes/binutils b/recipes/binutils index d670f973..1e9c42fd 100644 --- a/recipes/binutils +++ b/recipes/binutils @@ -6,7 +6,7 @@ hostdeps="xgcc xbinutils automake autoconf" deps="base" configure() { - ${source_dir}/configure --host=x86_64-astral --target=x86_64-astral --prefix=${prefix} --disable-werror + ${source_dir}/configure --host=x86_64-astral --target=x86_64-astral --prefix=${prefix} --disable-werror --enable-default-execstack=no } build() { diff --git a/recipes/libarchive b/recipes/libarchive new file mode 100644 index 00000000..9730d143 --- /dev/null +++ b/recipes/libarchive @@ -0,0 +1,26 @@ +name=libarchive +revision=1 +from_source=libarchive +imagedeps="build-essential cmake" +hostdeps="xgcc xbinutils pkgconfig libtool" +deps="base bzip2 libexpat libxml zlib" + +configure() { + #${source_dir}/configure --prefix=/usr --host=x86_64-astral --disable-static --enable-shared + cmake \ + -DPKG_CONFIG_EXECUTABLE="/usr/local/bin/x86_64-astral-pkg-config" \ + -DCMAKE_TOOLCHAIN_FILE=${base_dir}/util/cmake \ + -DCMAKE_INSTALL_PREFIX=${prefix} \ + -DCMAKE_BUILD_TYPE=Release \ + -DENABLE_STATIC=FALSE \ + -DCMAKE_INSTALL_LIBDIR=lib \ + ${source_dir} +} + +build() { + make -j${parallelism} +} + +package() { + DESTDIR=${dest_dir} make install +} diff --git a/recipes/xbps b/recipes/xbps new file mode 100644 index 00000000..1d4f2068 --- /dev/null +++ b/recipes/xbps @@ -0,0 +1,21 @@ +name=xbps +revision=1 +from_source=xbps +imagedeps="build-essential" +hostdeps="xgcc xbinutils pkgconfig" +deps="base libarchive openssl zlib" + +configure() { + cp -rp ${source_dir}/* . + CFLAGS="${CFLAGS} -Wno-error" ASTRAL_XBPS_PKG_CONFIG=x86_64-astral-pkg-config ./configure --host=x86_64-astral --prefix=${prefix} --sysconfdir=/etc --verbose +} + +build() { + make -j ${parallelism} AR=x86_64-astral-ar RANLIB=x86_64-astral-ranlib +} + +package() { + make install DESTDIR=${dest_dir} + + sed -i "s/ARCH_HERE/${JINX_ARCH}/g" "${dest_dir}${prefix}"/share/xbps.d/00-repository-main.conf +} diff --git a/source-recipes/libarchive b/source-recipes/libarchive new file mode 100644 index 00000000..4e0694f4 --- /dev/null +++ b/source-recipes/libarchive @@ -0,0 +1,9 @@ +name=libarchive +version=3.8.1 +source_method=tarball +tarball_url=https://github.com/libarchive/libarchive/releases/download/v${version}/libarchive-${version}.tar.xz +tarball_sha512=c794d1c6e6a6dcf4072438dc4e8ce5b1530bbe9ad40afad18f4e6a444aa5d85e48c58cfbd8af41d4d25e93844956de3ce262cb1d68097d2e5f95bd87b5a982b7 + +prepare() { + true +} diff --git a/source-recipes/xbps b/source-recipes/xbps new file mode 100644 index 00000000..b9980390 --- /dev/null +++ b/source-recipes/xbps @@ -0,0 +1,9 @@ +name=xbps +version=0.60.5 +source_method=tarball +tarball_url="https://github.com/void-linux/xbps/archive/refs/tags/${version}.tar.gz" +tarball_sha512=a820dc74d0a25490a917eecc087c88fb8c9d1245c16e6e7be508ac8b650e19d8e3265684f1171a824c284f3c1febba8c5cabd471c3722883c533c908db7e92bb + +prepare() { + true +}