termux / termux-x11

Termux X11 add-on application.
https://termux.dev
GNU General Public License v3.0
1.96k stars 301 forks source link

How do I compile this myself? #354

Closed Dr4kzor closed 1 year ago

Dr4kzor commented 1 year ago

Hi, so I want to compile the apk but since graddle was updated I can't seem to get android studio to compile it correclty again (I manually changed graddle to 7.4 and the apk is generated but crashes right on start, same version as latest release and the official one works fine).

I would like to do this because I was using a custom change to update the mouse cursor position as you hover a stylus, also added UI button to force normal click to be replaced with left,middle and right click. The stylus hover feature is really nice to work with graphical applications like Aseprite allowing to see the preview of click location drawing animation before actually pressing.

If anyone could tell me how to setup the compile env to build master brach as is would be nice :)

twaik commented 1 year ago

Why does it crash? Post a stacktrace...

Dr4kzor commented 1 year ago

So this is what is displayed when I run build inside AndroidStudio Flamingo (fresh instrall inside a fresh Linux installation), this time I cant even generate the Apk

``` /home/ricardo/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=aarch64-none-linux-android26 --sysroot=/home/ricardo/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/sysroot -I/home/ricardo/termux-x11_edited/termux-x11/app/src/main/cpp/pixman -I/home/ricardo/termux-x11_edited/termux-x11/app/.cxx/Debug/g1m6f6l2/arm64-v8a -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -O2 -g -DNDEBUG -fPIC -DHAVE_BUILTIN_CLZ=1 -DHAVE_PTHREADS=1 -DPACKAGE=\"pixman\" -DTLS=__thread -DSIZEOF_LONG=8 -DUSE_OPENMP=1 -DUSE_ARM_A64_NEON=1 -fno-integrated-as -B /usr/aarch64-linux-gnu/bin -std=gnu11 -MD -MT CMakeFiles/pixman.dir/pixman/pixman/pixman-x86.c.o -MF CMakeFiles/pixman.dir/pixman/pixman/pixman-x86.c.o.d -o CMakeFiles/pixman.dir/pixman/pixman/pixman-x86.c.o -c /home/ricardo/termux-x11_edited/termux-x11/app/src/main/cpp/pixman/pixman/pixman-x86.c clang: error: assembler command failed with exit code 1 (use -v to see invocation) [2/1051] Building C object CMakeFiles/pixman.dir/pixman/pixman/pixman-mips.c.o FAILED: CMakeFiles/pixman.dir/pixman/pixman/pixman-mips.c.o ```

I checked and the files are present, also the original pixmal project from github compiles fine

twaik commented 1 year ago

You must use external as from binutils-* package. For Ubuntu/Debian it is contained in packages binutils-aarch64-linux-gnu binutils-arm-linux-gnueabihf.

Dr4kzor commented 1 year ago

You must use external as from binutils-* package. For Ubuntu/Debian it is contained in packages binutils-aarch64-linux-gnu binutils-arm-linux-gnueabihf.

Sadly I don't know how to change this option.

However, I got it to compile the armv8 version, my changes where on AndroidStudio side. Tools -> SDKmanager -> AndroidSDK -> SDKTools in NDK version activate both 25.29519653 and 25.1.893793 my android SDK build tools include 34.0.0 , 33.0.2 and 30.0.3.

After these changes I was able to compille and run sucessfully the armv8 apk builder...

Is there a recomended configuration for the android "SDK tools" tab?

twaik commented 1 year ago

Sadly I don't know how to change this option.

You do not need to change it. Just install needed packages. NDK's as does not fit for building pixman so I do not use it.