Created attachment 252132 [details] git patch Quich is a simple terminal calculator, and is available from here: https://github.com/Usbac/quich. I would like to propose to add this program to the ports collection.
Having a quick look at the source code it seems like you can unbundle (lib)linenoise. https://docs.freebsd.org/en/books/porters-handbook/book/#bundled-libs-practices
Created attachment 252148 [details] git patch Awesome! Thank you for the comments. I have made sure that the program compiles with liblinenoise as a dependency (see attachment). This library (linenoise) is already available in the ports tree, so there is no need to create it; however linenoise is missing an SONAME - that could be added to linenoise, but I guess that should be a separate bug report...
Created attachment 252149 [details] git patch ... and now also with tests :-)
Uhm... is it intentional to not link with (lib)m with the patch?
(In reply to Daniel Engberg from comment #4) quich is already linking against libm; see here in the compiled file: .build/quich: libm.so.5 => /lib/libm.so.5 (0x15766118000) liblinenoise.so => /usr/local/lib/liblinenoise.so (0x15767656000) libc.so.7 => /lib/libc.so.7 (0x15766f75000) [vdso] (0x15765310000) I was thinking that you might be referring to the patch for the Makefile, but it is linking to libm... the patch just adds liblinenoise (and does not remote libm) to both quich and quich_test. After applying the patch, the Makefile looks like this (for quich): target_link_libraries(quich m) target_link_libraries(quich linenoise) I was also wondering if you were referring to a missing LIB_DEPENDS on the port's Makefile, but I cannot find any other example in the ports tree that does this; Since libm is part of base, I guess that this is not needed and your comment is not referring to this... right? So... sorry, I am not sure what you are referring to - can you please elaborate a bit more? :-) Thanks for taking the time to review.
Hi, Sorry misread patch file, I'll have a look at it more closely in the next following days. Patch looks good having a quick glance at it, thanks! Best regards, Daniel
(In reply to Daniel Engberg from comment #6) Hi Daniel, did you have a chance to look at the patch? Is it OK, or should I still improve some aspect? Thanks!
I have patch that's ~95% done makes this less hacky, just need the other PR merged or at least approved.
Created attachment 252493 [details] Patch for quich Use pkgconfig to determine (lib)linenoise instead of hardcoding it
Created attachment 252498 [details] Patch for quich v2 Use upstream PR
Source: https://github.com/Usbac/quich/pull/21
Created attachment 252572 [details] git patch Hi Daniel Sorry it took a bit longer than expected to answer. I have validated your proposed changes - all looks good. Only (minor/cosmetic) changes I made were to make portclippy happy :-)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=7b157ac5264d8767e48759d362801c9ead26710a commit 7b157ac5264d8767e48759d362801c9ead26710a Author: Tiago Gasiba <tiago.gasiba@gmail.com> AuthorDate: 2024-08-14 00:12:04 +0000 Commit: Daniel Engberg <diizzy@FreeBSD.org> CommitDate: 2024-08-14 00:19:05 +0000 math/quich: New port: Terminal based advanced calculator A calculator that supports various functions such as sqrt, abs, log sin, cos, tan, asin, acos, atan, rand, round, floor and ceil. It also allows adjustable output, variables etc https://github.com/Usbac/quich PR: 280340 math/Makefile | 1 + math/quich/Makefile (new) | 32 ++++++++++++++++++++++++++++++++ math/quich/distinfo (new) | 5 +++++ math/quich/pkg-descr (new) | 3 +++ 4 files changed, 41 insertions(+)