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

Compiling and running on Termux (Android) #68

Closed
ha5dzs opened this issue Nov 16, 2021 · 6 comments
Closed

Compiling and running on Termux (Android) #68

ha5dzs opened this issue Nov 16, 2021 · 6 comments
Assignees

Comments

@ha5dzs
Copy link

ha5dzs commented Nov 16, 2021

Hi,

I have been using twin on my old laptop, and I thought it would be a good idea to install it on my android device too.

I am using a recent version of Termux, with all the up-to-date libraries. twin compiles fine after setting the ac_default_prefix variable to /data/data/com.termux/files/usr/local. I didn't change anything else, I just followed the steps on the tutorial.
However, when I try to run it on my android device, I am getting the following output:

$ twin
WARNING: linker: /data/data/com.termux/files/usr/twin: unsupported flags DT_FLAGS_1=0x8000001
WARNING: linker: /data/data/com.termux/files/usr/twin_server: unsupported flags DT_FLAGS_1=0x8000001

..then it tries to load the various display driver modules. After each of them fails, it falls back to hw_tty, and I get the following error:

twin: unable to load display driver module `hw_tty' :
      dlopen failed: cannot locate symbol "Errstr" referenced by "/data/data/com.termux/files/usr/lib/twin/libhw_tty-0.9.1.so"

After this line, twin gives up and terminates.

I am not sure, but I think this may have something to do with not having ldconfig on Android. My compiler is clang version 13.0.0.

Can you give me any pointers on how to sort this out? Hopefully I just have a library missing...

Z

@Mirppc
Copy link

Mirppc commented Nov 16, 2021

The only tip i could give is not to try, there are missing dependencies in the termux repo last i tried.

@cosmos72
Copy link
Owner

cosmos72 commented Nov 16, 2021

I have not been able to compile twin on Termux - and not for lack of attempts.

On the other hand, I managed to compile and run twin on UserLand running debian, but can I only recommend it if you have a very large tablet - or external mouse and keyboard. Otherwise it's almost unusable from a small(ish) Android device.

If you want to use it as a server on Android, and attaching it to a larger display somewhere else, then of course the screen size on Android is not a factor :)

@ha5dzs
Copy link
Author

ha5dzs commented Nov 16, 2021

I am using a Gemini PDA I bought from Planet Computers, which has a physical keyboard. The advantage of Termux is that you can configure the terminal interface, and you literally can pinch-zoom it to increase font size, and it resizes the terminal window dynamically. It can be useful when I want to copy and paste some output, and I can zoom out to have small letters if I want to see some logs or files being updated.

I managed to compile twin without any issues, I only had to install a couple of libraries, it only took me a couple of swings in the configure-make-make-install loop. It was so easy I can't even remember anything special about it! :) The entire 'system' is Debian-esque, and most things are working out of the box, minus the hardware management. I even have Midnight Commander installed. Everything works in this little isolated environment, kind of like chroot.

I have not been able to look at your code in detail yet, but can you tell me if this 'Errstr' thing is something you created internally? If not, and it should be in some library, I can try installing that library (or a different version of that library) and see if it works.

@cosmos72
Copy link
Owner

Good to hear that :)
Yes, Errstr is a function defined in one of the Twin sources.

@ha5dzs
Copy link
Author

ha5dzs commented Nov 16, 2021

OK, will try to have a look.

@cosmos72 cosmos72 self-assigned this Sep 5, 2022
@cosmos72
Copy link
Owner

cosmos72 commented Sep 7, 2022

Fixed in commit 91ad986: compiling and running twin inside Termux now works.

At Termux prompt, you need to run:

apt update
apt install git build-essential ncurses
git clone https://github.com/cosmos72/twin
cd twin
./configure --prefix=/data/data/com.termux/files/usr
make
make install-strip
twin

Known issues:

  • Termux keyboard does not have a "Pause" button - you need a customized $HOME/.twinrc that uses a different key to open the menu
  • --hw=tty driver does not yet recognize the "mouse" (touchscreen actually)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants