public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Horodniceanu Andrei" <a.horodniceanu@proton.me>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/user/dlang:master commit in: dev-util/dscanner/files/, dev-util/dscanner/
Date: Fri,  3 May 2024 16:06:38 +0000 (UTC)	[thread overview]
Message-ID: <1714730627.a323fcc0ee344d95222c59fba35010056ea387f6.a.horodniceanu@gentoo> (raw)

commit:     a323fcc0ee344d95222c59fba35010056ea387f6
Author:     Andrei Horodniceanu <a.horodniceanu <AT> proton <DOT> me>
AuthorDate: Fri May  3 10:02:47 2024 +0000
Commit:     Horodniceanu Andrei <a.horodniceanu <AT> proton <DOT> me>
CommitDate: Fri May  3 10:03:47 2024 +0000
URL:        https://gitweb.gentoo.org/repo/user/dlang.git/commit/?id=a323fcc0

dev-util/dscanner: add 0.16.0_beta4

Additional changes:
- strip -march=native with gdc
- run integration tests
- respect LDFLAGS

Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114171
Signed-off-by: Andrei Horodniceanu <a.horodniceanu <AT> proton.me>

 dev-util/dscanner/Manifest                         |   1 +
 dev-util/dscanner/dscanner-0.16.0_beta4.ebuild     | 111 +++++++++++++++++++++
 .../dscanner/files/makefile-respect-ldflags.patch  |  22 ++++
 3 files changed, 134 insertions(+)

diff --git a/dev-util/dscanner/Manifest b/dev-util/dscanner/Manifest
index 323d067..c1cb9f1 100644
--- a/dev-util/dscanner/Manifest
+++ b/dev-util/dscanner/Manifest
@@ -1,6 +1,7 @@
 DIST DCD-1c60c5480f70db568279e4637a5033953c777406.tar.gz 199435 BLAKE2B d32410769e210d1eebf70c9007e4cf939df7e2104d5535f913c22a08503cd048b0b6a82563ee15fe47ce87e55fbbeef1d7e9893714d75f8ffd4beaeaf87ec5de SHA512 9f445134a97a58079e4805f3584bf9816e9c158db07c5409e63f2b5f371769b2fe66b2d66b1c4883279960d9d4fb020a6f20b83e4d32ad9c9c2d180940d7cb4e
 DIST containers-116a02872039efbd0289828cd5eeff6f60bdf539.tar.gz 55518 BLAKE2B 466c2452724b3d377ca2cec8793e27b8599e4388644ef7058de4e535d5f095f6e713e6aaf7e934f944b68726f9a96aed3f093100f993cfe4db1efd5dbd9e6cd4 SHA512 e98ecc56b7dac12c347b591f65b33fc213a183e22c455e6bd2727d9797922069db70143240d935d72c38738fc43b579ede33c4a6d8e7ac0e5194001d3b0d773f
 DIST dscanner-0.15.2.tar.gz 103122 BLAKE2B cff0637596cf094a9811bd49721b9328fada3de04d29edb69045d01111482f7dbf8631f6db296054d23d2ad66ca94a4c1fe8d23e4bae5aa3dbb01269ef30c164 SHA512 92ba1be469de5cf1edfa4e6e53b6c4acd6a2e2ef6a451650d5a652ce161b47c88255a8539a9cf716212449e7f6c16aa4950fa1445b287040c83deb54c978dcaf
