Re: [cygport] enabling a replacement for "objdump -d -l"

2024-03-11 Thread ASSI via Cygwin-apps
Jon Turney via Cygwin-apps writes:
> Thanks, this is great!

You're welcome.

> Please, please make a patch with git format-patch, which I can then
> just apply.

You can always just pull it in from my repo… when it's ready.

> Fifty lines of perl with no comments! This is just line noise to me
> unless I spend lots of time staring at it :)

That's what you get from an experiment that went rather more well than
planned.

> Seriously, this should at least say "I'm running objdump -Wl to dump
> out the .debug_line section containing DWARF XYZ information.
>
> Then maybe some comments about what assumptions it's making about the
> human-readable output it's parsing.

So you're asking for a manpage, really.  Should be doable with enough
round tuits.

> cygport goes to some lengths to identify the correct objdump to use
> when cross-building, so it should probably should be used here (passed
> in as an arg?), rather than assuming it's /usr/bin/objdump.

Yes, either that or using whatever variable cygport sets up with the
correct objdump.

> What this line is doing is obvious, the rest of this block, not so much.

Nothing to see here, move along… :-P

> You might also like to touch on why we bother looking at the line
> number information at all, rather than just producing a (filtered)
> list of all the pathnames mentioned?

I was using this to figure out why the "objdump -d -l" was missing some
of the file names I was seeing (in general, again, it comes to the same
set of files in the end).

> If you're going to keep this (which you probably should), perhaps it
> should be under some 'if (DEBUG)' conditional.

Yeah, can do if I use GetOpt::Long, which I should probably do anyway
just in case this gets extended later on.

> DWARF_PARSE should be mentioned in the documentation for cygport.conf

Yes.

> Since the helper script will be installed, it could be made a boolean.

Out of habit grown over decades, I always keep an escape hatch for using
local (modified) copies in such scripts.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables


[ITP] mandoc 1.14.6-1

2024-03-11 Thread Christian Franke via Cygwin-apps
I would like to contribute mandoc. Also present in Debian, Fedora, 
Ubuntu, ... and as the default man page formatter on *BSD.


Useful to check man pages for compatibility with *BSD systems.

The build is reproducible without the need to export SOURCE_DATE_EPOCH.

SUMMARY="BSD mandoc compiler toolset"

DESCRIPTION="\
mandoc is a suite of tools compiling mdoc, the roff macro language of
choice for BSD manual pages, and man, the predominant historical language
for UNIX manuals.  It is small, self-contained, and quite fast.  The main
component of the toolset is the mandoc utility program, based on the
libmandoc validating compiler, to format output for UTF-8 and ASCII
terminals, HTML 5, PostScript, and PDF."

