diff options
Diffstat (limited to 'dev-build/netsurf-buildsystem')
5 files changed, 137 insertions, 0 deletions
diff --git a/dev-build/netsurf-buildsystem/Manifest b/dev-build/netsurf-buildsystem/Manifest new file mode 100644 index 000000000000..b56ac37e89b4 --- /dev/null +++ b/dev-build/netsurf-buildsystem/Manifest @@ -0,0 +1,5 @@ +AUX gentoo-helpers-r2.sh 388 BLAKE2B 2e7f1fd1eb7d9366514ccad5cb356689005f7028a423b60600ab8297b053ce37b154de37258ef4bfe759bf2b2b4007c3e416eeb3dd9937f75c9c41ef93c1bfc5 SHA512 8aad232d938e4aaac424389833012eb0c29409b8d558cf4cc6e894b7e3baa23ba29364aa1b7a2872bab6b507d52436cd5ecf3d5b42ccc52bcbed2d2c78034b36 +AUX netsurf-buildsystem-1.9-parallel-pre-post-targets.patch 2512 BLAKE2B 21a78fea7e204f1c2d4e2325309d24aef4f668d9a72f54d5f5da28667d635b52a281e0524dfffd70a9017a29200bde8a99caf4b0030d9f48422395d3416dd649 SHA512 5e951ddbfb88fb10e4936f8fc8e335c67e5416829741299cda1074665b189249e5c1b8a08e465161284a978a407bbef385cfdc0ae343d1132c42664045df1c73 +DIST buildsystem-1.9.tar.gz 38723 BLAKE2B 0fc4aae4f9a21058c7e437170e74147f6b6dc20220d53986a212e717846d5738df2771081f000705cd69335fbe61653b24a3e86d454a53b24f9cadd5e7aaac97 SHA512 52d7181af56946b95f22d5cc8fb2c58287fe43c940d4104e4a05744cfe332d0e0ea6da76cb8d635eb34cac4d66f53dc01ac5f440b82a207265d39744f112a80d +EBUILD netsurf-buildsystem-1.9-r2.ebuild 775 BLAKE2B be39e45e36dc46faec18dfcb88b7d86442eb7a6be6a750689f80dc974bc64762fc750b1580fd23fc9ebe980ac0b8537cc209f34c16026851098ec758465c639a SHA512 983a6739f4bcf1ab3e22e743f73d4de39409791d47c0afc4ee139a1a38da8f296f50d94e1e029be55107f9964affa9c6dda525c47e2976a398d7ae6ca21b657b +MISC metadata.xml 253 BLAKE2B 63a51cab94d3e978d2c7dd1d124efd1c9e11c5ae277806a1f12359b2db370c37382fc1947e85940f6b0a439e3d49eecdd8d9bfb96587352d6a83803d2fd40bb6 SHA512 8da7cfe0cd26a54c106f2c029bbde93abf77576835e4fa66bc538dcf12fd41160f7cc2dd843a221962bb9a6f965311c076a1557caa38d503f371569b84841e33 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 +} |