Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 753950 - games-util/ucon64-2.2.1 version bump
Summary: games-util/ucon64-2.2.1 version bump
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement with 1 vote (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
: 602866 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-11-10 23:35 UTC by Paul Hartman
Modified: 2021-06-14 22:58 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fixes issue with undefined zlib macro OF. (OF.patch,1.09 KB, patch)
2020-12-01 16:45 UTC, dbjh
Details | Diff
Fixes issue with undefined zlib macro OF. Also in libdiscmage. (OF.patch,2.39 KB, patch)
2020-12-05 10:04 UTC, dbjh
Details | Diff
ucon64-2.2.1.ebuild (ucon64-2.2.1.ebuild,815 bytes, text/plain)
2020-12-06 23:27 UTC, Paul Hartman
Details
Fixes crash in change_mem2() on 64-bit platforms. (change_mem2.patch,1.16 KB, patch)
2020-12-16 19:11 UTC, dbjh
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Hartman 2020-11-10 23:35:09 UTC
ucon64 2.2.0 is available since last year. 

For manually building the source (outside of portage), it compiled as-is with no error if I did ./configure --without-zlib

To build with zlib, I saw that ucon64 src in the "misc" and "libdiscmage" directories contains some files copied directly from zlib src tarball's contrib/minizip directory. I guess the ones in ucon64 are quite old because there were a lot of errors when trying to compile. I copied those same files from the latest zlib src, and then added a define in misc/ioapi.h:
#define AS(x) x

With that, there are some warnings but no more errors, and program seems to work with zip files as expected.

Whether the old zlib minizip files can be patched, or how to properly add those files to an ebuild is beyond my skill set. But I thought I would describe what I did.
Comment 1 dbjh 2020-12-01 06:17:58 UTC
Developer here. It is now at version 2.2.1.
I am curious about the errors you got with the original source code though. To be honest, I never noticed that MiniZip's development had continued as part of zlib. On the author's page (http://www.winimage.com/zLibDll/minizip.html) it appears as if 1.01e is the latest version, which is what is used in uCON64 (with some small changes indicated by static code analyzers).
Since the code compiles cleanly on several OSes, including several Linux variants with several versions of GCC (5 - 10) I am surprised that it results in compiler errors. So, could you post the compiler output when compiling 2.2.1, please? Thanks in advance!
Comment 2 Paul Hartman 2020-12-01 13:52:17 UTC
Hi dbjh, thanks for your attention! I've been using uCON since the old "Chicken & chp" versions in the early '90s... thanks for keeping it alive.

I downloaded the source for 2.2.1 from sourceforge, extracted it to a clear directory, cd src, ./configure, make

I am using gcc-10.2.0 with zlib 1.2.11 installed on my system.

Make has no problems until it gets to misc/ioapi.c:

In file included from misc/ioapi.c:28:
./misc/ioapi.h:38:44: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
   38 | typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
      |                                            ^~
./misc/ioapi.h:39:44: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
   39 | typedef uLong  (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
      |                                            ^~
./misc/ioapi.h:40:45: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
   40 | typedef uLong  (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
      |                                             ^~
./misc/ioapi.h:41:44: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
   41 | typedef long   (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
      |                                            ^~
./misc/ioapi.h:42:44: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
   42 | typedef long   (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
      |                                            ^~
./misc/ioapi.h:43:45: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
   43 | typedef int    (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
      |                                             ^~
./misc/ioapi.h:44:49: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
   44 | typedef int    (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
      |                                                 ^~
./misc/ioapi.h:48:5: error: unknown type name ‘open_file_func’
   48 |     open_file_func      zopen_file;
      |     ^~~~~~~~~~~~~~
./misc/ioapi.h:49:5: error: unknown type name ‘read_file_func’
   49 |     read_file_func      zread_file;
      |     ^~~~~~~~~~~~~~
./misc/ioapi.h:50:5: error: unknown type name ‘write_file_func’
   50 |     write_file_func     zwrite_file;
      |     ^~~~~~~~~~~~~~~
./misc/ioapi.h:51:5: error: unknown type name ‘tell_file_func’
   51 |     tell_file_func      ztell_file;
      |     ^~~~~~~~~~~~~~
./misc/ioapi.h:52:5: error: unknown type name ‘seek_file_func’
   52 |     seek_file_func      zseek_file;
      |     ^~~~~~~~~~~~~~
./misc/ioapi.h:53:5: error: unknown type name ‘close_file_func’
   53 |     close_file_func     zclose_file;
      |     ^~~~~~~~~~~~~~~
./misc/ioapi.h:54:5: error: unknown type name ‘testerror_file_func’
   54 |     testerror_file_func zerror_file;
      |     ^~~~~~~~~~~~~~~~~~~
./misc/ioapi.h:60:26: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
   60 | void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
      |                          ^~
misc/ioapi.c:51:34: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
   51 | voidpf ZCALLBACK fopen_file_func OF((
      |                                  ^~
misc/ioapi.c:56:33: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
   56 | uLong ZCALLBACK fread_file_func OF((
      |                                 ^~
misc/ioapi.c:62:34: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
   62 | uLong ZCALLBACK fwrite_file_func OF((
      |                                  ^~
misc/ioapi.c:68:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
   68 | long ZCALLBACK ftell_file_func OF((
      |                                ^~
misc/ioapi.c:72:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
   72 | long ZCALLBACK fseek_file_func OF((
      |                                ^~
misc/ioapi.c:78:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
   78 | int ZCALLBACK fclose_file_func OF((
      |                                ^~
misc/ioapi.c:82:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
   82 | int ZCALLBACK ferror_file_func OF((
      |                                ^~
misc/ioapi.c: In function ‘fill_fopen_filefunc’:
misc/ioapi.c:195:36: warning: assignment to ‘int’ from ‘void * (*)()’ makes integer from pointer without a cast [-Wint-conversion]
  195 |     pzlib_filefunc_def->zopen_file = fopen_file_func;
      |                                    ^
misc/ioapi.c:196:36: warning: assignment to ‘int’ from ‘uLong (*)()’ {aka ‘long unsigned int (*)()’} makes integer from pointer without a cast [-Wint-conversion]
  196 |     pzlib_filefunc_def->zread_file = fread_file_func;
      |                                    ^
misc/ioapi.c:197:37: warning: assignment to ‘int’ from ‘uLong (*)()’ {aka ‘long unsigned int (*)()’} makes integer from pointer without a cast [-Wint-conversion]
  197 |     pzlib_filefunc_def->zwrite_file = fwrite_file_func;
      |                                     ^
misc/ioapi.c:198:36: warning: assignment to ‘int’ from ‘long int (*)()’ makes integer from pointer without a cast [-Wint-conversion]
  198 |     pzlib_filefunc_def->ztell_file = ftell_file_func;
      |                                    ^
misc/ioapi.c:199:36: warning: assignment to ‘int’ from ‘long int (*)()’ makes integer from pointer without a cast [-Wint-conversion]
  199 |     pzlib_filefunc_def->zseek_file = fseek_file_func;
      |                                    ^
misc/ioapi.c:200:37: warning: assignment to ‘int’ from ‘int (*)()’ makes integer from pointer without a cast [-Wint-conversion]
  200 |     pzlib_filefunc_def->zclose_file = fclose_file_func;
      |                                     ^
misc/ioapi.c:201:37: warning: assignment to ‘int’ from ‘int (*)()’ makes integer from pointer without a cast [-Wint-conversion]
  201 |     pzlib_filefunc_def->zerror_file = ferror_file_func;
      |                                     ^
make: *** [Makefile:175: misc/ioapi.o] Error 1
Comment 3 dbjh 2020-12-01 16:45:00 UTC
Created attachment 676066 [details, diff]
Fixes issue with undefined zlib macro OF.

In uCON64 base directory, apply patch with:
patch -p1 < OF.patch
Comment 4 dbjh 2020-12-01 16:49:19 UTC
Hi Paul,

Thanks for the feedback, I appreciate it.
I have added a patch that should solve the problem. I have also submitted it to SVN. Please let me know about your results.
Comment 5 Paul Hartman 2020-12-01 17:02:18 UTC
Perfect, it builds clean with no warning or error now here. Thank you!

I will take a stab at putting together an updated gentoo ebuild later tonight.
Comment 6 dbjh 2020-12-05 10:04:08 UTC
Created attachment 676723 [details, diff]
Fixes issue with undefined zlib macro OF. Also in libdiscmage.

Slightly expanded the patch to solve the same issue for libdiscmage (disabled by default).

In the uCON64 base directory, apply the patch with:
patch -p1 < OF.patch

@Paul: Any update on the ebuild?
Comment 7 Paul Hartman 2020-12-06 23:27:42 UTC
Created attachment 677107 [details]
ucon64-2.2.1.ebuild

Here is a rough ebuild I put together. Disclaimer: I don't know what I'm doing and I hope someone can peer review and clean it up as needed. But it at least builds and installs the program for me.

Take the patch from the other attachment and put it in files/ucon64-2.2.1-of.patch

Thank you
Comment 8 dbjh 2020-12-16 19:11:44 UTC
Created attachment 678517 [details, diff]
Fixes crash in change_mem2() on 64-bit platforms.

Just fixed a crash in change_mem2() on 64-bit platforms. That function is used for patching functionality.
This thread seemed to be the best place to post this. Apologies if I am wrong about that.

@Paul: Perhaps you can update your proposed ebuild? I am not sure if you used the current (outdated) ebuild as a template, but for the record, it can be found here:
https://gitweb.gentoo.org/repo/gentoo.git/tree/games-util/ucon64
Comment 9 Ionen Wolkens gentoo-dev 2021-06-14 21:46:49 UTC
*** Bug 602866 has been marked as a duplicate of this bug. ***
Comment 10 Larry the Git Cow gentoo-dev 2021-06-14 22:58:24 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=449d7802c1c41097291ff82f28518ae7afffec3e

commit 449d7802c1c41097291ff82f28518ae7afffec3e
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2021-06-14 22:07:00 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2021-06-14 22:55:16 +0000

    games-util/ucon64: add 2.2.1
    
    - add IUSE debug, usb, zlib
    - set default discmage.so path not to need user intervention
    - shorter elog given ucon64's output already mentions .ucon64/dat
    - use fixes suggested by upstream in bug #753950
    
    Closes: https://bugs.gentoo.org/753950
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 games-util/ucon64/Manifest                         |  1 +
 .../files/ucon64-2.2.1-change-mem2-64bit.patch     | 23 ++++++++
 .../ucon64/files/ucon64-2.2.1-respect-flags.patch  | 35 ++++++++++++
 games-util/ucon64/files/ucon64-2.2.1-zlib.patch    | 26 +++++++++
 games-util/ucon64/ucon64-2.2.1.ebuild              | 65 ++++++++++++++++++++++
 5 files changed, 150 insertions(+)