mandoc-1.14.6-1.tar.xz:
usr/bin/demandoc.exe
usr/bin/mandoc.exe
usr/bin/mapropos -> mandoc
usr/bin/mman -> mandoc
usr/bin/msoelim.exe
usr/bin/mwhatis -> mandoc
usr/sbin/mandocdb -> ../bin/mandoc
usr/share/doc/mandoc/*
usr/share/man/man1/demandoc.1.gz
usr/share/man/man1/mandoc.1.gz
usr/share/man/man1/mapropos.1.gz
usr/share/man/man1/mman.1.gz
usr/share/man/man1/msoelim.1.gz
usr/share/man/man1/mwhatis.1.gz
usr/share/man/man5/mandoc.conf.5.gz
usr/share/man/man5/mandoc.db.5.gz
usr/share/man/man7/mandoc_char.7.gz
usr/share/man/man7/mandoc_eqn.7.gz
usr/share/man/man7/mandoc_man.7.gz
usr/share/man/man7/mandoc_mdoc.7.gz
usr/share/man/man7/mandoc_roff.7.gz
usr/share/man/man7/mandoc_tbl.7.gz
usr/share/man/man8/mandocdb.8.gz

--
Regards,
Christian

# cygport script for mandoc
NAME=mandoc
VERSION=1.14.6
RELEASE=1
SOURCE_DATE="2024-03-11 18:00:00 UTC"

SUMMARY="BSD mandoc compiler toolset"

DESCRIPTION="\
mandoc is a suite of tools compiling mdoc, the roff macro language of
choice for BSD manual pages, and man, the predominant historical language
for UNIX manuals.  It is small, self-contained, and quite fast.  The main
component of the toolset is the mandoc utility program, based on the
libmandoc validating compiler, to format output for UTF-8 and ASCII
terminals, HTML 5, PostScript, and PDF."

LICENSE="ISC"
CATEGORY="Text"
REQUIRES="" # zlib0
BUILD_REQUIRES="binutils gcc-core perl_base" # make

HOMEPAGE="https://mandoc.bsd.lv/";
SRC_URI="https://mandoc.bsd.lv/snapshots/${P}.tar.gz";

SOURCE_DATE_EPOCH=$(date -d "${SOURCE_DATE}" +%s) # 'export' is not needed

src_compile() {
cd ${B}
lndirs

cat <<-EOF > configure.local
OSNAME="Cygwin"

PREFIX="/usr"
MANDIR="/usr/share/man"
MANPATH_BASE="/usr/share/man"
MANPATH_DEFAULT="/usr/share/man:/usr/local/share/man"

HAVE_WCHAR=1
CFLAGS="${CFLAGS}"
LDFLAGS="${LDFLAGS}"
LN="ln -sf"

BINM_APROPOS="mapropos" # "apropos"
BINM_MAKEWHATIS="mandocdb"  # "makewhatis"
BINM_MAN="mman" # "man"
BINM_SOELIM="msoelim"   # "soelim"
BINM_WHATIS="mwhatis"   # "whatis"
MANM_EQN="mandoc_eqn"   # "eqn"
MANM_MANCONF="mandoc.conf"  # "man.conf"
MANM_MAN="mandoc_man"   # "man"
MANM_MDOC="mandoc_mdoc" # "mdoc"
MANM_ROFF="mandoc_roff" # "roff"
MANM_TBL="mandoc_tbl"   # "tbl"
EOF

# No cygconf because ./configure is not generated
./configure

cygmake
}

src_test() {
cd ${B}/regress
./regress.pl . ascii tag man html markdown lint

# Unicode chars >= U+1 do not work
# U+1D6C1 (Mathematical Bold Nabla) is output as U+D6C1 (Hangul 
Syllable Hyot)
./regress.pl . utf8 ||
inform "The above failure of the 'nabla' testcase could be 
safely ignored"
}


[PATCH cygport] Add repro-finish command

2024-03-11 Thread Christian Franke via Cygwin-apps

Thanks for accepting the repro-check patch. A minor enhancement is attached.

The function is in pkg_pkg.cygpart instead of pkg_cleanup.cygpart 
because then it is easier to keep it in sync with the other __repro_* 
functions.


PS: I have a local script which checks SPDX Identifiers and expressions. 
Any interest to add this to cygport and then check LICENSE settings?


--
Regards,
Christian

From b08796262308cf1b3a2c063349d024a5ccfd2455 Mon Sep 17 00:00:00 2001
From: Christian Franke 
Date: Mon, 11 Mar 2024 12:12:32 +0100
Subject: [PATCH] Add repro-finish command

This command removes the temporary directory used by repro-check.
---
 README  |  7 ---
 bin/cygport.in  |  4 
 lib/help.cygpart|  1 +
 lib/pkg_pkg.cygpart | 24 +++-
 4 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/README b/README
index 3c9e4d4a..a0897a4f 100644
--- a/README
+++ b/README
@@ -163,9 +163,10 @@ Other COMMANDs are meant primarily for maintainers:
 diff - write a patch file capturing changes to source in the working 
directory
 stage- as upload, but don't request processing of uploaded packages
 announce - compose and send a package announcement
-repro-build - rebuild from created source package to temp directory
-repro-diff  - check whether packages from original and rebuild differ
-repro-check - run repro-build and repro-diff
+repro-build  - rebuild from created source package to temp directory
+repro-diff   - check whether packages from original and rebuild differ
+repro-check  - run repro-build and repro-diff
+repro-finish - delete the temp directory used for rebuild
 
 The standard arguments --help or --version may also be passed to cygport.
 
diff --git a/bin/cygport.in b/bin/cygport.in
index df38a8b5..15bd559e 100755
--- a/bin/cygport.in
+++ b/bin/cygport.in
@@ -801,6 +801,10 @@ do
__pkg_repro_diff
_status=$?
;;
+   repro-finish)
+   __pkg_repro_finish
+   _status=$?
+   ;;
help)
__show_help;
exit 0;
diff --git a/lib/help.cygpart b/lib/help.cygpart
index d28fd7bb..ff03fb5f 100644
--- a/lib/help.cygpart
+++ b/lib/help.cygpart
@@ -59,6 +59,7 @@ __show_help() {
  repro-build   rebuild from created source package to temp 
directory
  repro-diffcheck whether packages from original and 
rebuild differ
  repro-check   run repro-build and repro-diff
+ repro-finish  delete the temp directory used for rebuild
 
See the included README file for further documentation.
 
diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart
index 25b80906..07313c66 100644
--- a/lib/pkg_pkg.cygpart
+++ b/lib/pkg_pkg.cygpart
@@ -1048,6 +1048,28 @@ __pkg_repro_diff() {
inform "Rebuild produced identical packages"
 }
 
+__pkg_repro_finish() {
+   local t_spkgdir=${T}/${spkgdir##*/}
+
+   cd ${top}
+
+   __step "Removing rebuild directory in 2 seconds..."
+   inform "Rebuild dir: ${t_spkgdir}"
+   if ! [ -d ${t_spkgdir} ]
+   then
+   inform "Rebuild directory does not exist"
+   return 0
+   fi
+
+   sleep 2 || exit $?
+
+   __step "Removing rebuild directory NOW."
+   rm -rf ${t_spkgdir}
+
+   __step "Finished."
+}
+
 # protect functions
 readonly -f __pkg_binpkg __pkg_diff __gpg_sign __pkg_srcpkg __pkg_dist \
-__pkg_repro_build __pkg_repro_diff __squeeze_whitespace __tar
+__pkg_repro_build __pkg_repro_diff __pkg_repro_finish \
+__squeeze_whitespace __tar
-- 
2.43.0