-
Notifications
You must be signed in to change notification settings - Fork 25
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
SUGGESTION: Streamline the cross compile from linux #46
Comments
The cmd script is for my personal use. The only reason why it exists is that MSYS2 has no multilib environment - the MINGW32 shell can build i686 programs, and the MINGW64 shell can only build x86_64 program due to lack of 32-bit libraries. I think I can try fixing the sh for use on my Linux Mint. |
The master branch has been updated and should build fine for |
Yes, I have just tested those two modified files |
No, native builds are still preferred to cross builds. |
Updated a little more. The 64-bit build now links against UCRT instead of MSVCRT and works fluently with UTF-8 text now. The 32-bit build is being held back as there is no UCRT32 environment in MSYS2. |
I don't have any problem compiling for Win32 and Win64 with UTF-8 enabled in any Debian Linux distro (Ubuntu, Mint, etc). Maybe you missed sone flags. I have edited the first post to resemble those I am using. Actually, my approach uses nano and ncurses from git with minimal changes. That way, for instance, I don't need to patch ncurses at all. I have taken some of your code approach in my script. You can also improve yours. Look at this script: xbuild-4-win.sh. I am now fighting with the github actions to automate the generation as soon as ncurses or nano gits are updated. |
See this https://lists.gnu.org/archive/html/bug-ncurses/2023-01/msg00025.html. Also please notice UTF-8 never works with MSVCRT.
If you don't patch ncurses (at least at this moment we speak), |
I don't think Ubuntu (or Mint) has UCRT toolchains at this moment.
Some key combinations might not work in PDCurses, e.g. |
I´ve seen that getwch() or getwchar() from conio.h or wchar.h doesn´t work in windows. It is a wider issue as, for instance, micro editor, written in go, has the same problem in windows with UTF-8. |
Some test results about UTF-8 inputs in UTF-8 consoles:
|
UTF-8 works relatively fine when using PDCursesMod — the active development fork of PDCurses. The included demos look very promising. it can handle truecolor on screen and can use the windows clipboard. This is a screenshot of a UTF-8 text file viewer using PDCursesMod: Nano can be built using PDCursesMod without any problem, however, it has the same problem displaying UTF-8 data. This is Nano using PDCursesMod opening the same sample text document: So, maybe, the route to make nano UTF-8 ready in Windows is through PDCursesMod. Note I am using the same toolchain — Debian mingw-w64 package — in both cases, cross-building from Linux and using Windows Terminal for executing the binary. So, it is not a problem with mingw-w64. So, the problem is in ncurses or nano code, or in how they work together. |
In order to get UTF-8 support I think you will have to link against UCRT. |
Nope, I did it using the very same toolchain cross-building to Windows under Linux, I got UTF'8 working using PDCursesMod. Just see the improvements compared to the last pic above using the same test txt file: I also made the mouse work, and window resizing, more or less, works. Now I am working on integrating the windows clipboard to easily copy and paste to-from other apps. It is clear that the way forward for a successful windows port is by using PDCursesMod. |
That sounds really great! Does Alt-Delete (delete current line or selection) work for you? |
That depends on the terminal. I don´t have problems using Windows Terminal. Alt+Bksp deletes word by word as default using space as separator. I can program delete line in .nanorc. Actually I have that function assigned to CTRL+D. Just add this:
|
It is weird having a cmd file and a shell script when all can be done in linux way faster, even from WSL.
In any Ubuntu just prepare the required packages with:
sudo -E apt update && sudo apt upgrade -y sudo -E apt install -y autoconf automake autopoint gcc mingw-w64 gettext git groff make pkg-config texinfo p7zip-full
And then replace the contents of
build_nano-win.sh
with this:Then the
build_package.sh
could be as simple as:#!/bin/bash -e ./build_nano-win.sh x86_64 ./build_nano-win.sh i686 ./package_nano-win.sh
Or you can just integrate the first two lines into
package_nano-win.sh
removing the need to create that third file.package_nano-win.sh
would be this:Consider replacing the slow MSYS2 with a standard ubuntu image that can be easily converted into a GitHub Action.
My two cents. Thanks for the project.
The text was updated successfully, but these errors were encountered: