brouhaha / nonpareil

microcode-level simulation of HP calculators
Other
27 stars 3 forks source link

Fails to build on Arch Linux without extra includes #17

Open meltdown03 opened 4 months ago

meltdown03 commented 4 months ago

I needed to add a couple includes in order to build in Archlinux:

src/xmlutil.c added #include <libxml/entities.h> for a couple missing XML definitions.

src/calcdef.c added #include <stdlib.h> for strto** and atoi not being defined

LOG without and modifications:

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o src/xmlutil.o -c -std=gnu99 -Wall -Wextra -g -pthread -Isrc -Ibuild/common -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libgsf-1 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -I/usr/include/pixman-1 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/sysprof-6 src/xmlutil.c
src/xmlutil.c: In function 'sax_get_entity':
src/xmlutil.c:159:10: error: implicit declaration of function 'xmlGetPredefinedEntity' [-Wimplicit-function-declaration]
  159 |   return xmlGetPredefinedEntity (name);
      |          ^~~~~~~~~~~~~~~~~~~~~~
src/xmlutil.c:159:10: error: returning 'int' from a function with return type 'xmlEntityPtr' {aka 'struct _xmlEntity *'} makes pointer from integer without a cast [-Wint-conversion]
  159 |   return xmlGetPredefinedEntity (name);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scons: *** [src/xmlutil.o] Error 1
scons: building terminated because of errors.

And if only modifying the xmlutil file I got this next:

src/calcdef.c:261:12: error: implicit declaration of function 'strtoul'; did you mean 'strtok'? [-Wimplicit-function-declaration]
  261 |       id = strtoul (s, & endptr, 0);
      |            ^~~~~~~
      |            strtok
src/calcdef.c: In function 'parse_calcdef':
src/calcdef.c:359:35: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
  359 |           calcdef->arch_variant = atoi ((char *) attrs [i + 1]);
      |                                   ^~~~
src/calcdef.c: In function 'parse_inst_clock':
src/calcdef.c:406:38: error: implicit declaration of function 'strtod'; did you mean 'strtok'? [-Wimplicit-function-declaration]
  406 |           calcdef->clock_frequency = strtod ((char *) attrs [i + 1], & endptr);
      |                                      ^~~~~~
      |                                      strtok
src/calcdef.c: In function 'parse_key':
src/calcdef.c:520:26: error: implicit declaration of function 'strtol'; did you mean 'strtok'? [-Wimplicit-function-declaration]
  520 |           user_keycode = strtol ((char *) attrs [i + 1], & endptr, 0);
      |                          ^~~~~~
      |                          strtok
PerryWerneck commented 3 months ago

Not related to the issue itself, but, do you have the PKGBUILD file for archlinux? Is it on github or can you send it to me?

meltdown03 commented 3 months ago

I just built it manually from the command line with Scons

On Wed, Aug 28, 2024, 8:33 AM Perry Werneck @.***> wrote:

Not related to the issue itself, but, do you have the PKGBUILD file for archlinux? Is it on github or can you send it to me?

— Reply to this email directly, view it on GitHub https://github.com/brouhaha/nonpareil/issues/17#issuecomment-2315333690, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPBQCCO6VLDO2WVPZTYQGDZTXGTRAVCNFSM6AAAAABL7NQNZ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJVGMZTGNRZGA . You are receiving this because you authored the thread.Message ID: @.***>

PerryWerneck commented 3 months ago

I was able to package it for arch. Dont have the environment to test but, if you want it's published at https://software.opensuse.org/download.html?project=home%3APerryWerneck&package=nonpareil

meltdown03 commented 3 months ago

Even after I get it to build in Arch, I don't get any digits on the display of the calculators. The 16c works, but not the 41c series or the 67. I see the commas pop up and move around though, strange.

On Wed, Aug 28, 2024, 10:48 AM Perry Werneck @.***> wrote:

I was able to package it for arch. Dont have the environment to test but, if you want it's published at https://software.opensuse.org/download.html?project=home%3APerryWerneck&package=nonpareil

— Reply to this email directly, view it on GitHub https://github.com/brouhaha/nonpareil/issues/17#issuecomment-2315716596, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPBQCHQ3OBVPBU4ZQVTKVLZTXWLRAVCNFSM6AAAAABL7NQNZ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJVG4YTMNJZGY . You are receiving this because you authored the thread.Message ID: @.***>