Re: [gentoo-dev] Adding Ada support

2023-12-09 Thread Luke A. Guest

Sorry about the spam, I just squashed the two commits together.From 471dbc22de2c31e4ca4191d70cc8bcbe452f3b97 Mon Sep 17 00:00:00 2001
From: "Luke A. Guest" 
Date: Sat, 9 Dec 2023 18:05:31 +
Subject: [PATCH] Add building Ada support into the base toolchain (GCC)
 mechanics. Add Ada bootstrap ebuilds for all versions of GCC supported.

---
 dev-lang/ada-bootstrap/Manifest   | 13 +
 .../ada-bootstrap/ada-bootstrap-10.ebuild | 25 +
 .../ada-bootstrap/ada-bootstrap-11.ebuild | 25 +
 .../ada-bootstrap/ada-bootstrap-12.ebuild | 25 +
 .../ada-bootstrap/ada-bootstrap-13.ebuild | 25 +
 .../ada-bootstrap/ada-bootstrap-14.ebuild | 25 +
 dev-lang/ada-bootstrap/ada-bootstrap-9.ebuild | 25 +
 dev-lang/ada-bootstrap/metadata.xml   | 12 +
 eclass/toolchain.eclass   | 53 +++
 9 files changed, 219 insertions(+), 9 deletions(-)
 create mode 100644 dev-lang/ada-bootstrap/Manifest
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-10.ebuild
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-11.ebuild
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-12.ebuild
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-13.ebuild
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-14.ebuild
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-9.ebuild
 create mode 100644 dev-lang/ada-bootstrap/metadata.xml

diff --git a/dev-lang/ada-bootstrap/Manifest b/dev-lang/ada-bootstrap/Manifest
new file mode 100644
index 0..07af81d3f
--- /dev/null
+++ b/dev-lang/ada-bootstrap/Manifest
@@ -0,0 +1,13 @@
+DIST ada-bootstrap-10-x86_64.tar.xz 81374924 BLAKE2B 73f831502c1c358a724092e2eae17b13c2905c8c2afe90a24c61d152755cf0c33549eca65f23ed5d2ce893799b7bac9a48c0e2e513b53076e424d1fb5c92c84b SHA512 eb0b89f5912e217ecdabd4867ab68909aca73ea46c300e1ee75fbdfa308d296570af7dde49d56278a1662ac1734619afd105232df680a24d301b81c8bffe927b
+DIST ada-bootstrap-11-x86_64.tar.xz 86529888 BLAKE2B b42d2ca86d721371bd0c363549b3a562e7d92583ba773544b0a14e105980643626abbd0bc1b125836be76842dcca8222606266f9795e678094b80afabb4090b1 SHA512 ef2ccbf9f65aaa2a5b64d696d65319c539f9e28b419d01b619bf66867db924037760374a2dc2c341c154b9c2aa653426ae29ece24d2bf5d91ef1f23d4a1b7e87
+DIST ada-bootstrap-12-x86_64.tar.xz 92699120 BLAKE2B b1f0c2d9ba4711f0f066a640c5a5ae53177826a160a25f31d89f4b402a21bc6a4e432c5cb9bfff10d6a73097c22cec9dfd097649ea6438a41eb4f1226b7478af SHA512 7f257c1e0c7adb6aa92a68e2f8b4bf7191467aafdb592fbc163529390c4de1c661ded3b231b56fe65fa810c190a34b0c17cd2225345dc82a6867dc6f479cec2b
+DIST ada-bootstrap-13-x86_64.tar.xz 94802444 BLAKE2B c0e170b56212897fe15a093e5e8d629a9e3e4aa51ec163d42cdbbe65dd54c30651023d440c0a41dc49d86e6406ac80adbf3761a0c174aeb75e774f4d905b SHA512 8c995f7ad4cf45cddbd98e811807eb5f9908ca35e1b552e0c6e307bfd47b8bdc8b3bc4406637deb7762c3c450da55116a50a3af0fb8ca3877ff6b030ba1b50c2
+DIST ada-bootstrap-14-x86_64.tar.xz 95049476 BLAKE2B 373376f2847bb07f441cc83d73db388722e1b9f6c631aa62fb0e8a9b1f90725b1a7e4e0d38970b8c59a53b76e7b019ddaf505ab52f76698c3db357dfe3382e6f SHA512 a6fc012058aef52bc784c1dc254f0aa31f8e034b517b49d4faef7058fe84c02e9bac564029bd7b05cb97a2ce0a40b875b0378236bd055522012e13069c4affcb
+DIST ada-bootstrap-9-x86_64.tar.xz 70563044 BLAKE2B 4de949ddbc6feb589be93737b794e4bea93bf7e8291f5b1fe31aa5a2c2027594eb4eb1aac46cc42cc2872224e4b6ce556e9126635046e080adee70e48b217934 SHA512 b90f61ef18c6b6203d76698d2dba633e2187d1a623bb0b5ef1c735599b2db2a76765569460ff3d3817f845c575299cf35bb9896998b941cb4a92dab95462e255
+EBUILD ada-bootstrap-10.ebuild 769 BLAKE2B df6d0d857a25d109ed0aef3f06442eee8577c5fb37cc496eb935347a8b5991fbbf800bdfd3d17dcaa2d883fbb5b55be0c46304d863b330ee86f5e578f13b2382 SHA512 bbe1f380b7ab6dcdb43ff7328f3c20ae53b6ace9694bc89c219996a9d46223d9bb662749c658c7120073ffaab5bcb6c7e91370ac13a13e8754235a62870d0454
+EBUILD ada-bootstrap-11.ebuild 769 BLAKE2B a3d123cc8d0f99c47ac9c488261bb706e8ef288345c5ec524ef32f2835b2b5681f15df0932565cc0629970c72cbe6a77b46036851498e8164cbefff43b104e4a SHA512 cda446533f3ef6cc6ffa1380450e0d1c2fa3b8480dbd1f3d84185f9eff7fe7f591ac1827d475542ddb15c8b8477a2791d37e5f59e381c279b296f757c6c40a24
+EBUILD ada-bootstrap-12.ebuild 769 BLAKE2B 928050dca7f68fded8b17a0f22c72b3796e3e63b2f7d390a92a0d6f9ffbafa8b7d0e9f09036b4ea9f3c78075037508e28bbc0caabed21725bf7d5f0f95b82d53 SHA512 8382219d72936882cee12962e3b9f64b9dde8deabc7c9024c09e082f73d048366f920c13777e09b73376fd8f2d446d391eb59bd5453d1cbca151a5052fd1c169
+EBUILD ada-bootstrap-13.ebuild 769 BLAKE2B 417c3711fb149ee44aad787025eff7a48a21fd9a7ceb001cc833d650f6ccb34e91233cf6809053bdb868c216e496732efd22f10828c8f1db7c229d8acc6c6e61 SHA512 fc96ddcc4b5bf18208409e25de933d07a4f895ffc94eb99427c79f92a9565eec8df5b4b5574bcc6c90e654359a5c9e56b7b67b60fc99b72e2bb1667dd01e2834
+EBUILD ada-bootstrap-14.ebuild 769 BLAKE2B a83e0fd49a48c9c9e564f8ea41f46ef8b50e00d215d97b56f54badfb8e4be8c83c5049a4eee99efefbb55bc5550bea2386bf5bf67aa9f42c3525e05ea10d1