+DIST dscanner-0.16.0-beta.4.tar.gz 119703 BLAKE2B 3d51cdfb5e3e894a4e9e48432a836a11f33eac543aeb236804fcc07bd43919bd23b5d9f00d02e4638ec4c17d494f435ea94bd5f2a39bf6b96fcabe98a0645738 SHA512 fdb64b5edc320dfd51ba76fe7ce1b8fe148f2f58da7b5c15511071186a5421c86be1e9eb18224c26c92fa082d2cecb6199c5952f9a54cf8b15fdc4d8c28140f5
 DIST inifiled-cecaff8037a60db2a51c9bded4802c87d938a44e.tar.gz 8251 BLAKE2B fa0bb78c11f69e257a0974c16188475d50fcf2a56138fc288d6262be91604b8e706bfab2572b2d0e358c8366b400a2c5a3af6ba87d5243825ddf26a5a03fbfe2 SHA512 9a3c66eca2b48350c798fd0a54d37c8714d6a499e8412983f1bda2f00cda6fe1439bfbc6766d32529f3d7cc708a0528c52c077f9169727b492616691833c52d0
 DIST libddoc-fbbfb8245728484e5f96d717994d4b404a9789a4.tar.gz 21113 BLAKE2B 419de2c211c609e81e9c65e85ac7ea22beb9490ae953ec8ffa996d538c4777732c21b1dc9bceb0551d5b83da94b493dd3c6b8ad9093fe839e5007dce63dbc036 SHA512 ccf6566da9d668ecb651bd26c17077669e4d9cba4832a424f57f271ef80b8b779c78e3c03b8736f3766d6653a6415ba65bc7de687648e370865127db2571655e
 DIST libdparse-fe6d1e38fb4fc04323170389cfec67ed7fd4e24a.tar.gz 158963 BLAKE2B 4fc7b52921d0c163051b4115076a1473fd7138244bad8052e79298beaccb1ed3c737bbf0ae754f2596133d32cede71704e4ac43c486d69a4390e5654c1993bfa SHA512 cb36b7bfc7d33c0c2c9be25bf4bea1abdbad7c7c9860bbbe725be7d5859255f937fb3b4a2241b47eb4131dd1879819e47704eaadeeb660d5b245008f594107cf

diff --git a/dev-util/dscanner/dscanner-0.16.0_beta4.ebuild b/dev-util/dscanner/dscanner-0.16.0_beta4.ebuild
new file mode 100644
index 0000000..a0fbb7e
--- /dev/null
+++ b/dev-util/dscanner/dscanner-0.16.0_beta4.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Swiss-army knife for D source code"
+HOMEPAGE="https://github.com/dlang-community/D-Scanner"
+
+MY_PV=$(ver_rs 3 - 4 .) # For beta releases 0.16.0_beta4 -> 0.16.0-beta.4
+DCD="1c60c5480f70db568279e4637a5033953c777406"
+CONTAINERS="116a02872039efbd0289828cd5eeff6f60bdf539"
+INIFILED="cecaff8037a60db2a51c9bded4802c87d938a44e"
+LIBDDOC="fbbfb8245728484e5f96d717994d4b404a9789a4"
+LIBDPARSE="fe6d1e38fb4fc04323170389cfec67ed7fd4e24a"
+GITHUB_URI="https://codeload.github.com"
+SRC_URI="
+	${GITHUB_URI}/dlang-community/${PN}/tar.gz/v${MY_PV} -> ${PN}-${MY_PV}.tar.gz
+	${GITHUB_URI}/dlang-community/containers/tar.gz/${CONTAINERS} -> containers-${CONTAINERS}.tar.gz
+	${GITHUB_URI}/dlang-community/DCD/tar.gz/${DCD} -> DCD-${DCD}.tar.gz
+	${GITHUB_URI}/burner/inifiled/tar.gz/${INIFILED} -> inifiled-${INIFILED}.tar.gz
+	${GITHUB_URI}/dlang-community/libddoc/tar.gz/${LIBDDOC} -> libddoc-${LIBDDOC}.tar.gz
+	${GITHUB_URI}/dlang-community/libdparse/tar.gz/${LIBDPARSE} -> libdparse-${LIBDPARSE}.tar.gz
+	"
+S="${WORKDIR}/D-Scanner-${MY_PV}"
+LICENSE="Boost-1.0"
+
+PATCHES=(
+	"${FILESDIR}/0.15.2-makefile-fixes.patch"
+	"${FILESDIR}/makefile-respect-ldflags.patch"
+)
+
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="debug test"
+RESTRICT="!test? ( test )"
+
+DLANG_COMPAT=( dmd-2_{106..108} gdc-13 ldc2-1_{35..37} )
+
+inherit dlang-single
+
+REQUIRED_USE=${DLANG_REQUIRED_USE}
+DEPEND=${DLANG_DEPS}
+BDEPEND="
+	${DLANG_DEPS}
+	test? ( app-misc/jq )
+"
+RDEPEND=${DLANG_DEPS}
+
+src_prepare() {
+	move_git_submodules
+
+	mkdir "${S}"/bin || die "Failed to create 'bin' directory."
+	# Stop the makefile from executing git
+	echo "v${PV}" > "${S}"/bin/githash.txt || die "Could not generate githash"
+
+	# Apply patches
+	default
+}
+
+src_compile() {
+	if [[ ${EDC} == gdc* && ${DCFLAGS} == *-march=native* ]]; then
+		# At this point I wonder if we should have been stripping it in the eclass.
+		# Fixed for >=sys-devel/gcc-13.2.1_p20240330
+		ewarn '-march=native has been removed from your flags.'
+		ewarn 'See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114171'
+		dlang-filter-dflags "gdc*" "-march=native"
+	fi
+
+	if use debug; then
+		# Add a -debug compiler specific flag and enable the dparse_verbose version,
+		# like the debug target in the makefile except that it doesn't build everything in 1 go.
+		DCFLAGS+=" $(dlang_get_version_flag)=dparse_verbose $(dlang_get_debug_flag)"
+	fi
+
+	emake DFLAGS="${DCFLAGS}"
+}
+
+src_test() {
+	# We can specify user flags in (DMD|LDC|GDC)_TEST_FLAGS
+	local flagName=${EDC::3}
+	flagName="${flagName^^}_TEST_FLAGS"
+
+	emake test "${flagName}=${DCFLAGS}"
+
+	# Set CI to non-empty to prevent rebuilding with dub
+	CI="gentoo" ./tests/it.sh || die "Integration tests failed"
+}
+
+src_install() {
+	dobin bin/dscanner
+	dodoc README.md LICENSE_1_0.txt
+}
+
+move_git_submodules() {
+	# Move all submodule dependencies into the appropriate folders.
+	# They have to be moved from ${WORKDIR}/${name}-${hash} to ${S}/${name}
+	local submodule submodules=(
+		"DCD" "containers" "inifiled" "libddoc" "libdparse"
+	)
+	for submodule in "${submodules[@]}"; do
+		# make the name uppercase: inifiled -> INIFILED
+		local submodule_hash_var="${submodule^^}"
+		# and extract the hash
+		local submodule_hash="${!submodule_hash_var}"
+
+		local submodule_directory="${WORKDIR}/${submodule}-${submodule_hash}"
+
+		mv -T "${submodule_directory}" "${S}/${submodule}" \
+		   || die "Could not move submodule '${submodule}' to its subdirectory"
+	done
+}

diff --git a/dev-util/dscanner/files/makefile-respect-ldflags.patch b/dev-util/dscanner/files/makefile-respect-ldflags.patch
new file mode 100644
index 0000000..f0660e1
--- /dev/null
+++ b/dev-util/dscanner/files/makefile-respect-ldflags.patch
@@ -0,0 +1,22 @@
+diff --git a/makefile b/makefile
+index 7b1def6..1213435 100644
+--- a/makefile
++++ b/makefile
+@@ -98,7 +98,7 @@ $(UT_OBJ_DIR)/$(DC)/%.o: %.d
+ 	${DC} ${DC_TEST_FLAGS} ${VERSIONS} ${INCLUDE_PATHS} -c $< ${WRITE_TO_TARGET_NAME}
+ 
+ ${DSCANNER_BIN}: ${GITHASH} ${OBJ_BY_DC} | ${DSCANNER_BIN_DIR}
+-	${DC} ${OBJ_BY_DC} ${WRITE_TO_TARGET_NAME}
++	${DC} ${DLANG_LDFLAGS} ${OBJ_BY_DC} ${WRITE_TO_TARGET_NAME}
+ 
+ ${OBJ_BY_DC}: | ${OBJ_BY_DC_DIR}
+ 
+@@ -135,7 +135,7 @@ ${UT_DSCANNER_LIB}: ${LIB_SRC} | ${UT_DSCANNER_LIB_DIR}
+ test: ${UT_DSCANNER_BIN}
+ 
+ ${UT_DSCANNER_BIN}: ${UT_DSCANNER_LIB} ${GITHASH} ${UT_OBJ_BY_DC} | ${DSCANNER_BIN_DIR}
+-	${DC} ${UT_DSCANNER_LIB} ${UT_OBJ_BY_DC} ${WRITE_TO_TARGET_NAME}
++	${DC} ${DLANG_LDFLAGS} ${UT_DSCANNER_LIB} ${UT_OBJ_BY_DC} ${WRITE_TO_TARGET_NAME}
+ 	./${UT_DSCANNER_BIN}
+ 
+ lint: ${DSCANNER_BIN}


             reply	other threads:[~2024-05-03 16:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03 16:06 Horodniceanu Andrei [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-02-01  0:18 [gentoo-commits] repo/user/dlang:master commit in: dev-util/dscanner/files/, dev-util/dscanner/ Horodniceanu Andrei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1714730627.a323fcc0ee344d95222c59fba35010056ea387f6.a.horodniceanu@gentoo \
    --to=a.horodniceanu@proton.me \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox