commit:     7e00e790667362304facc1629123ed7a5d714d3c
Author:     Andrei Horodniceanu <a.horodniceanu <AT> proton <DOT> me>
AuthorDate: Sun Aug 24 16:55:27 2025 +0000
Commit:     Horodniceanu Andrei <a.horodniceanu <AT> proton <DOT> me>
CommitDate: Sun Aug 24 17:06:15 2025 +0000
URL:        https://gitweb.gentoo.org/repo/user/dlang.git/commit/?id=7e00e790

scripts: Add pkgcheck-scan.sh

This is a small wrapper around pkgcheck scan that only scans for errors
on this overlay's profiles.

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

 README.md                | 9 ++++++++-
 scripts/pkgcheck-scan.sh | 8 ++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 0bce9ef..369f225 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ This overlay aims to make parallel installation of Dlang 
compilers easy and offe
 * Shared library support when using DMD
 * Easily compile debug builds with DMD and release builds with LDC/GDC even 
when they depend on libraries like GtkD. (This depends on availability of 
libraries in this repository.)
 
-The overlay supports linker and compiler flags, though some package build 
scripts may not be patched to use them (e.g. DMD). For Dlang packages, the 
LDFLAGS variable is rewritten to match the Dlang compilers linker prefix. For 
DMD this is `-L` and for LDC this is `-L=`. If you have not set up LDFLAGS in 
make.conf, the Gentoo default will be used, which is currently `-Wl,--as-needed 
-Wl,-O1`. Taking this example, in a compilation using DMD this would be 
rewritten to `LDFLAGS=-L--as-needed -L-O1`. Compiler flags are passed into 
build scripts as `DCFLAGS`, but since there is no common command-line syntax 
between Dlang compilers they are split up into DMDFLAGS, GDCFLAGS and LDCFLAGS 
in `make.conf`. An example configuration could be: 
+The overlay supports linker and compiler flags, though some package build 
scripts may not be patched to use them (e.g. DMD). For Dlang packages, the 
LDFLAGS variable is rewritten to match the Dlang compilers linker prefix. For 
DMD this is `-L` and for LDC this is `-L=`. If you have not set up LDFLAGS in 
make.conf, the Gentoo default will be used, which is currently `-Wl,--as-needed 
-Wl,-O1`. Taking this example, in a compilation using DMD this would be 
rewritten to `LDFLAGS=-L--as-needed -L-O1`. Compiler flags are passed into 
build scripts as `DCFLAGS`, but since there is no common command-line syntax 
between Dlang compilers they are split up into DMDFLAGS, GDCFLAGS and LDCFLAGS 
in `make.conf`. An example configuration could be:
 ```sh
 DMDFLAGS="-O"
 GDCFLAGS="-march=native -O3 -pipe -frelease"
@@ -85,6 +85,13 @@ At first there is not much to be done, but once the first 
arch is stable, it sho
 ### When changing paths in compiler ebuilds
 Make sure that `dlang.eselect` knows about it. `eclass/dlang.eclass` also has 
a function that needs to be changed: `dlang_foreach_config()`. It advertizes 
compiler specific variables and paths to D ebuilds.
 
+### Using pkgcheck
+
+Like the standard [Gentoo git 
workflow](https://wiki.gentoo.org/wiki/Standard_git_workflow), this overlay 
uses [Pkgcheck](https://wiki.gentoo.org/wiki/Pkgcheck) to check for QA errors 
and warnings.
+Unfortunately, `pkgcheck` will not function as intended by default but the 
[scripts/pkgcheck-scan.sh](scripts/pkgcheck-scan.sh) wrapper will help you.
+It hides a lot of warnings and errors that aren't actually relevant to the 
overlay and it will show you diagnostics that actually concern your changes.
+If you're a first time contributor, using `pkgcheck` is strongly encouraged.
+
 ## Q & A
 * **Why does DMD have a circular dependency upon itself?**
 

diff --git a/scripts/pkgcheck-scan.sh b/scripts/pkgcheck-scan.sh
new file mode 100755
index 0000000..b429274
--- /dev/null
+++ b/scripts/pkgcheck-scan.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+
+scriptdir=$( cd -- "$(dirname "${0}")" ; pwd -P )
+repo=$(dirname "${scriptdir}")
+
+profiles=$(awk 'NF { printf $2 "," } END { print ""}' 
"${repo}/profiles/profiles.desc")
+
+exec pkgcheck scan -p "${profiles}" "${@}"

Reply via email to