HTTPing icon indicating copy to clipboard operation
HTTPing copied to clipboard

Configure to work with macOS NCurses?

Open iandol opened this issue 3 years ago • 4 comments

Hi, ncurses comes with macOS, but to make use of it the naming is slightly different. In homebrew there is a rule that replaces lncursesw with lncurses:

inreplace %w[configure Makefile], "lncursesw", "lncurses"

But it would be better if the configure script could handle this platform detail automatically. Your configure script is a shell script so you could use something like:

PLATFORM=$(uname -s)
if [[ $PLATFORM = 'Darwin' ]]; then
  ...
fi

For the makefile, at least according to stack exchange:

UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
  LDFLAGS+=-lncurses
else
  LDFLAGS+=-lncursesw
end

I can make a pull request if you want...

iandol avatar Oct 31 '22 03:10 iandol

Would replacing my shell-scripts with cmake help?

On Mon, Oct 31, 2022 at 4:52 AM Ian Max Andolina @.***> wrote:

Hi, ncurses comes with macOS, but to make use of it the naming is slightly different. In homebrew there is a rule that replaces lncursesw with lncurses:

inreplace %w[configure Makefile], "lncursesw", "lncurses"

But it would be better if the configure script could handle this platform detail automatically. Your configure script is a shell script so you could use something like:

PLATFORM=$(uname -s)if [[ $PLATFORM = 'Darwin' ]]; then ...fi

For the makefile, at least according to stack exchange:

UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Darwin) LDFLAGS+=-lncurses else LDFLAGS+=-lncursesw end

I can make a pull request if you want...

— Reply to this email directly, view it on GitHub https://github.com/folkertvanheusden/HTTPing/issues/7, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUN5IWYRQGUVG2LJR4P6JGLWF47ABANCNFSM6AAAAAARSVZQT4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

folkertvanheusden avatar Oct 31 '22 08:10 folkertvanheusden

Honestly, I'm not a C programmer and thus ignorant of which make tools are considered better. I'm just an end user who knows enough to be dangerous! 🙃

httping seems to compile well enough with your existing shellscript + makefile, and at least from the view of homebrew, as long as upstream (httping in this case) handles issues like this, it is OK. I'm sure cmake is a more elegant tool, but is there really a need for an extra build dependency?

iandol avatar Oct 31 '22 23:10 iandol

It would make it easier (I hope) to build for multiple platforms.

On Tue, Nov 1, 2022 at 12:47 AM Ian Max Andolina @.***> wrote:

Honestly, I'm not a C programmer and thus ignorant of which make tools are considered better. I'm just an end user who knows enough to be dangerous! 🙃

httping seems to compile well enough with your existing shellscript + makefile, and at least from the view of homebrew, as long as upstream (httping in this case) handles issues like this, it is OK. I'm sure cmake is a more elegant tool, but is there really a need for an extra build dependency?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

folkertvanheusden avatar Nov 01 '22 06:11 folkertvanheusden

OK, I'll leave this issue open for the moment, I think we can get V2.9 back in the public repo without needing this to be completed, and a future release using cmake can make future release more robust when building cross-platform...

iandol avatar Nov 01 '22 10:11 iandol

With https://github.com/folkertvanheusden/HTTPing/pull/57, we can now build/test httping with ncurses support under macOS. Just invoke this command to configure TUI support:

cmake -DUSE_TUI=ON build

See README.md and .github/workflows/macos.yml for further details.

We can close this issue now.

yegorich avatar Feb 21 '25 08:02 yegorich