[gentoo-commits] repo/gentoo:master commit in: sys-fs/atari-fdisk/, sys-fs/atari-fdisk/files/

2021-09-04 Thread James Le Cuirot
commit: a960513f2164073d5d895162ff02fd28bca73c18
Author: James Le Cuirot  gentoo  org>
AuthorDate: Sat Sep  4 21:57:29 2021 +
Commit: James Le Cuirot  gentoo  org>
CommitDate: Sat Sep  4 22:35:49 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a960513f

sys-fs/atari-fdisk: Patch to fix common global issue

Closes: https://bugs.gentoo.org/725988
Package-Manager: Portage-3.0.22, Repoman-3.0.3
Signed-off-by: James Le Cuirot  gentoo.org>

 sys-fs/atari-fdisk/atari-fdisk-0.7.1.5.4-r1.ebuild | 48 ++
 .../files/atari-fdisk-0.7.1.5.4-globals.patch  | 30 ++
 2 files changed, 78 insertions(+)

diff --git a/sys-fs/atari-fdisk/atari-fdisk-0.7.1.5.4-r1.ebuild 
b/sys-fs/atari-fdisk/atari-fdisk-0.7.1.5.4-r1.ebuild
new file mode 100644
index 000..f78d8d43789
--- /dev/null
+++ b/sys-fs/atari-fdisk/atari-fdisk-0.7.1.5.4-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+MY_PV=$(ver_cut 1-3)
+DEB_PV=$(ver_cut 4-5)
+DESCRIPTION="Create and edit the partition table of a disk partitioned in 
Atari format"
+HOMEPAGE="https://packages.qa.debian.org/a/atari-fdisk.html;
+SRC_URI="mirror://debian/pool/main/a/${PN}/${PN}_${MY_PV}-${DEB_PV}.tar.gz"
+S="${WORKDIR}"/${PN}-${MY_PV}
+
+LICENSE="GPL-2"
+SLOT="0"
+# Note: The code assumes sizeof(long) == 4 everywhere.  If you try to
+# use this on 64bit systems (where sizeof(long) == 8), then misbehavior
+# and memory corruption will ensue.
+KEYWORDS="-* ~m68k ~x86"
+
+PATCHES=(
+   "${FILESDIR}"/${PN}-0.7.1.5.4-prompt-logic.patch
+   "${FILESDIR}"/${PN}-0.7.1.5.4-gcc-5-inline.patch
+   "${FILESDIR}"/${PN}-0.7.1.5.4-globals.patch
+)
+
+src_compile() {
+   emake \
+   CFLAGS="${CFLAGS}" \
+   LDFLAGS="${LDFLAGS}" \
+   CC="$(tc-getCC)" \
+   COMPILE_ARCH=m68k
+}
+
+src_install() {
+   dodoc NEWS README TODO debian/changelog
+   doman debian/atari-fdisk.8
+
+   into /
+   if [[ $(tc-arch) == "m68k" ]] ; then
+   dosbin fdisk
+   dosym fdisk /sbin/atari-fdisk
+   dosym atari-fdisk.8 /usr/share/man/man8/fdisk.8
+   else
+   dosbin atari-fdisk
+   fi
+}

diff --git a/sys-fs/atari-fdisk/files/atari-fdisk-0.7.1.5.4-globals.patch 
b/sys-fs/atari-fdisk/files/atari-fdisk-0.7.1.5.4-globals.patch
new file mode 100644
index 000..a3b5b2aaecb
--- /dev/null
+++ b/sys-fs/atari-fdisk/files/atari-fdisk-0.7.1.5.4-globals.patch
@@ -0,0 +1,30 @@
+diff --color -Naur --ignore-all-space a/atari-fdisk.c b/atari-fdisk.c
+--- a/atari-fdisk.c1998-09-19 02:29:27.0 +0100
 b/atari-fdisk.c2021-09-04 22:41:35.286593292 +0100
+@@ -182,6 +182,7 @@
+ #endif
+ 
+ jmp_buf listingbuf;
++enum xpart_fmts xpart_fmt;
+ 
+ 
+ 
+diff --color -Naur --ignore-all-space a/fdisk.h b/fdisk.h
+--- a/fdisk.h  2021-09-04 22:24:42.258462148 +0100
 b/fdisk.h  2021-09-04 22:41:31.398481485 +0100
+@@ -86,11 +86,13 @@
+ char *name;
+ };
+ 
+-enum {
++enum xpart_fmts {
+ xfmt_unknown,
+ xfmt_AHDI,
+ xfmt_ICD
+-} xpart_fmt;  /* which format used for >4 part.s */
++};/* which format used for >4 part.s */
++
++extern enum xpart_fmts xpart_fmt;
+ 
+ #define MAX_PRIMARY_AHDI  4
+ #define MAX_PRIMARY_ICD   12



[gentoo-commits] repo/gentoo:master commit in: sys-fs/atari-fdisk/, sys-fs/atari-fdisk/files/

2015-12-19 Thread Mike Frysinger
commit: ef548ffadfd5f2b3af54cf00c84570268f404521
Author: Mike Frysinger  gentoo  org>
AuthorDate: Sat Dec 19 17:25:01 2015 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Sat Dec 19 17:33:52 2015 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef548ffa

sys-fs/atari-fdisk: fix builds w/gcc-5 #568732

 sys-fs/atari-fdisk/atari-fdisk-0.7.1.5.4.ebuild|  7 ++-
 .../files/atari-fdisk-0.7.1.5.4-gcc-5-inline.patch | 22 ++
 .../files/atari-fdisk-0.7.1.5.4-prompt-logic.patch | 15 +++
 3 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/sys-fs/atari-fdisk/atari-fdisk-0.7.1.5.4.ebuild 
b/sys-fs/atari-fdisk/atari-fdisk-0.7.1.5.4.ebuild
index f38a0e8..c8816f0 100644
--- a/sys-fs/atari-fdisk/atari-fdisk-0.7.1.5.4.ebuild
+++ b/sys-fs/atari-fdisk/atari-fdisk-0.7.1.5.4.ebuild
@@ -4,7 +4,7 @@
 
 EAPI="5"
 
-inherit versionator toolchain-funcs
+inherit versionator toolchain-funcs eutils
 
 MY_PV=$(get_version_component_range 1-3)
 DEB_PV=$(get_version_component_range 4-5)
@@ -19,6 +19,11 @@ IUSE=""
 
 S=${WORKDIR}/${PN}-${MY_PV}
 
+src_prepare() {
+   epatch "${FILESDIR}"/${PN}-0.7.1.5.4-prompt-logic.patch
+   epatch "${FILESDIR}"/${PN}-0.7.1.5.4-gcc-5-inline.patch
+}
+
 src_compile() {
emake \
CFLAGS="${CFLAGS}" \

diff --git a/sys-fs/atari-fdisk/files/atari-fdisk-0.7.1.5.4-gcc-5-inline.patch 
b/sys-fs/atari-fdisk/files/atari-fdisk-0.7.1.5.4-gcc-5-inline.patch
new file mode 100644
index 000..a7d1486
--- /dev/null
+++ b/sys-fs/atari-fdisk/files/atari-fdisk-0.7.1.5.4-gcc-5-inline.patch
@@ -0,0 +1,22 @@
+gcc 5 changed the default C standard which changes the behavior of extern
+inline.  convert these tiny funcs to static inline to fix builds.
+
+https://bugs.gentoo.org/568732
+
+--- a/fdisk.h
 b/fdisk.h
+@@ -224,12 +224,12 @@ extern jmp_buf listingbuf;
+  :
\
+   (__var = (__typeof(__var))swab32((unsigned long)__var)))
+ 
+-extern __inline__ unsigned short swab16( unsigned short val )
++static __inline__ unsigned short swab16( unsigned short val )
+ {
+ return( (val << 8) | (val >> 8) );
+ }
+ 
+-extern __inline__ unsigned long swab32( unsigned long val )
++static __inline__ unsigned long swab32( unsigned long val )
+ {
+ unsigned short vall = val, valh = val >> 16;
+ vall = (vall << 8) | (vall >> 8);

diff --git a/sys-fs/atari-fdisk/files/atari-fdisk-0.7.1.5.4-prompt-logic.patch 
b/sys-fs/atari-fdisk/files/atari-fdisk-0.7.1.5.4-prompt-logic.patch
new file mode 100644
index 000..c9a0192
--- /dev/null
+++ b/sys-fs/atari-fdisk/files/atari-fdisk-0.7.1.5.4-prompt-logic.patch
@@ -0,0 +1,15 @@
+there is a function called "primary_possible" which is used to set the
+"prim_possible" variable a few lines before this, but the logic will
+incorrectly test "primary_possible" instead of "prim_possible".
+
+--- a/menufuncs.c
 b/menufuncs.c
+@@ -599,7 +599,7 @@ void new_partition( void )
+   }
+   else if (!ext_possible)
+   make_ext = 0;
+-  else if (!primary_possible)
++  else if (!prim_possible)
+   make_ext = 1;
+   else
+   /* Create an extended partition if this is the 4th part. (to avoid