Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge pilot-link-git AUR patches to support builds on modern Linux distributions #21

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

futuraperdita
Copy link

@futuraperdita futuraperdita commented Jan 12, 2025

As requested, this PR is simply a manually-patched pilot-link using the patches from the AUR's pilot-link-git package by Omar007, written in 2022. The PKGBUILD generates configure with these autogen.sh flags:

./autogen.sh \
--prefix=/usr \
--enable-conduits \
--enable-libusb \
--with-libiconv \
--with-libpng

A disclaimer that I didn't write any of these changes personally and did not test it outside of these autogen.sh flags, but it does allow pilot-link to build. Would recommend testing with other flag permutations. I also have not done a very thorough code review of the added config.guess and config.sub files that have been patched, so I'd be careful there in terms of trust.

pilot-link's build system also pollutes every directory with compiled/generated files; commits also exist here to add those to .gitignore, although the code probably should be creating a build/, dist/ or other such directory.

This modified version of pilot-link brings in the patchset from Omar007's
https://aur.archlinux.org/packages/pilot-link-git in order to allow pilot-link
to build on newer Linux distributions.

This requires hand-modified `config.guess` and `config.sub` with the current
toolchain, so these have been replaced with their modified versions and removed
from .gitignore in the interim.
A bit of a kludge, but we likely also want to ignore any build artifacts
from version control unless they're specifically added. A *lot* of things
end up built alongside the source and pollute the repository, so here
we explicitly add those that are built from the `make` step.
I accidentally deleted and re-added this lower in the .gitignore stack.
@futuraperdita
Copy link
Author

futuraperdita commented Jan 13, 2025

Just as a note, the PKGBUILD produces libtool wrapper scripts as executables. I'm unsure if this was the original behavior of pilot-link or if the original one produced static binaries; I get those if I add --disable-shared during autogen/configure.

@parkerlreed
Copy link

Tried your branch with the supplied autogen line on Arch Linux with gcc 14.2.1

Goes well until this

libtool: link: gcc -g2 -Wall -o .libs/pilot-read-screenshot pilot-read-screenshot.o  ./.libs/libpiuserland.a -lpopt -lpng ../libpisock/.libs/libpisock.so -lusb -lpthread -lbluetooth
gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/include -I../include        -g2 -Wall -MT pilot-read-todos.o -MD -MP -MF .deps/pilot-read-todos.Tpo -c -o pilot-read-todos.o pilot-read-todos.c
pilot-read-todos.c: In function ‘main’:
pilot-read-todos.c:220:53: error: passing argument 4 of ‘pi_file_read_record’ from incompatible pointer type [-Wincompatible-pointer-types]
  220 |                             (pif, i, (void *) &ptr, &len, &attr, &category,
      |                                                     ^~~~
      |                                                     |
      |                                                     int *
In file included from ../include/pi-socket.h:58,
                 from pilot-read-todos.c:32:
../include/pi-file.h:268:72: note: expected ‘size_t *’ {aka ‘long unsigned int *’} but argument is of type ‘int *’
  268 |             PI_ARGS((pi_file_t *pf, int recindex, void **bufp, size_t *sizep,
      |                                                                ~~~~~~~~^~~~~
../include/pi-args.h:29:29: note: in definition of macro ‘PI_ARGS’
   29 | #   define PI_ARGS(x)       x
      |                             ^
make[3]: *** [Makefile:1490: pilot-read-todos.o] Error 1
make[3]: Leaving directory '/home/parker/build/cloudpilot-emu/src/cloudpilot/pilot-link/pilot-link/src'
make[2]: *** [Makefile:1526: all-recursive] Error 1
make[2]: Leaving directory '/home/parker/build/cloudpilot-emu/src/cloudpilot/pilot-link/pilot-link/src'
make[1]: *** [Makefile:593: all-recursive] Error 1
make[1]: Leaving directory '/home/parker/build/cloudpilot-emu/src/cloudpilot/pilot-link/pilot-link'
make: *** [Makefile:471: all] Error 2

@futuraperdita
Copy link
Author

I’ll look at this again this evening and see what went wrong. What do you get if you build from the AUR directly?

@parkerlreed
Copy link

It also failed from the AUR directly which is why I came looking on the repo and found this PR.

@parkerlreed
Copy link

parkerlreed commented Jan 19, 2025

Same error from the AUR. This line fixed it for me changing it in pilot-read-todos.c

pi_file_read_record(pif, i, (void *) &ptr, (size_t *) &len, &attr, &category

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants