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

Get devel/notcurses working on DPorts #995

Closed
dankamongmen opened this issue Nov 17, 2020 · 13 comments
Closed

Get devel/notcurses working on DPorts #995

dankamongmen opened this issue Nov 17, 2020 · 13 comments

Comments

@dankamongmen
Copy link

Hey there! I'm the upstream author of Notcurses, and also the maintainer of the FreeBSD port. I was wondering why it wasn't getting built in DPorts, and finally tracked down https://github.com/DragonFlyBSD/DeltaPorts/blob/master/ports/devel/notcurses/Makefile.DragonFly. It looks like I need to work around a missing clock_nanosleep() according to the notes there. Is there anything else I ought watch for? I don't have a DragonFly BSD machine handy, but if there's any service I can submit builds to, I'll happily make Notcurses work for this exciting project.

In the meantime, I'll make sure 2.0.5 provides an alternate for clock_nanosleep(). Is there any way to get future build failures rigged up to file bugs against Notcurses? I'll treat them as such.

@dankamongmen
Copy link
Author

Alternatively (if audaciously), I'd be willing to take an old college try at implementing clock_nanosleep() on DragonFly, unless there's a reason why it's not implemented.

@tuxillo
Copy link
Member

tuxillo commented Nov 17, 2020

@dankamongmen thanks for contacting us!

Do you know if DragonFly BSD would be the only exception that has no clock_nanosleep() ?

@dankamongmen
Copy link
Author

According to the documentation for GNU GNUlib (a portability library), clock_nanosleep is unavailable on platforms including:

Mac OS X 10.11, FreeBSD 6.0, NetBSD 5.0, OpenBSD 6.7, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin 1.7.9, mingw, MSVC 14.

The function is specified by POSIX.1-2001, and was added to FreeBSD in 2017, it would seem.

@tuxillo
Copy link
Member

tuxillo commented Nov 17, 2020

If it's not too much work, it would be great if you could provide an alternative to clock_nanosleep for the time being. I'll add to my to-do list its implementation (probably taking it from freebsd).

@dankamongmen
Copy link
Author

I can absolutely do that, though if the FreeBSD implementation is expected to work in DragonFly without much in the way of changes, I can probably handle that task.

In any case, I'll go ahead and do a clock_nanosleep() implementation (possibly just using GNUlib), for better support of the AIX 5.1 machines of the world.

@dankamongmen
Copy link
Author

@tuxillo, I've gone ahead and implemented clock_nanosleep() in Notcurses, to be compiled only when on a (non-Linux && non-FreeBSD) platform in dankamongmen/notcurses@8283adc. Would it be possible for you to do a clone and see if there are any other problems compiling on DragonFly? I can get a VM set up if you're not in a position to do this. Thanks!

@liweitianux
Copy link
Member

liweitianux commented Jan 11, 2021

@tuxillo , We need GCC 9.x to build this port... With GCC 8.3 from base: I'm having such errors:

[ 61%] Linking CXX executable ncls
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/ncls.dir/link.txt --verbose=1
/usr/bin/c++  -pipe -I/usr/local/include -I/usr/local/include/ncurses -O2 -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include  -pipe -I/usr/local/include -I/usr/local/include/ncurses -O2 -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include  -L/usr/local/lib -Wl,-rpath=/usr/local/lib CMakeFiles/ncls.dir/src/ls/main.cpp.o -o ncls  -Wl,-z,origin,-rpath,/usr/obj/dports/devel/notcurses/.build libnotcurses++.so.2.1.4 -llibstdc++fs libnotcurses.so.2.1.4 -pthread -lavutil 
/usr/libexec/binutils227/elf/ld.gold: error: cannot find -llibstdc++fs
CMakeFiles/ncls.dir/src/ls/main.cpp.o:main.cpp:function ncls_thread(lsContext const*): error: undefined reference to 'std::filesystem::__cxx11::path::_M_split_cmpts()'
CMakeFiles/ncls.dir/src/ls/main.cpp.o:main.cpp:function ncls_thread(lsContext const*): error: undefined reference to 'std::filesystem::__cxx11::path::has_root_directory() const'
CMakeFiles/ncls.dir/src/ls/main.cpp.o:main.cpp:function ncls_thread(lsContext const*): error: undefined reference to 'std::filesystem::__cxx11::path::has_filename() const'
CMakeFiles/ncls.dir/src/ls/main.cpp.o:main.cpp:function ncls_thread(lsContext const*): error: undefined reference to 'std::filesystem::__cxx11::path::_M_split_cmpts()'
CMakeFiles/ncls.dir/src/ls/main.cpp.o:main.cpp:function handle_inode(std::filesystem::__cxx11::path&, char const*, stat const*, lsContext const&): error: undefined reference to 'std::filesystem::__cxx11::path::_M_split_cmpts()'
CMakeFiles/ncls.dir/src/ls/main.cpp.o:main.cpp:function handle_inode(std::filesystem::__cxx11::path&, char const*, stat const*, lsContext const&): error: undefined reference to 'std::filesystem::__cxx11::path::_M_split_cmpts()'
CMakeFiles/ncls.dir/src/ls/main.cpp.o:main.cpp:function handle_dir(int, std::filesystem::__cxx11::path&, char const*, stat const*, lsContext const&, bool): error: undefined reference to 'std::filesystem::__cxx11::path::has_root_directory() const'
CMakeFiles/ncls.dir/src/ls/main.cpp.o:main.cpp:function handle_dir(int, std::filesystem::__cxx11::path&, char const*, stat const*, lsContext const&, bool): error: undefined reference to 'std::filesystem::__cxx11::path::has_filename() const'
collect2: error: ld returned 1 exit status
*** [ncls] Error code 1

Our GCC 8.3 in base don't have libstdc++fs ...

Refs:

See also: dankamongmen/notcurses#1121

@liweitianux
Copy link
Member

@tuxillo , With USE_GCC_VERSION=9, notcurses (master) now builds fine 😄

@tuxillo
Copy link
Member

tuxillo commented Jan 12, 2021

We have two options here: Wait for the next notcurses release and the update of the devel/notcurses port. Or we try to apply your change to the current notcurses version in port which is 2.1.3.

@dankamongmen
Copy link
Author

i think i can cut a release tomorrow evening with these fixes present; that's probably the cleanest solution. FreeBSD has 2.1.4 btw; i understand DPorts more or less pulls changes from there regularly?

@tuxillo
Copy link
Member

tuxillo commented Jan 17, 2021

Yes, we synchronize with FreeBSD Ports around 10 times a year.

@dankamongmen
Copy link
Author

Yes, we synchronize with FreeBSD Ports around 10 times a year.

cool. Well, 2.1.5 went into FreeBSD Ports this morning, so it's ready when you are! =] thanks a lot for all your help, everyone.

@tuxillo
Copy link
Member

tuxillo commented Jun 26, 2022

Current version in DFly: notcurses-3.0.7 TUI library for modern terminal emulators

@tuxillo tuxillo closed this as completed Jun 26, 2022
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

No branches or pull requests

3 participants