public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/user/dlang:master commit in: dev-lang/dmd/, eclass/
@ 2024-02-18 22:49 Horodniceanu Andrei
  0 siblings, 0 replies; 2+ messages in thread
From: Horodniceanu Andrei @ 2024-02-18 22:49 UTC (permalink / raw
  To: gentoo-commits

commit:     cf32349509b9449d15e125ff7512f8be6445541a
Author:     Horodniceanu Andrei <a.horodniceanu <AT> proton <DOT> me>
AuthorDate: Wed Jan  3 15:15:30 2024 +0000
Commit:     Horodniceanu Andrei <a.horodniceanu <AT> proton <DOT> me>
CommitDate: Sun Feb  4 11:53:28 2024 +0000
URL:        https://gitweb.gentoo.org/repo/user/dlang.git/commit/?id=cf323495

dmd.eclass: drop tools USE flag

The tools USE flag is only used to pull in dlang-tools as a
dependency. As dev-lang/dmd doesn't actually require dlang-tools being
present to function, the dependency, along with the USE flag have been
dropped.

Signed-off-by: Horodniceanu Andrei <a.horodniceanu <AT> proton.me>

 dev-lang/dmd/metadata.xml | 1 -
 eclass/dmd.eclass         | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/dev-lang/dmd/metadata.xml b/dev-lang/dmd/metadata.xml
index d9304f2..2d7f349 100644
--- a/dev-lang/dmd/metadata.xml
+++ b/dev-lang/dmd/metadata.xml
@@ -3,6 +3,5 @@
 <pkgmetadata>
   <use>
     <flag name="selfhost">Bootstrap dmd using an upstream provided compiler binary</flag>
-    <flag name="tools">Pulls in dev-util/dlang-tools</flag>
   </use>
 </pkgmetadata>

diff --git a/eclass/dmd.eclass b/eclass/dmd.eclass
index 2292e12..d19bdd1 100644
--- a/eclass/dmd.eclass
+++ b/eclass/dmd.eclass
@@ -84,7 +84,7 @@ fi
 SONAME="${SONAME-libphobos2.so.0.${MINOR}.${PATCH}}"
 SONAME_SYM="${SONAME%.*}"
 
-IUSE="doc examples static-libs tools"
+IUSE="doc examples static-libs"
 
 # Self-hosting versions of DMD need a host compiler.
 if dmd_ge 2.068; then
@@ -120,7 +120,6 @@ RDEPEND="
 	${COMMON_DEPEND}
 	!dev-lang/dmd-bin
 	"
-PDEPEND="tools? ( >=dev-util/dlang-tools-${PV} )"
 
 S="${WORKDIR}/dmd2"
 PREFIX="usr/lib/${PN}/${SLOT}"


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/user/dlang:master commit in: dev-lang/dmd/, eclass/
@ 2024-11-08 14:56 Horodniceanu Andrei
  0 siblings, 0 replies; 2+ messages in thread
From: Horodniceanu Andrei @ 2024-11-08 14:56 UTC (permalink / raw
  To: gentoo-commits

commit:     ca9e5b8d21106fc8b120a634b2760c4c5af7311a
Author:     Andrei Horodniceanu <a.horodniceanu <AT> proton <DOT> me>
AuthorDate: Tue Nov  5 10:30:36 2024 +0000
Commit:     Horodniceanu Andrei <a.horodniceanu <AT> proton <DOT> me>
CommitDate: Fri Nov  8 14:49:16 2024 +0000
URL:        https://gitweb.gentoo.org/repo/user/dlang.git/commit/?id=ca9e5b8d

dev-lang/dmd: add 9999

Closes: https://github.com/gentoo/dlang/issues/132
Signed-off-by: Andrei Horodniceanu <a.horodniceanu <AT> proton.me>

 dev-lang/dmd/dmd-9999.ebuild | 20 ++++++++++
 eclass/dmd-r1.eclass         | 90 ++++++++++++++++++++++++++++++++------------
 2 files changed, 86 insertions(+), 24 deletions(-)

diff --git a/dev-lang/dmd/dmd-9999.ebuild b/dev-lang/dmd/dmd-9999.ebuild
new file mode 100644
index 0000000..1105fc8
--- /dev/null
+++ b/dev-lang/dmd/dmd-9999.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+if [[ ${PV} != *9999* ]]; then
+	KEYWORDS="-* ~amd64 ~x86"
+else
+	BOOTSTRAP_VERSION=2.109.1
+fi
+DLANG_COMPAT=( dmd-2_{106..109} gdc-1{3,4} ldc2-1_{35..39} )
+
+inherit dmd-r1
+
+# Support the 9999 directory name in /usr/lib/dmd instead of 2.XXX
+[[ ${PV} == *9999* ]] && IDEPEND=">=app-eselect/eselect-dlang-20241105"
+
+PATCHES=(
+	"${FILESDIR}/2.107-dmd-r1-link-32-bit-shared-lib-with-ld.bfd.patch"
+)

diff --git a/eclass/dmd-r1.eclass b/eclass/dmd-r1.eclass
index ad53677..876b883 100644
--- a/eclass/dmd-r1.eclass
+++ b/eclass/dmd-r1.eclass
@@ -65,21 +65,45 @@ SLOT=$(ver_cut 1-2)
 readonly MAJOR=$(ver_cut 1)
 readonly MINOR=$(ver_cut 2)
 readonly PATCH=$(ver_cut 3)
-readonly VERSION=$(ver_cut 1-3)
-readonly BETA=$(ver_cut 4-)
+: "${BOOTSTRAP_VERSION:=${PV}}"
 
 # For prereleases, 2.097.0_rc1 -> 2.097.0-rc.1
 MY_VER=$(ver_rs 3 - 4 .)
+MY_BOOTSTRAP_VER=$(ver_rs 3 - 4 . "${BOOTSTRAP_VERSION}")
 
-DLANG_ORG=https://downloads.dlang.org/${BETA:+pre-}releases/2.x/${VERSION}
-SRC_URI="
-	https://github.com/dlang/${PN}/archive/refs/tags/v${MY_VER}.tar.gz -> ${PN}-${MY_VER}.tar.gz
-	https://github.com/dlang/phobos/archive/refs/tags/v${MY_VER}.tar.gz -> phobos-${MY_VER}.tar.gz
-	selfhost? ( ${DLANG_ORG}/dmd.${MY_VER}.linux.tar.xz )
-	doc? ( ${DLANG_ORG}/dmd.${MY_VER}.linux.tar.xz )
-"
 
-IUSE="doc examples +selfhost static-libs"
+# @FUNCTION: _gen_dmd_tarball_uri
+# @USAGE: <version>
+# @INTERNAL
+# @DESCRIPTION:
+# Output a URI to the dmd upstream tarball identified by the given version.
+_gen_dmd_tarball_uri() {
+	local v=${1}
+	local isBeta=$(ver_cut 4- "${v}")
+	local directory=$(ver_cut 1-3 "${v}")
+	echo "https://downloads.dlang.org/${isBeta:+pre-}releases/2.x/${directory}/dmd.${v}.linux.tar.xz"
+}
+
+if [[ ${PV} != *9999* ]]; then
+	SRC_URI="
+		https://github.com/dlang/${PN}/archive/refs/tags/v${MY_VER}.tar.gz -> ${PN}-${MY_VER}.tar.gz
+		https://github.com/dlang/phobos/archive/refs/tags/v${MY_VER}.tar.gz -> phobos-${MY_VER}.tar.gz
+	"
+else
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/dlang/dmd"
+	PHOBOS_REPO_URI="https://github.com/dlang/phobos"
+	: "${EGIT_BRANCH:=master}"
+fi
+
+SRC_URI+=" selfhost? ( $(_gen_dmd_tarball_uri "${MY_BOOTSTRAP_VER}") )"
+IUSE="examples +selfhost static-libs"
+
+if [[ ${PV} != *9999* ]]; then
+	SRC_URI+=" doc? ( $(_gen_dmd_tarball_uri "${MY_VER}") )"
+	IUSE+=" doc"
+fi
+
 REQUIRED_USE="^^ ( selfhost ${DLANG_REQUIRED_USE} )"
 IDEPEND=">=app-eselect/eselect-dlang-20140709"
 BDEPEND="!selfhost? ( ${DLANG_DEPS} )"
@@ -126,11 +150,19 @@ dmd-r1_src_unpack() {
 
 	default
 
-	# $S may collide with $PN-$MY_VER
-	mv "${PN}-${MY_VER}" tmp || die
-	mkdir "${S}" || die
-	mv -T tmp "${S}/${PN}" || die
-	mv -T "phobos-${MY_VER}" "${S}/phobos" || die
+	if [[ ${PV} != *9999* ]]; then
+		# $S may collide with $PN-$MY_VER
+		mv "${PN}-${MY_VER}" tmp || die
+		mkdir "${S}" || die
+		mv -T tmp "${S}/${PN}" || die
+		mv -T "phobos-${MY_VER}" "${S}/phobos" || die
+	else
+		git-r3_fetch
+		git-r3_fetch "${PHOBOS_REPO_URI}" "refs/heads/${EGIT_BRANCH}"
+
+		git-r3_checkout "" "${S}/dmd"
+		git-r3_checkout "${PHOBOS_REPO_URI}" "${S}/phobos"
+	fi
 }
 
 dmd-r1_src_compile() {
@@ -248,8 +280,8 @@ dmd-r1_src_compile() {
 	# Now clean up some artifacts that would make the install phase
 	# harder (we rely on globbing and recursive calls a lot).
 
-	# The object file is useless
-	rm -f phobos/generated/linux/release/*/libphobos2.so.0.${MINOR}.o || die
+	# The object file is useless, to support 9999 we glob for it
+	rm -f phobos/generated/linux/release/*/libphobos2.so.*.o || die
 	# the zlib folder contains source code which is no longer
 	# needed. Don't touch etc/c/zlib.d however, that's important.
 	rm -rf phobos/etc/c/zlib || die
@@ -312,11 +344,14 @@ dmd-r1_src_install() {
 		dlang_dolib.so "${G}"/libphobos2.so*
 		use static-libs && dlang_dolib.a "${G}"/libphobos2.a
 
-		# The symlinks under $(get_libdir) are only for backwards
-		# compatibility purposes.
-		local filename=libphobos2.so.0.${MINOR}
-		dosym -r "/usr/$(dlang_get_libdir)/${filename}" "/usr/$(get_libdir)/${filename}"
-		dosym -r "/usr/$(dlang_get_libdir)/${filename}.${PATCH}" "/usr/$(get_libdir)/${filename}.${PATCH}"
+		# Avoid collisions of 9999 and other slots
+		if [[ ${PV} != *9999* ]]; then
+			# The symlinks under $(get_libdir) are only for backwards
+			# compatibility purposes.
+			local filename=libphobos2.so.0.${MINOR}
+			dosym -r "/usr/$(dlang_get_libdir)/${filename}" "/usr/$(get_libdir)/${filename}"
+			dosym -r "/usr/$(dlang_get_libdir)/${filename}.${PATCH}" "/usr/$(get_libdir)/${filename}.${PATCH}"
+		fi
 	}
 	_dmd_foreach_abi install_phobos_2
 	insinto "${dmd_prefix}"/import
@@ -336,7 +371,7 @@ dmd-r1_src_install() {
 		docompress -x "${dmd_prefix}"/samples
 	fi
 
-	if use doc; then
+	if _use_doc; then
 		HTML_DOCS=( "${WORKDIR}"/dmd2/html/* )
 		einstalldocs
 		insinto "/usr/share/doc/${PF}/html"
@@ -353,7 +388,7 @@ dmd-r1_pkg_postinst() {
 
 	use examples &&
 		elog "Examples can be found in: ${EPREFIX}/usr/lib/${PN}/${SLOT}/samples"
-	use doc && elog "HTML documentation is in: ${EPREFIX}/usr/share/doc/${PF}/html"
+	_use_doc && elog "HTML documentation is in: ${EPREFIX}/usr/share/doc/${PF}/html"
 
 	optfeature "additional D development tools" "dev-util/dlang-tools"
 }
@@ -362,6 +397,13 @@ dmd-r1_pkg_postrm() {
 	"${ERROT}"/usr/bin/eselect dlang update dmd
 }
 
+# @FUNCTION: _use_doc
+# @INTERNAL
+# @RETURN: shell true if the doc USE flag is enabled
+_use_doc() {
+	[[ ${PV} != *9999* ]] && use doc
+}
+
 # @FUNCTION: _gen_dmd.conf
 # @INTERNAL
 # @DESCRIPTION:


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-08 14:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-18 22:49 [gentoo-commits] repo/user/dlang:master commit in: dev-lang/dmd/, eclass/ Horodniceanu Andrei
  -- strict thread matches above, loose matches on Subject: below --
2024-11-08 14:56 Horodniceanu Andrei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox