addpkg(main/schilytools): 2024-03-21
-
Fixes https://github.com/termux/termux-packages/issues/7465
-
More commonly historically known as "cdrtools" or "cdrecord"
-
Former upstream location 1: https://sourceforge.net/projects/cdrtools/
-
Former upstream location 2: https://sourceforge.net/projects/schilytools/
-
Current upstream location: https://codeberg.org/schilytools/schilytools
-
Repology for former name/primary subpackage name: https://repology.org/project/cdrtools/versions
-
Repology for the current name: https://repology.org/project/schilytools/versions
-
Build script and patches partially derived from:
- the FreeBSD package https://github.com/freebsd/freebsd-ports/tree/main/devel/schilybase
- and the Arch Linux package https://gitlab.archlinux.org/archlinux/packaging/packages/cdrtools
- plus a large amount of scratch-made additional adjustments for Termux
Example: burn a .iso to a real CD-RW using real bare metal Android-x86
-
Android-x86 ROM tested: https://sourceforge.net/projects/blissos-x86/files/Official/BlissOS16/FOSS/Generic/Bliss-v16.9.7-x86_64-OFFICIAL-foss-20241011.iso/download
-
Burned
.isotested on CD-RW: https://dl-cdn.alpinelinux.org/alpine/v3.22/releases/x86_64/alpine-standard-3.22.2-x86_64.iso -
Hardware tested:
- ASUS K53SV REV 2.3 laptop motherboard https://www.aliexpress.us/item/3256807794284548.html
- Intel Core i7-2630QM https://www.intel.com/content/www/us/en/products/sku/52219/intel-core-i72630qm-processor-6m-cache-up-to-2-90-ghz/specifications.html
- HP GUD1N slimline SATA DVD-RW drive https://www.amazon.com/Burner-Writer-Drive-SATA-GUD1N/dp/B07DW51717
- Memorex 700MB 12X CD-RW https://www.amazon.com/Memorex-700MB-80-Minute-CD-RW-10-Pack/dp/B000067VC5
Tip
Work around old version of KernelSU in BlissOS version 16.9.7 if necessary
to get root in fully-up-to-date Termux in BlissOS version 16.9.7, first grant Termux root permission in KernelSU app, then unset LD_PRELOAD, then launch a new bash session, then directly invoke /system/bin/su (with absolute path), then set LD_PRELOAD again
unset LD_PRELOAD
bash
/system/bin/su
export LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec-ld-preload.so
# open tray and insert CD-RW
cdrecord -eject
# erase CD-RW
cdrecord -blank=fast
# burn .iso to CD-RW
cdrecord alpine-standard-3.22.2-x86_64.iso
Closes #666
@TomJo2000 (this is WIP and an attempt, not a final package yet. It is a fork of the current tur-on-device package)
- https://github.com/termux-user-repository/tur/pull/2063
Hi thanks for the PR and project history explanation.
I don't have any objections to packaging this current iteration of schillytools.
My prior objection in https://github.com/termux/termux-packages/pull/26979#issuecomment-3436806345 was specifically about packaging a dead branch of this project.
The current Codeberg iteration of the project fulfills all applicable packaging criteria.
I am currently encountering some issues. I found that some tools are dynamically generated during compilation, but this part uses a cross-compiler. They should be compiled using the host's compiler because they are only used at compile time.
Pull request overview
This PR adds the schilytools package (version 2024-03-21), a comprehensive collection of utilities from Jörg Schilling, historically known as "cdrtools" or "cdrecord". The package includes multiple subpackages for various tools including CD/DVD recording utilities, shells, archiving tools, and development utilities.
- Addition of main schilytools package with extensive cross-compilation configuration
- Multiple subpackages organized by functionality (cdrtools, star, bosh shell, sccs, etc.)
- Extensive patching to adapt upstream code for Termux compatibility, including renaming conflicts and fixing Android-specific issues
Reviewed changes
Copilot reviewed 68 out of 68 changed files in this pull request and generated 8 comments.
File Description build.sh Main build script with configuration and installation logic *.subpackage.sh Subpackage definitions for organizing tools into logical groups *.patch Patches for Android compatibility, renaming conflicts, and bug fixes termux-ved-fixes.patch Fixes for the ved text editor including path and buffer size adjustments 💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Please consider disabling Copilot PR reviews in your account settings.
At least for this repository.
https://github.com/settings/copilot/coding_agent
It adds a huge amount of noise to reviewing PRs and there is no method for us to disable it at a repo or org level.
I am currently encountering some issues. I found that some tools are dynamically generated during compilation, but this part uses a cross-compiler. They should be compiled using the host's compiler because they are only used at compile time.
Yes, this part is very difficult. In case you did not find it yet, there is official documentation of cross-compiling for Android here:
https://codeberg.org/schilytools/schilytools/src/commit/e835e64f0d84a614b3c8d619ac646060ea6922a5/README.compile#L638-L754
Unfortunately, even when I tried to follow the steps given in the documentation, I was still not able to get it to work and I didn't know what to do, but it might still be helpful for you if you haven't seen it yet.
OK, I has been change the settings.
I am currently encountering some issues. I found that some tools are dynamically generated during compilation, but this part uses a cross-compiler. They should be compiled using the host's compiler because they are only used at compile time.
Yes, this part is very difficult. In case you did not find it yet, there is official documentation of cross-compiling for Android here:
https://codeberg.org/schilytools/schilytools/src/commit/e835e64f0d84a614b3c8d619ac646060ea6922a5/README.compile#L638-L754
Unfortunately, even when I tried to follow the steps given in the documentation, I was still not able to get it to work and I didn't know what to do, but it might still be helpful for you if you haven't seen it yet.
I previously managed to get smake to use the host's compiler to compile, but smake still compiles some other tools when it runs. Before that, I couldn't intervene in the compilation because the dependencies hadn't been generated yet.
creating xconfig.h
==> MAKING "all" ON SUBCOMPONENT ".../align_test.mk"
==> MAKING DIRECTORY "OBJ/x86_64-linux-clang"
==> MAKING DIRECTORY "OBJ/x86_64-linux-clang/man"
==> MAKING DEPENDENCIES "OBJ/x86_64-linux-clang/align_test.d"
==> MAKING DEPENDENCIES "OBJ/x86_64-linux-clang/align_test.d"
==> COMPILING "OBJ/x86_64-linux-clang/align_test.o"
align_test.c:196:1: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C23 [-Wdeprecated-non-prototype]
196 | main(ac, av)
| ^
align_test.c:712:1: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C23 [-Wdeprecated-non-prototype]
712 | used(i)
| ^
2 warnings generated.
==> LINKING "OBJ/x86_64-linux-clang/align_test"
==> GENERATING include file "../incs/x86_64-linux-clang/align.h"
sh: 2: OBJ/x86_64-linux-clang/align_test: Exec format error
sh: 3: OBJ/x86_64-linux-clang/align_test: Exec format error
real_smake: *** Code 126 (Required key not available) from command line for target '../incs/x86_64-linux-clang/align.h'.
real_smake: The following command caused the error:
echo " ==> GENERATING include file \"../incs/x86_64-linux-clang/align.h\""; \
OBJ/x86_64-linux-clang/align_test > ../incs/x86_64-linux-clang/align.h || \
OBJ/x86_64-linux-clang/align_test > ../incs/x86_64-linux-clang/align.h
real_smake: Couldn't make 'all'.
real_smake: Leaving '/home/builder/.termux-build/schilytools/src/psmake/real_smake'[2] from directory '/home/builder/.termux-build/schilytools/src/inc'
real_smake: Default commandline target: 'all'
real_smake: Doing exit(1)
real_smake: *** Code 1 (Operation not permitted) from command line for target 'all'.
real_smake: The following command caused the error:
for MK in align_test.mk avoffset.mk ; \
do \
( \
if [ -r ./$MK ] ; then \
echo " ==> MAKING \"all\" ON SUBCOMPONENT \".../$MK\""; "/home/builder/.termux-build/schilytools/src/psmake/real_smake" -f $MK XARCH=x86_64-linux-clang all;\
else \
echo "NOTICE: Partial source (.../$MK) missing";\
fi \
); \
done
real_smake: Couldn't make 'all'.
real_smake: Leaving '/home/builder/.termux-build/schilytools/src/psmake/real_smake'[1] from directory '/home/builder/.termux-build/schilytools/src/inc'
@robertkirkman I'm here to give an update on my progress. Currently, I can correctly compile smake on the host machine, but I've encountered some issues with rule files generation. I will resolve them as soon as possible, even though I've been trying for a week. If you're willing, could you help me?
Here is the logs.
Checking for working bootstrap make...
Smake release 1.7 2023/11/22 (x86_64-pc-linux-gnu)
Copyright (C) 1985, 87, 88, 91, 1995-2021 J�rg Schilling
(C) 2022-2023 the schilytools team
...sh conf/cc-config.sh clang cc incs/Dcc.aarch64-linux
Trying to find clang
Found clang
Making clang the default compiler in 'incs/Dcc.aarch64-linux'
==> MAKING DIRECTORY "incs/aarch64-linux-clang/Inull"
==> MAKING DIRECTORY "libs/aarch64-linux-clang"
==> CONFIGURING RULES "incs/aarch64-linux-clang/rules.cnf"
creating cache ./config.cache
checking host system type... x86_64-pc-linux-gnu
checking if sh is bash... no
checking if /bin/sh is bash... no
checking whether sh -ce is broken... no
checking whether /bin/sh -ce is broken... no
checking whether /bin/bosh is a working shell... no
checking whether /opt/schily/bin/bosh is a working shell... no
checking for cc... aarch64-linux-android-clang
checking for gcc... (cached) aarch64-linux-android-clang
checking whether the C compiler (aarch64-linux-android-clang -O -fstack-protector-strong -Oz -L../../libs/aarch64-linux-clang -L/data/data/com.termux/files/usr/lib -Wl,-R/data/data/com.termux/files/usr/lib -Wl,-R/data/data/com.termux/files/usr/lib) works... yes
checking whether the C compiler (aarch64-linux-android-clang -O -fstack-protector-strong -Oz -L../../libs/aarch64-linux-clang -L/data/data/com.termux/files/usr/lib -Wl,-R/data/data/com.termux/files/usr/lib -Wl,-R/data/data/com.termux/files/usr/lib) is a cross-compiler... yes
checking whether we are using GNU C... yes
CONFIG_RMTHOST=host or CONFIG_RMTHOST=user@host required for remote execution
checking whether aarch64-linux-android-clang accepts -g... yes
smake: *** Code 1 (Operation not permitted) from command line for target 'incs/aarch64-linux-clang/rules.cnf'.
smake: The following command caused the error:
echo " ==> CONFIGURING RULES \"incs/aarch64-linux-clang/rules.cnf\""; /bin/rm -f incs/aarch64-linux-clang/rules.cnf incs/aarch64-linux-clang/xconfig.h; (cd incs/aarch64-linux-clang; CONFIG_NOFAIL=TRUE CC="aarch64-linux-android-clang" CFLAGS=" -O -fstack-protector-strong -Oz " CXXFLAGS=" -Wall -Wno-unknown-pragmas -Wshadow -Wmissing-prototypes -Wstrict-prototypes -Wno-deprecated-register -O -fstack-protector-strong -Oz" CPPFLAGS=" -D_GNU_SOURCE " LDFLAGS="-L../../libs/aarch64-linux-clang -L/data/data/com.termux/files/usr/lib -Wl,-R/data/data/com.termux/files/usr/lib -Wl,-R/data/data/com.termux/files/usr/lib" CONFIG_SHELL=/bin/sh /bin/sh ../../autoconf/configure ); ([ -d ./inc ] && cd ./inc && /home/builder/.termux-build/schilytools/src/./psmake/smake || :)
smake: No such file or directory. Can not open 'incs/aarch64-linux-clang/rules.cnf'.
Error: Process completed with exit code 2.
CONFIG_RMTHOST=host or CONFIG_RMTHOST=user@host required for remote execution
@xingguangcuican6666 yes, I can tell you something that will progress slightly farther beyond this error.
It is this:
export CONFIG_RMTHOST=host
Then, after that, the next error will be this:
sh: 2: OBJ/aarch64-linux-clang/avoffset: Exec format error
unfortunately, once you reach the error sh: 2: OBJ/aarch64-linux-clang/avoffset: Exec format error, you will have gone pretty much as far as I ever reached.
I tried many things to bypass the error sh: 2: OBJ/aarch64-linux-clang/avoffset: Exec format error, but everything I tried failed with more errors except for tur-on-device, which was the only way I was able to figure out how to bypass that error.
Good luck with it! I hope you can figure out some way.
Okay, thank you very much for your help, I will continue to fix it.