* [gentoo-commits] repo/gentoo:master commit in: sys-fs/hfsutils/, sys-fs/hfsutils/files/
@ 2020-12-03 23:48 Sergei Trofimovich
0 siblings, 0 replies; 2+ messages in thread
From: Sergei Trofimovich @ 2020-12-03 23:48 UTC (permalink / raw
To: gentoo-commits
commit: 2bff5f3d49748d2b7d7deffc70ca3c2d1c95b5fe
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 3 23:48:35 2020 +0000
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu Dec 3 23:48:49 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2bff5f3d
sys-fs/hfsutils: fix tcl allocator usage in tests
Tests used Tcl_Alloc() / malloc() and Tcl_Free() / free()
interchangeably. Nowadays TCL allocator now requires correct
alloc/free functions to be used.
The patch fixes all the test crashes for me on amd64.
Reported-by: Roy Bamford
Closes: https://bugs.gentoo.org/757924
Package-Manager: Portage-3.0.11, Repoman-3.0.2
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
.../files/hfsutils-3.2.6-test-tcl-8.6.patch | 62 ++++++++++++++++++++++
sys-fs/hfsutils/hfsutils-3.2.6_p14.ebuild | 6 +++
2 files changed, 68 insertions(+)
diff --git a/sys-fs/hfsutils/files/hfsutils-3.2.6-test-tcl-8.6.patch b/sys-fs/hfsutils/files/hfsutils-3.2.6-test-tcl-8.6.patch
new file mode 100644
index 00000000000..fc2a5542ce4
--- /dev/null
+++ b/sys-fs/hfsutils/files/hfsutils-3.2.6-test-tcl-8.6.patch
@@ -0,0 +1,62 @@
+Use Tcl_Free() for arguments allocated with Tcl_SplitList().
+Use Tcl_Alloc() for arguments passed to tcl to be freed by TCL_DYNAMIC.
+
+https://bugs.gentoo.org/757924
+--- a/tclhfs.c
++++ b/tclhfs.c
+@@ -1313,7 +1313,7 @@ int cmd_hfs(ClientData clientData, Tcl_Interp *interp,
+ badblocks = ALLOCX(unsigned long, listc);
+ if (listc && badblocks == 0)
+ {
+- free(listv);
++ Tcl_Free((char *) listv);
+
+ interp->result = "out of memory";
+ return TCL_ERROR;
+@@ -1324,13 +1324,13 @@ int cmd_hfs(ClientData clientData, Tcl_Interp *interp,
+ if (Tcl_ExprLong(interp, listv[i],
+ (long *) &badblocks[i]) != TCL_OK)
+ {
+- free(listv);
++ Tcl_Free((char *) listv);
+ FREE(badblocks);
+ return TCL_ERROR;
+ }
+ }
+
+- free(listv);
++ Tcl_Free((char *) listv);
+
+ if (do_format(argv[2], partno, 0, argv[4], listc, badblocks) == -1)
+ {
+--- a/tclhfs.c
++++ b/tclhfs.c
+@@ -378,7 +378,7 @@ int file_cmd(ClientData clientData, Tcl_Interp *interp,
+ return TCL_ERROR;
+ }
+
+- mem = ALLOC(char, bytes + 1);
++ mem = Tcl_Alloc(bytes + 1);
+ if (mem == 0)
+ {
+ interp->result = "out of memory";
+--- a/tclhfs.c
++++ b/tclhfs.c
+@@ -902,7 +902,7 @@ int vol_cmd(ClientData clientData, Tcl_Interp *interp,
+ }
+
+ result = Tcl_Merge(listc, listv);
+- free(listv);
++ Tcl_Free((char *)listv);
+
+ Tcl_SetResult(interp, result, TCL_DYNAMIC);
+ }
+@@ -1038,7 +1038,7 @@ int vol_cmd(ClientData clientData, Tcl_Interp *interp,
+ return TCL_ERROR;
+
+ fargv = hfs_glob(vol, listc, listv, &fargc);
+- free(listv);
++ Tcl_Free((char*)listv);
+
+ if (fargv == 0)
+ {
diff --git a/sys-fs/hfsutils/hfsutils-3.2.6_p14.ebuild b/sys-fs/hfsutils/hfsutils-3.2.6_p14.ebuild
index d6ec2af9179..5df159088c9 100644
--- a/sys-fs/hfsutils/hfsutils-3.2.6_p14.ebuild
+++ b/sys-fs/hfsutils/hfsutils-3.2.6_p14.ebuild
@@ -32,6 +32,7 @@ REQUIRED_USE="tk? ( tcl )"
PATCHES=(
"${FILESDIR}"/largerthan2gb.patch
"${FILESDIR}"/${P/_p*}-fix-tcl-8.6.patch
+ "${FILESDIR}"/${PN}-3.2.6-test-tcl-8.6.patch
)
S=${WORKDIR}/${P/_p*}
@@ -57,6 +58,11 @@ src_compile() {
emake CC="$(tc-getCC)" -C hfsck
}
+src_test() {
+ # Tests reuse the same image name. Let's serialize.
+ emake check -j1
+}
+
src_install() {
dodir /usr/bin /usr/lib /usr/share/man/man1
emake \
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/hfsutils/, sys-fs/hfsutils/files/
@ 2022-10-16 18:04 Sam James
0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2022-10-16 18:04 UTC (permalink / raw
To: gentoo-commits
commit: 9da22a2f622eaa9bddd09ae1eeefc879e3de58c1
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 16 18:01:06 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 16 18:01:52 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9da22a2f
sys-fs/hfsutils: add 3.2.6_p15, fix build w/ Clang 16
Closes: https://bugs.gentoo.org/871165
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-fs/hfsutils/Manifest | 1 +
...ils-3.2.6_p15-Include-string.h-for-strcmp.patch | 17 +++++
.../hfsutils-3.2.6_p15-drop-manual-autoconf.patch | 78 ++++++++++++++++++++++
sys-fs/hfsutils/hfsutils-3.2.6_p15.ebuild | 74 ++++++++++++++++++++
4 files changed, 170 insertions(+)
diff --git a/sys-fs/hfsutils/Manifest b/sys-fs/hfsutils/Manifest
index a8fde341db17..2bfbbbcea585 100644
--- a/sys-fs/hfsutils/Manifest
+++ b/sys-fs/hfsutils/Manifest
@@ -1,2 +1,3 @@
DIST hfsutils_3.2.6-14.debian.tar.xz 6780 BLAKE2B 00474d328f5ec2614ec429052e6940b9eb10d04f433399f686ccc24d66ca1559e7ca45c4ab3ebe6386e02fc4de5ffd96242a7aa6f58d6032798d5536da912a61 SHA512 33d44f7b9094743031fc9315cf9380e158225ee2cd5af7a5ec7c55a2ae9af42e16f9cad3c667b153a1d3d9484d4ea773d34b88b78bfe9499df52a8b9d77defb2
+DIST hfsutils_3.2.6-15.debian.tar.xz 6364 BLAKE2B 7a588ceb4fefe50531d669f9c70452d6f7105f54cd674740296154203336a0d0977eb17d6aa9122b003029c26a4aa7674919fcdbbf8c527031be71a56d5a2c3f SHA512 67e3e7d33918b58cb02b7b8626caac890cf6c3bda5d81adeae9d0fa55bf7ad8fad18b0ecec5619bdfb9be037e16b5986eb1c6c8cd2044164e31927c5a1b6b1bf
DIST hfsutils_3.2.6.orig.tar.gz 207697 BLAKE2B 96c3d839e3c07e325e4e175a484b3c637d7cdebdc02ec11ee6810096162d155aa75d71a8e133b801b767a78d50115384460c4181359767f49e015524800885e8 SHA512 0db3050e5969c4e4e6c6ddb10cbc221a5837eb1e12f9331e7129511d31a4ec8d38420ed0b948dadc85ed990f3b1085e930eb7f0c37b3883866d963e47cbbb173
diff --git a/sys-fs/hfsutils/files/hfsutils-3.2.6_p15-Include-string.h-for-strcmp.patch b/sys-fs/hfsutils/files/hfsutils-3.2.6_p15-Include-string.h-for-strcmp.patch
new file mode 100644
index 000000000000..4b9db273ec40
--- /dev/null
+++ b/sys-fs/hfsutils/files/hfsutils-3.2.6_p15-Include-string.h-for-strcmp.patch
@@ -0,0 +1,17 @@
+https://bugs.gentoo.org/871165
+
+From 065e349d0a0e1db9fda99f90ff825b7934f191da Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sun, 16 Oct 2022 18:18:58 +0100
+Subject: [PATCH] Include <string.h> for strcmp
+
+--- a/hpwd.c
++++ b/hpwd.c
+@@ -24,6 +24,7 @@
+ # endif
+
+ # include <stdio.h>
++# include <string.h>
+
+ # include "hfs.h"
+ # include "hcwd.h"
diff --git a/sys-fs/hfsutils/files/hfsutils-3.2.6_p15-drop-manual-autoconf.patch b/sys-fs/hfsutils/files/hfsutils-3.2.6_p15-drop-manual-autoconf.patch
new file mode 100644
index 000000000000..00f5bfb8a438
--- /dev/null
+++ b/sys-fs/hfsutils/files/hfsutils-3.2.6_p15-drop-manual-autoconf.patch
@@ -0,0 +1,78 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -197,23 +197,6 @@ dist ::
+
+ ###############################################################################
+
+-Makefile: config.status
+- ./config.status && touch .stamp/config.h
+-
+-.stamp/config.h: config.status
+- ./config.status && touch .stamp/config.h
+-
+-config.status: .stamp/configure .stamp/config.h.in Makefile.in
+- ./config.status --recheck
+-
+-.stamp/configure: configure.in
+- autoconf && touch .stamp/configure
+-
+-.stamp/config.h.in: configure.in acconfig.h
+- autoheader && touch .stamp/config.h.in
+-
+-###############################################################################
+-
+ $(LIBHFS) ::
+ cd libhfs && $(MAKE)
+
+--- a/libhfs/Makefile.in
++++ b/libhfs/Makefile.in
+@@ -96,23 +96,6 @@ maintainer-clean :: distclean
+
+ ###############################################################################
+
+-Makefile: config.status
+- ./config.status && touch .stamp/config.h
+-
+-.stamp/config.h: config.status
+- ./config.status && touch .stamp/config.h
+-
+-config.status: .stamp/configure .stamp/config.h.in Makefile.in
+- ./config.status --recheck
+-
+-.stamp/configure: configure.in
+- autoconf && touch .stamp/configure
+-
+-.stamp/config.h.in: configure.in acconfig.h
+- autoheader && touch .stamp/config.h.in
+-
+-###############################################################################
+-
+ $(HFSTARGET): $(HFSOBJS)
+ $(AR) $@ $(HFSOBJS)
+ $(RANLIB) $@
+--- a/librsrc/Makefile.in
++++ b/librsrc/Makefile.in
+@@ -92,23 +92,6 @@ maintainer-clean :: distclean
+
+ ###############################################################################
+
+-Makefile: config.status
+- ./config.status && touch .stamp/config.h
+-
+-.stamp/config.h: config.status
+- ./config.status && touch .stamp/config.h
+-
+-config.status: .stamp/configure .stamp/config.h.in Makefile.in
+- ./config.status --recheck
+-
+-.stamp/configure: configure.in
+- autoconf && touch .stamp/configure
+-
+-.stamp/config.h.in: configure.in acconfig.h
+- autoheader && touch .stamp/config.h.in
+-
+-###############################################################################
+-
+ $(RSRCTARGET): $(RSRCOBJS)
+ $(AR) $@ $(RSRCOBJS)
+ $(RANLIB) $@
diff --git a/sys-fs/hfsutils/hfsutils-3.2.6_p15.ebuild b/sys-fs/hfsutils/hfsutils-3.2.6_p15.ebuild
new file mode 100644
index 000000000000..dddff37401ba
--- /dev/null
+++ b/sys-fs/hfsutils/hfsutils-3.2.6_p15.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools toolchain-funcs
+
+DESCRIPTION="HFS FS Access utils"
+HOMEPAGE="https://www.mars.org/home/rob/proj/hfs/"
+SRC_URI="
+ mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV/_p*}.orig.tar.gz
+ mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV/_p/-}.debian.tar.xz
+"
+S="${WORKDIR}"/${P/_p*}
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="tcl tk"
+# Tests are enabled only with USE=tcl
+RESTRICT="!tcl? ( test )"
+# use tk requires tcl - bug #150437
+REQUIRED_USE="tk? ( tcl )"
+
+DEPEND="
+ tcl? ( dev-lang/tcl:= )
+ tk? ( dev-lang/tk:= )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${WORKDIR}"/debian/patches
+ "${FILESDIR}"/${P/_p*}-fix-tcl-8.6.patch
+ "${FILESDIR}"/${PN}-3.2.6-test-tcl-8.6.patch
+ "${FILESDIR}"/${PN}-3.2.6_p15-Include-string.h-for-strcmp.patch
+ "${FILESDIR}"/${PN}-3.2.6_p15-drop-manual-autoconf.patch
+)
+
+src_prepare() {
+ default
+
+ sed -i -e 's:configure.in:configure.ac:' {libhfs/,librsrc/,}{configure,Makefile,config.h}.in || die
+
+ eautoreconf
+}
+
+src_configure() {
+ tc-export CC
+
+ econf \
+ $(use_with tcl tcl /usr/$(get_libdir) no) \
+ $(use_with tk tk /usr/$(get_libdir) no)
+}
+
+src_compile() {
+ emake AR="$(tc-getAR) rc" CC="$(tc-getCC)" RANLIB="$(tc-getRANLIB)"
+ emake CC="$(tc-getCC)" -C hfsck
+}
+
+src_test() {
+ # Tests reuse the same image name. Let's serialize.
+ emake -j1 check
+}
+
+src_install() {
+ dodir /usr/bin /usr/lib /usr/share/man/man1
+ emake \
+ prefix="${ED}"/usr \
+ MANDEST="${ED}"/usr/share/man \
+ infodir="${ED}"/usr/share/info \
+ install
+ dobin hfsck/hfsck
+ dodoc BLURB CHANGES README TODO doc/*.txt
+}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-16 18:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-03 23:48 [gentoo-commits] repo/gentoo:master commit in: sys-fs/hfsutils/, sys-fs/hfsutils/files/ Sergei Trofimovich
-- strict thread matches above, loose matches on Subject: below --
2022-10-16 18:04 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox