contour-terminal / contour

Modern C++ Terminal Emulator
http://contour-terminal.org/
Apache License 2.0
2.3k stars 100 forks source link

add OpenBSD support #1548

Open jg1uaa opened 5 days ago

jg1uaa commented 5 days ago

Description

add OpenBSD support, as described in the title.

Motivation and Context

Simply I want to use Contour-terminal on OpenBSD. I have to test sj3 (Japanese Kana-Kanji converter) tty client with status-line capable terminal emulator, and I found contour.

How Has This Been Tested?

Tested with OpenBSD-current/amd64 and libunicode/boxed-cpp (by private ports).

To check changes are not harm for other platforms, I also build modified code on Void Linux. Both OpenBSD and Void Linux could not support Qt6. Only Qt5 works.

Checklist:

Go over all the following points, and put an x in all the boxes that apply.

If you're unsure about any of these, don't hesitate to ask. We're here to help!

well, it is not the time to put 'x' in all the boxes yet. CONTRIBUTING.md is 404, early to add OpenBSD support to documents, and test method is simply "pass the compile" or not.

christianparpart commented 5 days ago

Wow. This is awesome! Manyh thanks, @jg1uaa for your very valuable contribution. I will have a closer look ASAP. :)

Yaraslaut commented 5 days ago

Hi @jg1uaa As you can see from actions: this changed breaking some other platform, the reason being is that libxcb installed separately and not as a part of X11, so you need to distinguish between openbsd and all other os, you can do something like this:

if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
    set(OPENBSD TRUE)
endif()

and then

        if(NOT(WIN32) AND NOT(APPLE) AND NOT(OPENBSD))
            target_link_libraries(contour Qt5::X11Extras xcb)
        endif()
        if(OPENBSD)
            target_link_libraries(contour Qt5::X11Extras X11::xcb)
        endif()
Yaraslaut commented 5 days ago

Also, if you want us to keep an eye on openbsd builds you can add openbsd github action using: https://github.com/vmactions/openbsd-vm And we already have one for freeBSD https://github.com/contour-terminal/contour/blob/4c71d0cce2e63a23859a1cf7b389dc9e872384a1/.github/workflows/build.yml#L288-L321

jg1uaa commented 3 days ago

I am planning to use libunicode and boxed-cpp as OpenBSD-ports and today I posted them. https://marc.info/?l=openbsd-ports&m=171961710727187&w=2 https://marc.info/?l=openbsd-ports&m=171961232324802&w=2

If they are added to ports (and released with new revision, OpenBSD-7.6), build.yml and install-deps.sh can be fixed.

christianparpart commented 2 days ago

@jg1uaa May thanks.

I think there's not much left.

Would you mind adding a changelog entry to metainfo.xml? Because that's actually a good thing worth mentioning. For example at around:

https://github.com/contour-terminal/contour/blob/4c71d0cce2e63a23859a1cf7b389dc9e872384a1/metainfo.xml#L107-L112

And secondly, would you mind adding the bits for ensuring we keep building on openBSD by adding it to build.yml? It is probably best done by somebody who knows openBSD best. We really value this contribution. I think it's best preserved by making sure we retain support in the future as good as it would work today :)