Github messages for voidlinux
 help / color / mirror / Atom feed
From: cinerea0 <cinerea0@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] gnucobol: update to 3.2
Date: Sat, 26 Aug 2023 20:02:20 +0200	[thread overview]
Message-ID: <20230826180220.SIDLpFsfV2SvdUOm_m31U-OZXnz_qHAd-CUd2sBuOy0@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-45629@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 477 bytes --]

There is an updated pull request by cinerea0 against master on the void-packages repository

https://github.com/cinerea0/void-packages cobol
https://github.com/void-linux/void-packages/pull/45629

gnucobol: update to 3.2
#### Testing the changes
- I tested the changes in this PR: **briefly**

I am reaching out to a more experienced user of this package for testing. Closes #45612.

A patch file from https://github.com/void-linux/void-packages/pull/45629.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cobol-45629.patch --]
[-- Type: text/x-diff, Size: 5811 bytes --]

From 7497536abe66b8bfc288c5892dd3f5750c1708a5 Mon Sep 17 00:00:00 2001
From: cinerea0 <cinerea0@disroot.org>
Date: Sat, 26 Aug 2023 13:38:17 -0400
Subject: [PATCH] gnucobol: update to 3.2, enable cross

---
 srcpkgs/gnucobol/patches/cross.patch          | 15 +++++++
 srcpkgs/gnucobol/patches/errno.patch          | 26 +++++++++++
 .../patches/move-packed-decimal.patch         | 29 ++++++++++++
 srcpkgs/gnucobol/template                     | 44 +++++++++++++++----
 4 files changed, 106 insertions(+), 8 deletions(-)
 create mode 100644 srcpkgs/gnucobol/patches/cross.patch
 create mode 100644 srcpkgs/gnucobol/patches/errno.patch
 create mode 100644 srcpkgs/gnucobol/patches/move-packed-decimal.patch

diff --git a/srcpkgs/gnucobol/patches/cross.patch b/srcpkgs/gnucobol/patches/cross.patch
new file mode 100644
index 0000000000000..ffbc3063c7373
--- /dev/null
+++ b/srcpkgs/gnucobol/patches/cross.patch
@@ -0,0 +1,15 @@
+# Removes check on crossbuild-dependent variable set in toplevel configure.ac
+diff --git a/extras/Makefile.am b/extras/Makefile.am
+index d3a800f49a..324575ad4d 100644
+--- a/extras/Makefile.am
++++ b/extras/Makefile.am
+@@ -20,9 +20,7 @@
+ # along with GnuCOBOL.  If not, see <https://www.gnu.org/licenses/>.
+ 
+ extrasdir = @COB_LIBRARY_PATH@
+-if COB_MAKE_RUN_BINARIES
+ extras_DATA = CBL_OC_DUMP.$(COB_MODULE_EXT)
+-endif
+ COBC = cobc$(EXEEXT)
+ 
+ EXTRA_DIST = CBL_OC_DUMP.cob
diff --git a/srcpkgs/gnucobol/patches/errno.patch b/srcpkgs/gnucobol/patches/errno.patch
new file mode 100644
index 0000000000000..29218aa33e0c6
--- /dev/null
+++ b/srcpkgs/gnucobol/patches/errno.patch
@@ -0,0 +1,26 @@
+# Taken from: https://git.adelielinux.org/adelie/packages/-/commit/21fe3ef399c25f030d6657e83cc635335f3a9f40
+# Fixes failing test 488 for musl
+diff --git a/cobc/cobc.c b/cobc/cobc.c
+index b3a52303c5..f591be3a2e 100644
+--- a/cobc/cobc.c
++++ b/cobc/cobc.c
+@@ -2358,6 +2358,10 @@ set_listing_date (void)
+ DECLNORET static void COB_A_NORETURN
+ cobc_terminate (const char *str)
+ {
++	/* must be executed before anything that may adjust errno, ...
++	   like the listing code below. */
++	const char *errno_str = cb_get_strerror ();
++
+ 	if (cb_src_list_file) {
+ 		set_listing_date ();
+ 		set_standard_title ();
+@@ -2365,7 +2369,7 @@ cobc_terminate (const char *str)
+ 		cobc_elided_strcpy (cb_listing_filename, str, sizeof (cb_listing_filename), 0);
+ 		print_program_header ();
+ 	}
+-	cb_perror (0, "cobc: %s: %s", str, cb_get_strerror ());
++	cb_perror (0, "cobc: %s: %s", str, errno_str);
+ 	if (cb_src_list_file) {
+ 		print_program_trailer ();
+ 	}
diff --git a/srcpkgs/gnucobol/patches/move-packed-decimal.patch b/srcpkgs/gnucobol/patches/move-packed-decimal.patch
new file mode 100644
index 0000000000000..c327e97b54bd6
--- /dev/null
+++ b/srcpkgs/gnucobol/patches/move-packed-decimal.patch
@@ -0,0 +1,29 @@
+# Taken from: https://git.adelielinux.org/adelie/packages/-/commit/21fe3ef399c25f030d6657e83cc635335f3a9f40
+# Tracked upstream: https://sourceforge.net/p/gnucobol/bugs/904/
+diff --git a/libcob/numeric.c b/libcob/numeric.c
+index 9a8ec889f2..c9c47fd017 100644
+--- a/libcob/numeric.c
++++ b/libcob/numeric.c
+@@ -2739,17 +2739,12 @@ cob_move_bcd (cob_field *f1, cob_field *f2)
+ 		}
+ 	} else {
+ 		unsigned char *pos = fld2 + fld2_size - 1;
+-		if (COB_FIELD_HAVE_SIGN (f2)) {
+-			if (!fld1_sign) {
+-				*pos &= 0xF0;
+-				*pos |= 0x0C;
+-			} else {
+-				*pos &= 0xF0;
+-				*pos |= fld1_sign;
+-			}
+-		} else {
+-			*pos &= 0xF0;
++		if (!COB_FIELD_HAVE_SIGN (f2)) {
+ 			*pos |= 0x0F;
++		} else if (fld1_sign == 0x0D) {
++			*pos = (*pos & 0xF0) | 0x0D;
++		} else {
++			*pos = (*pos & 0xF0) | 0x0C;
+ 		}
+ 		if (!(COB_FIELD_DIGITS (f2) & 1) /* -> digits % 2 == 0 */) {
+ 			*fld2 &= 0x0F;
diff --git a/srcpkgs/gnucobol/template b/srcpkgs/gnucobol/template
index 4519ea7867249..ca7b40db3a157 100644
--- a/srcpkgs/gnucobol/template
+++ b/srcpkgs/gnucobol/template
@@ -1,19 +1,47 @@
 # Template file for 'gnucobol'
 pkgname=gnucobol
-version=3.1.2
+version=3.2
 revision=1
 build_style=gnu-configure
-make_check_target="test"
-makedepends="gmp-devel db-devel"
+build_helper=qemu
+configure_args="--disable-hardening"
+hostmakedepends="automake gettext-devel-tools libtool pkg-config"
+makedepends="db-devel gmp-devel json-c-devel libxml2-devel ncurses-devel"
 depends="gnucobol-libs>=${version}_${revision}"
-checkdepends="curl perl wget which"
+checkdepends="curl perl which"
 short_desc="GnuCOBOL (formerly OpenCOBOL) is a free COBOL compiler"
 maintainer="Cthulhux <git@tuxproject.de>"
 license="GPL-3.0-or-later"
-homepage="https://sourceforge.net/projects/open-cobol/"
-distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.gz"
-checksum=f38c60b38a9e404bcba709b61b46f2bafa146b5f3dd90a94b2a70f5cea2f6297
-nocross="https://build.voidlinux.org/builders/armv7l-musl_builder/builds/7152/steps/shell_3/logs/stdio"
+homepage="https://www.gnu.org/software/gnucobol/"
+distfiles="${GNU_SITE}/gnucobol/gnucobol-${version}.tar.xz"
+checksum=3bb48af46ced4779facf41fdc2ee60e4ccb86eaa99d010b36685315df39c2ee2
+
+pre_configure() {
+	autoreconf -fi
+}
+
+post_configure() {
+	if [ "${CROSS_BUILD}" ]; then
+		vsed -i libtool \
+			-e 's|exec \\"\\$progdir/\\$program\\"|exec /usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static \\"\\$progdir/\\$program\\"|'
+	fi
+}
+
+post_build() {
+	if [ "${CROSS_BUILD}" ]; then
+		vsed -i bin/cob-config \
+			-e "s|-I${XBPS_CROSS_BASE}/usr/include|-I/usr/include|"
+	fi
+}
+
+do_check() {
+	# Test fails because musl does not unload libraries, tracked upstream at https://sourceforge.net/p/gnucobol/bugs/906/
+	if [ "${XBPS_TARGET_LIBC}" = "musl" ]; then
+		vsed -i tests/testsuite -e "/^818;/d"
+	fi
+	TERM=xterm make check
+	make test
+}
 
 gnucobol-libs_package() {
 	short_desc+=" - runtime libraries"

  parent reply	other threads:[~2023-08-26 18:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17  2:50 [PR PATCH] " cinerea0
2023-08-17  3:17 ` [PR PATCH] [Updated] " cinerea0
2023-08-17  3:28 ` cinerea0
2023-08-17 20:03 ` GitMensch
2023-08-17 20:39 ` cinerea0
2023-08-17 20:42 ` GitMensch
2023-08-18  2:23 ` cinerea0
2023-08-18  3:10 ` cinerea0
2023-08-18  5:14 ` GitMensch
2023-08-22 23:24 ` [PR PATCH] [Updated] " cinerea0
2023-08-22 23:26 ` cinerea0
2023-08-23  5:12 ` GitMensch
2023-08-23  5:35 ` GitMensch
2023-08-23  7:00 ` GitMensch
2023-08-25  5:24 ` GitMensch
2023-08-26 18:02 ` cinerea0 [this message]
2023-09-23 13:32 ` [PR PATCH] [Merged]: " Duncaen

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=20230826180220.SIDLpFsfV2SvdUOm_m31U-OZXnz_qHAd-CUd2sBuOy0@z \
    --to=cinerea0@users.noreply.github.com \
    --cc=ml@inbox.vuxu.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;
as well as URLs for NNTP newsgroup(s).