Re: [gentoo-dev] Adding Ada support

2023-12-09 Thread Luke A. Guest



On 09/12/2023 15:12, Sam James wrote:


"Luke A. Guest"  writes:


Hi,

Can we add the following patch to the toolchain.eclass? I want to stop
having to mess with this overlay. The diff can be generated by
grabbing the repo https://github.com/Lucretia/ada-overlay and running
./scripts/diff_eclass.sh.


It'd be useful to send the whole lot with `git send-email` as proper
patches which could be `git am`'d.


This is the best I can do rn.
From ba248f432b46473734c506fdc8cadd1bea24b656 Mon Sep 17 00:00:00 2001
From: "Luke A. Guest" 
Date: Sat, 9 Dec 2023 17:32:31 +
Subject: [PATCH 1/2] Add building Ada support into the base toolchain (GCC)
 mechanics.
To: gentoo-dev@lists.gentoo.org

---
 eclass/toolchain.eclass | 53 ++---
 1 file changed, 44 insertions(+), 9 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 60769c938..7368894ab 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -250,7 +250,6 @@ if [[ ${PN} != kgcc64 && ${PN} != gcc-* ]] ; then
 	IUSE+=" go"
 	IUSE+=" +sanitize"  TC_FEATURES+=( sanitize )
 	IUSE+=" graphite" TC_FEATURES+=( graphite )
-	IUSE+=" ada"
 	IUSE+=" vtv"
 	IUSE+=" jit"
 	tc_version_is_between 5.0 9 && IUSE+=" mpx"
@@ -259,6 +258,7 @@ if [[ ${PN} != kgcc64 && ${PN} != gcc-* ]] ; then
 	IUSE+=" systemtap" TC_FEATURES+=( systemtap )
 
 	tc_version_is_at_least 9.0 && IUSE+=" d" TC_FEATURES+=( d )
+	tc_version_is_at_least 9.0 && IUSE+=" ada" TC_FEATURES+=( ada )
 	tc_version_is_at_least 9.1 && IUSE+=" lto"
 	tc_version_is_at_least 10 && IUSE+=" cet"
 	tc_version_is_at_least 10 && IUSE+=" zstd" TC_FEATURES+=( zstd )
@@ -284,8 +284,7 @@ fi
 
 #>> DEPEND <<
 
-RDEPEND="
-	sys-libs/zlib
+RDEPEND="sys-libs/zlib
 	virtual/libiconv
 	nls? ( virtual/libintl )
 "
@@ -311,6 +310,20 @@ BDEPEND="
 		>=sys-devel/autogen-5.5.4
 	)
 "
+
+# Ada in 9.0+ is self-hosting and needs Ada to bootstrap.
+# Taken from the D version below. I'm fairly sure if this is now correct,
+# We should build using either ada-bootstrap: if the installed gcc has
+# Ada disabled or the installed slot which matches the slot being built.
+if tc_has_feature ada ; then
+	if tc_version_is_at_least 9.0 ; then
+		BDEPEND+=" ada? ( || (
+			> Ada Bootstrap slot is ${GCCMAJOR}/${PREVSLOT}"
+
+		# Make sure we set a path to the Ada bootstrap if gcc[ada] is not already
+		# installed. GNAT can usually be built using the last major version and
+		# the current version, at least.
+		if has_version -b "sys-devel/gcc:${SLOT}[ada]" ; then
+			einfo "Using GNAT compiler installed in slot ${SLOT}..."
+
+			PATH="${BINPATH}:${PATH}"
+		elif has_version -b "sys-devel/gcc:${PREVSLOT}[ada]" ; then
+			einfo "Using GNAT compiler installed in previous slot ${PREVSLOT}..."
+
+			PATH="${PREFIX}/${CTARGET}/gcc-bin/${PREVSLOT}:${PATH}"
+		else
+			einfo "Using bootstrap GNAT compiler..."
+
+			PATH="/opt/ada-bootstrap-${GCCMAJOR}/bin:${PATH}"
+
+			export PATH
+		fi
+	fi
+
 	confgcc+=(
 		--prefix="${PREFIX}"
 		--bindir="${BINPATH}"
@@ -1335,6 +1368,8 @@ toolchain_src_configure() {
 	einfo "DATAPATH:${DATAPATH}"
 	einfo "STDCXX_INCDIR:   ${STDCXX_INCDIR}"
 	einfo "Languages:   ${GCC_LANG}"
+	einfo "GCC version: $(gcc -v 2>&1|grep " version " | awk '{ print $3 }')"
+	is_ada && einfo "GNAT version:$(gnat 2>&1|grep GNAT | awk '{ print $2 }')"
 	echo
 
 	# Build in a separate build tree
-- 
2.43.0

From 000a1670e2fb89b51ac24ff8e207e77550468df8 Mon Sep 17 00:00:00 2001
From: "Luke A. Guest" 
Date: Sat, 9 Dec 2023 17:48:02 +
Subject: [PATCH 2/2] Add Ada bootstrap ebuilds for all versions of GCC
 supported.
To: gentoo-dev@lists.gentoo.org

---
 dev-lang/ada-bootstrap/Manifest   | 13 ++
 .../ada-bootstrap/ada-bootstrap-10.ebuild | 25 +++
 .../ada-bootstrap/ada-bootstrap-11.ebuild | 25 +++
 .../ada-bootstrap/ada-bootstrap-12.ebuild | 25 +++
 .../ada-bootstrap/ada-bootstrap-13.ebuild | 25 +++
 .../ada-bootstrap/ada-bootstrap-14.ebuild | 25 +++
 dev-lang/ada-bootstrap/ada-bootstrap-9.ebuild | 25 +++
 dev-lang/ada-bootstrap/metadata.xml   | 12 +
 8 files changed, 175 insertions(+)
 create mode 100644 dev-lang/ada-bootstrap/Manifest
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-10.ebuild
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-11.ebuild
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-12.ebuild
 create mode 

Re: [gentoo-dev] Adding Ada support

2023-12-09 Thread Luke A. Guest

Can we add the following patch to the toolchain.eclass? I want to stop
having to mess with this overlay. The diff can be generated by
grabbing the repo https://github.com/Lucretia/ada-overlay and running
./scripts/diff_eclass.sh.


It'd be useful to send the whole lot with `git send-email` as proper
patches which could be `git am`'d.



Ok, just looked at this. I don't have sendmail installed here. Due to 
the way I've worked on this, the only way I know how to btw and which 
was pointed to initially on the #gentoo-* channels. Which is to have a 
remote (covered in the README from today) in which I can diff the eclass 
with my version to make sure I only ever have ada changes and cherry 
pick what I need into my eclass.


If there is a way, I'll send it, but you'll need to guide me on what I 
need to do to do it.


Thanks,
Luke.




Re: [gentoo-dev] Adding Ada support

2023-12-09 Thread Luke A. Guest
And this is what gcc:13 +ada would install: 
https://gist.github.com/Lucretia/4837322a4d4ea331246600513ed40aaf



On 09/12/2023 15:30, Luke A. Guest wrote:

and FYI, I've been utilising this overlay for Ada for over a year.





Re: [gentoo-dev] Adding Ada support

2023-12-09 Thread Luke A. Guest

and FYI, I've been utilising this overlay for Ada for over a year.



Re: [gentoo-dev] Adding Ada support

2023-12-09 Thread Luke A. Guest




On 09/12/2023 15:12, Sam James wrote:


"Luke A. Guest"  writes:


Hi,

Can we add the following patch to the toolchain.eclass? I want to stop
having to mess with this overlay. The diff can be generated by
grabbing the repo https://github.com/Lucretia/ada-overlay and running
./scripts/diff_eclass.sh.


It'd be useful to send the whole lot with `git send-email` as proper
patches which could be `git am`'d.


Can't really do that as you'd get a lot of stuff that's not required for 
portage.




The only thing I'm not sure about is the BDEPEND stuff.


It looks OK from a glance.



The reason for doing this is because gnat-gpl is dead, more info can
be found here https://www.adacore.com/community.

The
https://github.com/Lucretia/ada-overlay/tree/master/dev-lang/ada-bootstrap
ebuilds provide bootstrap compilers, the archives are hosted on
dropbox, from 9.5.0 -> 14.



What is going to be a problem is using these. We'll need to build our
own.


You can use those to build your own then as you need a bootstrap to 
start with.



The scripts/build-bootstrap.sh script will build a bootstrap for a
particular version based on an env var.



But if this works, I guess that's fine. It would be nice if there were
some we could use from elsewhere somewhat-official that other distros
are using, but if they don't exist, I guess we have to live with it.

We need to do the same for D.


As I said, these are built and packaged as tars, you could change the 
script to add in d as well if you wanted. It's not a complex script, it 
builds what is needed and dumps it to /tmp/opt/ and then installs it to 
/opt with the ebuild.



As for anything in dev-ada/* well, the ada guy would need to work on
that really, I'm not really experienced enough to handle it properly.



Kind of curious as to your interest in Ada if you're not experienced
enough - not intended derogatorily, just know you've been interested
in Ada for a while so I wonder if dev-ada/* is somehow that different
or what..


I'm not experienced enough with ebuilds.



I also wouldn't want to merge something if it's then going to conflict
with anything in dev-ada/*, so at least some coordination is required.

(To that end, cc'd toolchain@ and ada@.)


Yes, as I state in the README, I disable all the ::gentoo ada stuff with 
another script.



Given GCC is masked up to :10 now, the gnat gpr tools / libs might be
easier to get going with single versions covering numerous toolchain
versions.

Alire would need to be added at some point, http://alire.ada.dev/ to
provide an easier way to get packages going.

I originally envisioned gnatmake, gprbuild eclasses to cover building
simple projects with one entry point (gnatmake) and projects
(gprbuild). I think an alire based eclass would need to be added as
well.

Thanks,
Luke.

[2. text/x-patch; gentoo-diff.patch]...







[gentoo-dev] Adding Ada support

2023-12-09 Thread Luke A. Guest

Hi,

Can we add the following patch to the toolchain.eclass? I want to stop 
having to mess with this overlay. The diff can be generated by grabbing 
the repo https://github.com/Lucretia/ada-overlay and running 
./scripts/diff_eclass.sh.


The only thing I'm not sure about is the BDEPEND stuff.

The reason for doing this is because gnat-gpl is dead, more info can be 
found here https://www.adacore.com/community.


The 
https://github.com/Lucretia/ada-overlay/tree/master/dev-lang/ada-bootstrap 
ebuilds provide bootstrap compilers, the archives are hosted on dropbox, 
from 9.5.0 -> 14.


The scripts/build-bootstrap.sh script will build a bootstrap for a 
particular version based on an env var.


As for anything in dev-ada/* well, the ada guy would need to work on 
that really, I'm not really experienced enough to handle it properly.


Given GCC is masked up to :10 now, the gnat gpr tools / libs might be 
easier to get going with single versions covering numerous toolchain 
versions.


Alire would need to be added at some point, http://alire.ada.dev/ to 
provide an easier way to get packages going.


I originally envisioned gnatmake, gprbuild eclasses to cover building 
simple projects with one entry point (gnatmake) and projects (gprbuild). 
I think an alire based eclass would need to be added as well.


Thanks,
Luke.diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 60769c93877f..7368894abd2f 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -250,7 +250,6 @@ if [[ ${PN} != kgcc64 && ${PN} != gcc-* ]] ; then
 	IUSE+=" go"
 	IUSE+=" +sanitize"  TC_FEATURES+=( sanitize )
 	IUSE+=" graphite" TC_FEATURES+=( graphite )
-	IUSE+=" ada"
 	IUSE+=" vtv"
 	IUSE+=" jit"
 	tc_version_is_between 5.0 9 && IUSE+=" mpx"
@@ -259,6 +258,7 @@ if [[ ${PN} != kgcc64 && ${PN} != gcc-* ]] ; then
 	IUSE+=" systemtap" TC_FEATURES+=( systemtap )
 
 	tc_version_is_at_least 9.0 && IUSE+=" d" TC_FEATURES+=( d )
+	tc_version_is_at_least 9.0 && IUSE+=" ada" TC_FEATURES+=( ada )
 	tc_version_is_at_least 9.1 && IUSE+=" lto"
 	tc_version_is_at_least 10 && IUSE+=" cet"
 	tc_version_is_at_least 10 && IUSE+=" zstd" TC_FEATURES+=( zstd )
@@ -284,8 +284,7 @@ fi
 
 #>> DEPEND <<
 
-RDEPEND="
-	sys-libs/zlib
+RDEPEND="sys-libs/zlib
 	virtual/libiconv
 	nls? ( virtual/libintl )
 "
@@ -311,6 +310,20 @@ BDEPEND="
 		>=sys-devel/autogen-5.5.4
 	)
 "
+
+# Ada in 9.0+ is self-hosting and needs Ada to bootstrap.
+# Taken from the D version below. I'm fairly sure if this is now correct,
+# We should build using either ada-bootstrap: if the installed gcc has
+# Ada disabled or the installed slot which matches the slot being built.
+if tc_has_feature ada ; then
+	if tc_version_is_at_least 9.0 ; then
+		BDEPEND+=" ada? ( || (
+			> Ada Bootstrap slot is ${GCCMAJOR}/${PREVSLOT}"
+
+		# Make sure we set a path to the Ada bootstrap if gcc[ada] is not already
+		# installed. GNAT can usually be built using the last major version and
+		# the current version, at least.
+		if has_version -b "sys-devel/gcc:${SLOT}[ada]" ; then
+			einfo "Using GNAT compiler installed in slot ${SLOT}..."
+
+			PATH="${BINPATH}:${PATH}"
+		elif has_version -b "sys-devel/gcc:${PREVSLOT}[ada]" ; then
+			einfo "Using GNAT compiler installed in previous slot ${PREVSLOT}..."
+
+			PATH="${PREFIX}/${CTARGET}/gcc-bin/${PREVSLOT}:${PATH}"
+		else
+			einfo "Using bootstrap GNAT compiler..."
+
+			PATH="/opt/ada-bootstrap-${GCCMAJOR}/bin:${PATH}"
+
+			export PATH
+		fi
+	fi
+
 	confgcc+=(
 		--prefix="${PREFIX}"
 		--bindir="${BINPATH}"
@@ -1335,6 +1368,8 @@ toolchain_src_configure() {
 	einfo "DATAPATH:${DATAPATH}"
 	einfo "STDCXX_INCDIR:   ${STDCXX_INCDIR}"
 	einfo "Languages:   ${GCC_LANG}"
+	einfo "GCC version: $(gcc -v 2>&1|grep " version " | awk '{ print $3 }')"
+	is_ada && einfo "GNAT version:$(gnat 2>&1|grep GNAT | awk '{ print $2 }')"
 	echo
 
 	# Build in a separate build tree


Re: [gentoo-dev] [RFC] Un-slotting LLVM

2021-11-08 Thread Luke A. Guest
This would stop other projects from working where they have their own 
llvm port, cough rocm cough.


On 08/11/2021 11:18, Michał Górny wrote:

Hi,

A few years back I've slotted LLVM and Clang to make the life with
revdeps easier.  Long story short, every major LLVM release (which
happens twice a year) breaks API and it takes some time for revdeps to
adjust.  Slotting made it possible to install multiple versions
simultaneously, and therefore let "faster" packages use newer LLVM
without being blocked by "slower" packages on the user's system.

Unfortunately, this ended up pretty bothersome to maintain.  Besides
making ebuilds quite complex (and prone to mistakes), I'm hearing more
and more reports of programs being broken through getting multiple LLVM
versions in the link chain.

This is not something that can be easily solved.  In other words, it's
a mess and I don't think we're really getting anywhere.  For this
reason, I'm considering dropping slotting and going back to permitting
only a single version of LLVM and Clang being installed.

This would have two major implications:

1. If you installed any package that requires older LLVM, it'd block all
other packages from updating.  If you hit two packages that do not have
a common supported LLVM version, you won't be able to install them
at all.

On the plus side, this will motivate developers to actually start fixing
these packages rather than letting them rot until I start removing old
LLVM versions.

2. We will no longer support having multiple clang versions installed.
While it was convenient for testing stuff, it's not really a killer
feature though.

The only real alternative I see is actively limiting supported LLVM
versions in packages to ensure that all libraries in the depgraph end up
using the same LLVM version.  However, I don't think it's really worth
the effort.

I don't have a ready unslotting plan yet.

WDYT?





[gentoo-dev] OSL 1.11.8.0 ebuild

2020-10-09 Thread Luke A. Guest

Hi,

I copied and updated the osl ebuild. There's a bit of a hack in there to 
find the LLVM_ROOT. But it builds.


# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
inherit cmake llvm toolchain-funcs

# check this on updates
LLVM_MAX_SLOT=9

DESCRIPTION="Advanced shading language for production GI renderers"
HOMEPAGE="http://opensource.imageworks.com/?p=osl;
SRC_URI="https://github.com/imageworks/OpenShadingLanguage/archive/Release-${PV}.tar.gz
 -> ${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 ~x86"

X86_CPU_FEATURES=(
sse2:sse2 sse3:sse3 ssse3:ssse3 sse4_1:sse4.1 sse4_2:sse4.2
avx:avx avx2:avx2 avx512f:avx512f f16c:f16c
)
CPU_FEATURES=( ${X86_CPU_FEATURES[@]/#/cpu_flags_x86_} )

IUSE="doc partio qt5 test ${CPU_FEATURES[@]%:*}"

RDEPEND="
dev-libs/boost:=
dev-libs/pugixml
media-libs/openexr:=
media-libs/openimageio:=


Re: [gentoo-dev] OSL 1.11.8.0 ebuild

2020-10-09 Thread Luke A. Guest

https://bugs.gentoo.org/747475

On 09/10/2020 19:36, Sam James wrote:

Hi,

Can you submit this on Bugzilla and/or via a GitHub pullrequest?

Thanks!


On 9 Oct 2020, at 19:31, Luke A. Guest  wrote:

Hi,

I copied and updated the osl ebuild. There's a bit of a hack in there to find 
the LLVM_ROOT. But it builds.








Re: [gentoo-dev] [PATCH] enable build of gnat compiler in the toolchain eclass

2020-04-05 Thread Luke A. Guest
No it doesn't. Where's the bootstrap toolchain you need to build?

On 03/04/2020 07:48, Sergei Trofimovich wrote:
> On Fri,  3 Apr 2020 08:25:35 +0200
> Tupone Alfredo  wrote:
> 
>> ---
>>  eclass/toolchain.eclass | 25 ++---
>>  1 file changed, 22 insertions(+), 3 deletions(-)
> 
> Looks good!
> 



[gentoo-dev] Re: Integrating Ada into toolchain.eclass, again

2017-05-22 Thread Luke A. Guest
Although, I didn't go too far into detail looking through your patches,
I will do later.




[gentoo-dev] Re: Integrating Ada into toolchain.eclass, again

2017-05-22 Thread Luke A. Guest
On 22/05/17 11:48, Michael Haubenwallner wrote:

> Hi Luke,
>
> On 05/19/2017 09:08 PM, Luke A. Guest wrote:
>> Hi,
>>
>> I posted a bug back in August,
>> https://bugs.gentoo.org/show_bug.cgi?id=592060, to discuss adding Ada
>> support into Gentoo's toolchain.eclass.
>> Thoughts?
> Did you have a look at https://bugs.gentoo.org/show_bug.cgi?id=592060 ?

I posted that bug.

> I had been almost there, but then I stopped because George seemed to return
> (turned out as retirement), and my only need for Ada is to bootstrap gcc-trunk
> sometimes (not since then). Beyond that: I'm lacking basic Ada knowledge to
> correctly finalize the missing bits, but I'm wondering why my patch still is
> larger than yours.
>
> HTH,
> /haubi/
>
Mine automatically checks for an installed gnatbind, if that exists,
there is a gnat installed already. Otherwise it sets up a few variables
to override the toolchain.eclass to use the gnatboot.

Yours has a large gnatboot function. Mine is all inline with small
additions where required.

You have added some cross compile support, which is unnecessary as once
a toolchain with USE=ada is installed, crossdev just works.

Luke.



[gentoo-dev] Integrating Ada into toolchain.eclass, again

2017-05-19 Thread Luke A. Guest
Hi,

I posted a bug back in August,
https://bugs.gentoo.org/show_bug.cgi?id=592060, to discuss adding Ada
support into Gentoo's toolchain.eclass. The reasons for this are twofold:

1) GNAT is supplied with the source of GCC and should be available in
Gentoo's sys-devel/gcc with USE=ada
2) Automatically gain cross compilers with sys-devel/crossdev, also has
been tested with my patch.

I saw a few new dev-ada packages being added to the tree yesterday. I
don't check this ml often, but just checking and seeing the various
discussions on Ada. I wonder why my bug has been ignored, surely the bug
tracker should've been checked first by Alfredo? He basically wanted
this as well.

** Current problems **

The above link provides other links and discussion including an error
I'm getting compiling GCC 6.x within emerge only. There are new
bootstraps for amd64 (so far) also.

** GNAT GPL **

I think that if anyone wants GNAT GPL versions, they should be installed
in /opt and bought into a person's environment manually by the people
using these compilers. I only really consider this compiler useful as a
means for testing source that fails with bug boxes using the FSF GCC due
to the fact that software built with GNAT GPL is automatically GPL v3.

** Roadmap **

I would suggest the following, but is fluid as it starts off really
messy due to cyclic dependencies:

* Add my patch to the toolchain.eclass to get at least part of the
problem sorted out, a start.
* Build bootstraps for the other platforms and at various compiler
versions, this is simple enough to do.
* Purge all current Ada/GNAT stuff from the portage tree as it's really
old and tbh, a mess.
* Start discussing the problem of a Gentoo Ada policy, this is mentioned
by Steve Arnold in the above link, he has started on an eclass for gnatmake.
* For 4.9.x and early 5.x compilers, add gnatutils, this is removed in
later versions of the tools as apparently it's not required anymore.
* gprbuild needs to be bootstrapped by makefile where it builds it's own
gnatutils and xmlada
* eselect plugin for applications built with GNAT, they will need to be
slotted where they use shared libs which were also Ada sources.
* gpr.eclass  so other ebuilds can use the various gpr tools for building.
* gnatcoll, xmlada, asis ebuilds added to dev-ada
* gprbuild really needs to be rebuilt using the installed tools and libs.
* other libs.
* gps ebuild.
* Extend USE=ada to other Gentoo targets, more gnatboot strap compilers.

** Bootstraps **

Steve has bootstraps built for amd64, x86, arm for gcc-4.9, I have added
5.4 and 6.3 for amd64 in
https://www.dropbox.com/sh/stljjvpj9201n8t/AAAzVG67ppskZ9UKiWTWz9Q_a?dl=0,
I've not looked into a canadian cross with Gentoo yet, it's on the todo
list I suppose.

Thoughts?

Thanks,
Luke.



Re: [gentoo-dev] Re: Empty project: ADA

2016-08-24 Thread Luke A. Guest
I've sent a patch to this list which adds Ada support. I believe the Ada
stuff already in Gentoo should be removed and we can start again, fresh.
If we can get this patch in, then use the ada-overlay, then ebuilds can
start to be migrated from there to the main repo, it'll be much cleaner
than what it is now, which is a total hackfest.


On 24/08/16 07:29, Michael Haubenwallner wrote:
> On 08/22/2016 05:58 PM, Pacho Ramos wrote:
>> Now https://wiki.gentoo.org/wiki/Project:Ada is empty
> While not using any Ada thing myself, occasionally I'm in need to fully
> bootstrap upstream gcc, which requires C,C++,Ada compilers these days.
>
> There's some basically accepted patches in [1] already: I've expected George
> to be back and catch up here eventually - but stranded. I may not update and
> commit them before I need to hack upstream gcc-trunk again...
>
> [1] https://bugs.gentoo.org/547358
>
> /haubi/
>
>




[gentoo-dev] Add Ada to toolchain.eclass v2

2016-08-23 Thread Luke A. Guest
Hi,

I've added more error handling and set the minimum for Ada builds to the
minimum in the eclass, GCC-3.4.0.

This adds Ada support to GCC, it builds for x86 and amd64 using a
bootstrap if there hasn't been a bootstrapped build already.

Thanks,
Luke.

--- /usr/portage/eclass/toolchain.eclass	2016-06-21 18:20:38.0 +0100
+++ src/gentoo-overlays/ada/eclass/toolchain.eclass	2016-08-22 17:35:01.270437144 +0100
@@ -141,7 +141,7 @@
 	[[ -n ${HTB_VER} ]] && IUSE+=" boundschecking"
 	[[ -n ${D_VER}   ]] && IUSE+=" d"
 	[[ -n ${SPECS_VER} ]] && IUSE+=" nossp"
-	tc_version_is_at_least 3 && IUSE+=" doc gcj awt hardened multilib objc"
+	tc_version_is_at_least 3 && IUSE+=" ada doc gcj awt hardened multilib objc"
 	tc_version_is_at_least 4.0 && IUSE+=" objc-gc"
 	tc_version_is_between 4.0 4.9 && IUSE+=" mudflap"
 	tc_version_is_at_least 4.1 && IUSE+=" libssp objc++"
@@ -161,6 +161,14 @@
 
 SLOT="${GCC_CONFIG_VER}"
 
+# When using Ada, use this bootstrap compiler to build, only when there is no pre-existing Ada compiler.
+if [[ ! -f `which gnatbind 2>&1|tee /dev/null` ]]; then
+	# First time build, so need to bootstrap this.
+	# A newer version of GNAT should build an older version, just not vice-versa. 4.9 can definitely build 5.1.0.
+	tc_version_is_at_least 3 && GNAT_BOOTSTRAP_VERSION="4.9"
+	GNAT_STRAP_DIR="${WORKDIR}/gnat_strap"
+fi
+
 #>> DEPEND <<
 
 RDEPEND="sys-libs/zlib
@@ -355,6 +363,11 @@
 		fi
 	fi
 
+	if in_iuse ada && [[ -n ${GNAT_STRAP_DIR} ]] ; then
+		GCC_SRC_URI+=" amd64? ( https://dev.gentoo.org/~nerdboy/files/gnatboot-${GNAT_BOOTSTRAP_VERSION}-amd64.tar.xz )
+	   x86?   ( https://dev.gentoo.org/~nerdboy/files/gnatboot-${GNAT_BOOTSTRAP_VERSION}-i686.tar.xz )"
+	fi
+
 	echo "${GCC_SRC_URI}"
 }
 
@@ -401,6 +414,26 @@
 	else
 		gcc_quick_unpack
 	fi
+
+	# Unpack the Ada bootstrap if we're using it.
+	if in_iuse ada && [[ -n ${GNAT_STRAP_DIR} ]] ; then
+		if [ ! -d ${GNAT_STRAP_DIR} ]; then
+			mkdir -p ${GNAT_STRAP_DIR} > /dev/null || die "Couldn't make GNAT bootstrap directory"
+		fi
+
+		pushd ${GNAT_STRAP_DIR} >&/dev/null || die
+
+		case $(tc-arch) in
+			amd64)
+unpack gnatboot-${GNAT_BOOTSTRAP_VERSION}-amd64.tar.xz || die "Failed to unpack GNAT bootstrap compiler"
+;;
+			x86)
+unpack gnatboot-${GNAT_BOOTSTRAP_VERSION}-i686.tar.xz || die "Failed to unpack GNAT bootstrap compiler"
+;;
+		esac
+
+		popd >&/dev/null || die
+	fi
 }
 
 gcc_quick_unpack() {
@@ -805,6 +838,29 @@
 	fi
 	[[ -n ${CBUILD} ]] && confgcc+=( --build=${CBUILD} )
 
+	# Add variables we need to make the build find the bootstrap compiler.
+	# We only want to use the bootstrap compiler for stage 1 of bootstrap, this will build the necessary compilers,
+	# then stage 2 uses these compilers.
+	#
+	# We only want to use the bootstrap when we don't have an already installed GNAT compiler.
+	if in_iuse ada && [[ -n ${GNAT_STRAP_DIR} ]] ; then
+		# We need to tell the system about our cross compiler!
+		export GNATBOOT=${GNAT_STRAP_DIR}/usr
+		export PATH="${GNATBOOT}/bin:${PATH}"
+
+		EXTRA_ECONF+=(
+			CC=${GNATBOOT}/bin/gnatgcc
+			CXX=${GNATBOOT}/bin/gnatg++
+			AR=${GNATBOOT}/bin/ar
+			AS=${GNATBOOT}/bin/as
+			LD=${GNATBOOT}/bin/ld
+			NM=${GNATBOOT}/bin/nm
+			RANLIB=${GNATBOOT}/bin/ranlib
+		)
+
+		einfo "EXTRA_ECONF=\"${EXTRA_ECONF}\""
+	fi
+
 	confgcc+=(
 		--prefix="${PREFIX}"
 		--bindir="${BINPATH}"
@@ -851,8 +907,8 @@
 	is_f77 && GCC_LANG+=",f77"
 	is_f95 && GCC_LANG+=",f95"
 
-	# We do NOT want 'ADA support' in here!
-	# is_ada && GCC_LANG+=",ada"
+	# We DO want 'Ada support' in here!
+	is_ada && GCC_LANG+=",ada"
 
 	confgcc+=( --enable-languages=${GCC_LANG} )
 
@@ -1669,7 +1725,12 @@
 	cd "${D}"${BINPATH}
 	# Ugh: we really need to auto-detect this list.
 	#  It's constantly out of date.
-	for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo ; do
+
+	if in_iuse ada ; then
+		GNAT_EXTRA_BINS="gnat gnatbind gnatchop gnatclean gnatfind gnatkr gnatlink gnatls gnatmake gnatname gnatprep gnatxref"
+	fi
+
+	for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo ${GNAT_EXTRA_BINS} ; do
 		# For some reason, g77 gets made instead of ${CTARGET}-g77...
 		# this should take care of that
 		if [[ -f ${x} ]] ; then


[gentoo-dev] Adding Ada support to toolchain.eclass

2016-07-10 Thread Luke A. Guest
Hi,

I've managed to add Ada to the toolchain.eclass, I've built in a chroot
for x86 and amd64, building 4.9.3 using the bootstrap that Steve Arnold
put together. I also then built a 5.1.0 build using the installed 4.9.3
toolchain. I then installed mingw crossdev toolchain with ada support.

It's based on my overlay to add this to gentoo,
https://github.com/Lucretia/ada-overlay.

I've included a patch to the latest eclass.

Thanks,
Luke.

--- /usr/portage/eclass/toolchain.eclass	2016-06-21 18:20:38.0 +0100
+++ eclass/toolchain.eclass	2016-07-10 18:18:14.849734912 +0100
@@ -152,7 +152,7 @@
 	# versions which we dropped.  Since graphite was also experimental in
 	# the older versions, we don't want to bother supporting it.  #448024
 	tc_version_is_at_least 4.8 && IUSE+=" graphite" IUSE_DEF+=( sanitize )
-	tc_version_is_at_least 4.9 && IUSE+=" cilk +vtv"
+	tc_version_is_at_least 4.9 && IUSE+=" cilk +vtv ada"
 	tc_version_is_at_least 5.0 && IUSE+=" jit mpx"
 	tc_version_is_at_least 6.0 && IUSE+=" pie +ssp"
 fi
@@ -161,6 +161,14 @@
 
 SLOT="${GCC_CONFIG_VER}"
 
+# If using Ada, use this bootstrap compiler to build, only when there is not existing compiler.
+# Support nothing before 4.9.x series.
+if [[ ! -f `which gnatbind 2>&1|tee /dev/null` ]]; then
+	# First time build, so need to bootstrap this.
+	tc_version_is_at_least 4.9 && GNAT_BOOTSTRAP_VERSION="4.9"
+	GNAT_STRAP_DIR="${WORKDIR}/gnat_strap"
+fi
+
 #>> DEPEND <<
 
 RDEPEND="sys-libs/zlib
@@ -355,6 +363,11 @@
 		fi
 	fi
 
+	if in_iuse ada && [[ -n ${GNAT_STRAP_DIR} ]] ; then
+		GCC_SRC_URI+=" amd64? ( https://dev.gentoo.org/~nerdboy/files/gnatboot-${GNAT_BOOTSTRAP_VERSION}-amd64.tar.xz )
+	   x86?   ( https://dev.gentoo.org/~nerdboy/files/gnatboot-${GNAT_BOOTSTRAP_VERSION}-i686.tar.xz )"
+	fi
+
 	echo "${GCC_SRC_URI}"
 }
 
@@ -401,6 +414,26 @@
 	else
 		gcc_quick_unpack
 	fi
+
+	# Unpack the Ada bootstrap if we're using it.
+	if in_iuse ada && [[ -n ${GNAT_STRAP_DIR} ]] ; then
+		if [ ! -d ${GNAT_STRAP_DIR} ]; then
+			mkdir -p ${GNAT_STRAP_DIR} > /dev/null
+		fi
+
+		pushd ${GNAT_STRAP_DIR} > /dev/null
+
+		case $(tc-arch) in
+			amd64)
+unpack gnatboot-${GNAT_BOOTSTRAP_VERSION}-amd64.tar.xz
+;;
+			x86)
+unpack gnatboot-${GNAT_BOOTSTRAP_VERSION}-i686.tar.xz
+;;
+		esac
+
+		popd > /dev/null
+	fi
 }
 
 gcc_quick_unpack() {
@@ -805,6 +838,29 @@
 	fi
 	[[ -n ${CBUILD} ]] && confgcc+=( --build=${CBUILD} )
 
+	# Add variables we need to make the build find the bootstrap compiler.
+	# We only want to use the bootstrap compiler for stage 1 of bootstrap, this will build the necessary compilers,
+	# then stage 2 uses these compilers.
+	#
+	# We only want to use the bootstrap when we don't have an already installed GNAT compiler.
+	if in_iuse ada && [[ -n ${GNAT_STRAP_DIR} ]] ; then
+		# We need to tell the system about our cross compiler!
+		export GNATBOOT=${GNAT_STRAP_DIR}/usr
+		export PATH="${GNATBOOT}/bin:${PATH}"
+
+		EXTRA_ECONF+=(
+			CC=${GNATBOOT}/bin/gnatgcc
+			CXX=${GNATBOOT}/bin/gnatg++
+			AR=${GNATBOOT}/bin/ar
+			AS=${GNATBOOT}/bin/as
+			LD=${GNATBOOT}/bin/ld
+			NM=${GNATBOOT}/bin/nm
+			RANLIB=${GNATBOOT}/bin/ranlib
+		)
+
+		einfo "EXTRA_ECONF=\"${EXTRA_ECONF}\""
+	fi
+
 	confgcc+=(
 		--prefix="${PREFIX}"
 		--bindir="${BINPATH}"
@@ -851,8 +907,8 @@
 	is_f77 && GCC_LANG+=",f77"
 	is_f95 && GCC_LANG+=",f95"
 
-	# We do NOT want 'ADA support' in here!
-	# is_ada && GCC_LANG+=",ada"
+	# We DO want 'ADA support' in here!
+	is_ada && GCC_LANG+=",ada"
 
 	confgcc+=( --enable-languages=${GCC_LANG} )
 
@@ -1669,7 +1725,12 @@
 	cd "${D}"${BINPATH}
 	# Ugh: we really need to auto-detect this list.
 	#  It's constantly out of date.
-	for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo ; do
+
+	if in_iuse ada ; then
+		GNAT_EXTRA_BINS="gnat gnatbind gnatchop gnatclean gnatfind gnatkr gnatlink gnatls gnatmake gnatname gnatprep gnatxref"
+	fi
+
+	for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo ${GNAT_EXTRA_BINS} ; do
 		# For some reason, g77 gets made instead of ${CTARGET}-g77...
 		# this should take care of that
 		if [[ -f ${x} ]] ; then