diff options
Diffstat (limited to 'dev-build/netsurf-buildsystem')
5 files changed, 133 insertions, 0 deletions
diff --git a/dev-build/netsurf-buildsystem/Manifest b/dev-build/netsurf-buildsystem/Manifest new file mode 100644 index 000000000000..1e6a45d6ddc2 --- /dev/null +++ b/dev-build/netsurf-buildsystem/Manifest @@ -0,0 +1 @@ +DIST buildsystem-1.9.tar.gz 38723 BLAKE2B 0fc4aae4f9a21058c7e437170e74147f6b6dc20220d53986a212e717846d5738df2771081f000705cd69335fbe61653b24a3e86d454a53b24f9cadd5e7aaac97 SHA512 52d7181af56946b95f22d5cc8fb2c58287fe43c940d4104e4a05744cfe332d0e0ea6da76cb8d635eb34cac4d66f53dc01ac5f440b82a207265d39744f112a80d diff --git a/dev-build/netsurf-buildsystem/files/gentoo-helpers-r2.sh b/dev-build/netsurf-buildsystem/files/gentoo-helpers-r2.sh new file mode 100644 index 000000000000..403279ecc5f6 --- /dev/null +++ b/dev-build/netsurf-buildsystem/files/gentoo-helpers-r2.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +netsurf_define_makeconf() { + NETSURF_MAKECONF=( + PREFIX="${EPREFIX}/usr" + NSSHARED="${EPREFIX}/usr/share/netsurf-buildsystem" + LIBDIR="$(get_libdir)" + Q= + CC="$(tc-getCC)" + LD="$(tc-getLD)" + HOST_CC="\$(CC)" + BUILD_CC="$(tc-getBUILD_CC)" + CXX="$(tc-getCXX)" + BUILD_CXX="$(tc-getBUILD_CXX)" + CCOPT= + CCNOOPT= + CCDBG= + LDDBG= + AR="$(tc-getAR)" + WARNFLAGS= + ) +} diff --git a/dev-build/netsurf-buildsystem/files/netsurf-buildsystem-1.9-parallel-pre-post-targets.patch b/dev-build/netsurf-buildsystem/files/netsurf-buildsystem-1.9-parallel-pre-post-targets.patch new file mode 100644 index 000000000000..f1e51e7c5251 --- /dev/null +++ b/dev-build/netsurf-buildsystem/files/netsurf-buildsystem-1.9-parallel-pre-post-targets.patch @@ -0,0 +1,74 @@ +From 067a5105a76e51eebcdf7e7786d1f91040442d47 Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky <michael@orlitzky.com> +Date: Mon, 14 Aug 2023 13:23:09 -0400 +Subject: makefiles/Makefile.top: dependencies for PRE_ and POST_TARGETS + +The PRE_TARGETS and POST_TARGETS are supposed to be built before and +after $(OBJECTS), respectively -- at least according to the comments +in Makefile.top: + + # List of targets to run before building $(OBJECT) + PRE_TARGETS := + # List of targets to run after building $(OBJECT) + POST_TARGETS := + +The default target however builds them at the same time as $(OUTPUT), + + # Default target + all: $(PRE_TARGETS) $(OUTPUT) $(POST_TARGETS) + +where $(OUTPUT) basically just builds $(OBJECTS): + + $(OUTPUT): $(BUILDDIR)/stamp $(OBJECTS) + ... + +As a result, there is a race condition when $(OBJECTS) truly requires +$(PRE_TARGETS), because they may be built at the same time. The same +problem arises the other way around with $(POST_TARGETS). As a +demonstration, one can try to build the libsvgtiny shared library +directly (note: the details are platform-dependent), + + $ BD=build-x86_64-pc-linux-gnu-x86_64-pc-linux-gnu-release-lib-shared + $ make COMPONENT_TYPE=lib-shared "${BD}/libsvgtiny.so.0.1.7" + COMPILE: src/svgtiny.c + ... + src/svgtiny.c:24:10: fatal error: autogenerated_colors.c: No such file or directory + 24 | #include "autogenerated_colors.c" + | ^~~~~~~~~~~~~~~~~~~~~~~~ + compilation terminated. + +This is because $(PRE_TARGETS) is not satisfied. In practice, this +condition seems hard to hit unintentionally, but it can happen if you +are building in parallel and extemely unlucky. A user discovered it in +Gentoo bug 711200. + +The fix simply adds the stated dependencies on $(OBJECTS) and +$(POST_TARGETS) to guarantee the correct order. +--- + makefiles/Makefile.top | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/makefiles/Makefile.top b/makefiles/Makefile.top +index 0b0fe22..2a41697 100644 +--- a/makefiles/Makefile.top ++++ b/makefiles/Makefile.top +@@ -422,6 +422,16 @@ else + endif + endif + ++ifneq ($(PRE_TARGETS),) ++# Ensure that PRE_TARGETS are built before OBJECTS. ++$(OBJECTS): $(PRE_TARGETS) ++endif ++ ++ifneq ($(POST_TARGETS),) ++# Ensure that POST_TARGETS are built after OBJECTS. ++$(POST_TARGETS): $(OBJECTS) ++endif ++ + ############################################################################### + # Autogenerated, implied rules + ############################################################################### +-- +cgit v1.2.1 + diff --git a/dev-build/netsurf-buildsystem/metadata.xml b/dev-build/netsurf-buildsystem/metadata.xml new file mode 100644 index 000000000000..f2908ee10b59 --- /dev/null +++ b/dev-build/netsurf-buildsystem/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>mjo@gentoo.org</email> + <name>Michael Orlitzky</name> + </maintainer> +</pkgmetadata> diff --git a/dev-build/netsurf-buildsystem/netsurf-buildsystem-1.9-r2.ebuild b/dev-build/netsurf-buildsystem/netsurf-buildsystem-1.9-r2.ebuild new file mode 100644 index 000000000000..b284e33d542c --- /dev/null +++ b/dev-build/netsurf-buildsystem/netsurf-buildsystem-1.9-r2.ebuild @@ -0,0 +1,28 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_P="buildsystem-${PV}" +DESCRIPTION="Build system used for netsurf and its libs" +HOMEPAGE="https://www.netsurf-browser.org" +SRC_URI="https://download.netsurf-browser.org/libs/releases/${MY_P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ppc ppc64 ~riscv sparc x86" + +S="${WORKDIR}/${MY_P}" + +PATCHES=( "${FILESDIR}/${P}-parallel-pre-post-targets.patch" ) + +src_prepare() { + default + sed -e 's:/bin/which:which:' -i "makefiles/Makefile.tools" || die +} + +src_install() { + emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install + insinto /usr/share/netsurf-buildsystem + newins "${FILESDIR}/gentoo-helpers-r2.sh" gentoo-helpers.sh +} |