Repository: AndronixApp/termux-packages Branch: master Commit: c39b1d040990 Files: 2305 Total size: 3.6 MB Directory structure: gitextract_8s_13j_i/ ├── .cirrus.yml ├── .github/ │ └── main.workflow ├── .gitignore ├── LICENSE.md ├── README.md ├── build-all.sh ├── build-package.sh ├── clean.sh ├── disabled-packages/ │ ├── abuild/ │ │ ├── Makefile.patch │ │ ├── abuild-fetch.c.patch │ │ ├── abuild-keygen.in.patch │ │ ├── abuild-rmtemp.c.patch │ │ ├── abuild-sign.in.patch │ │ ├── abuild.conf.patch │ │ ├── abuild.in.patch │ │ ├── build.sh │ │ ├── checkapk.in.patch │ │ ├── functions.sh.in.patch │ │ └── sample.APKBUILD.patch │ ├── alsa-lib/ │ │ ├── alsa-conf-dir.patch │ │ ├── build.sh │ │ ├── pcm_direct.c.patch │ │ ├── pcm_mmap.c.patch.old │ │ └── versionsort.patch │ ├── alsa-plugins/ │ │ ├── asound.conf │ │ └── build.sh │ ├── alsa-utils/ │ │ ├── build.sh │ │ ├── configure.patch │ │ └── volume_mapping.c.patch │ ├── ant/ │ │ ├── ant │ │ └── build.sh │ ├── apk-tools/ │ │ ├── Make.rules.patch │ │ ├── Makefile.patch │ │ ├── build.sh │ │ ├── libfetch-http.c.patch │ │ ├── src-apk.c.patch │ │ ├── src-archive.c.patch │ │ ├── src-commit.c.patch │ │ ├── src-database.c.patch │ │ ├── src-io.c.patch │ │ ├── src-package.c.patch │ │ └── src-termux_prefix.h.patch │ ├── apt-updated/ │ │ ├── CMakeLists.txt.patch │ │ ├── apt-pkg-contrib-fileutl.patch │ │ ├── apt-pkg-contrib-srvrec.cc.patch │ │ ├── apt-pkg-contrib-strutl.cc.patch │ │ ├── apt-pkg-deb-debrecords.cc.patch │ │ ├── apt-pkg-init-dir.patch │ │ ├── apt-private-private-download.cc.patch │ │ ├── build.sh │ │ ├── cmdline-apt-key.in.patch │ │ ├── cmndline-no-strchrnul.patch │ │ ├── debsrcrecords.patch │ │ ├── methods-cmakelist.patch │ │ ├── methods-connect.cc.patch │ │ ├── private-output-no-langinfo.patch │ │ ├── trusted.gpg │ │ └── vendor.patch │ ├── cadaver/ │ │ └── build.sh │ ├── checkinstall/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ ├── checkinstall.patch │ │ ├── checkinstallrc-dist.patch │ │ ├── installwatch-Makefile.patch │ │ └── installwatch.c.patch │ ├── clisp/ │ │ ├── build.sh │ │ ├── src-gllib-stdint.in.h.patch │ │ └── src-makefile.in.patch │ ├── crawl/ │ │ └── build.sh │ ├── cups/ │ │ ├── build.sh │ │ ├── cups-thread.c.patch │ │ ├── file.c.patch │ │ └── lockf.cpp.patch │ ├── d8/ │ │ ├── build.sh │ │ └── d8 │ ├── deborphan/ │ │ ├── build.sh │ │ ├── configure.patch │ │ ├── errno.patch │ │ ├── src-Makefile.in.patch │ │ ├── src-deborphan.c.patch │ │ └── src-pkginfo.c.patch │ ├── dovecot/ │ │ ├── build.sh │ │ ├── configure.patch │ │ └── src-lib-connection.h.patch │ ├── easy-rsa/ │ │ └── build.sh │ ├── ghc/ │ │ ├── bitcast.patch │ │ ├── build.sh │ │ ├── compiler-llvmGen-LlvmCodeGen-Ppr.hs.patch │ │ ├── compiler-main-DriverPipeline.hs.patch │ │ └── configure.patch │ ├── groff/ │ │ └── build.sh │ ├── gst-libav/ │ │ └── build.sh │ ├── gst123/ │ │ └── build.sh │ ├── guile/ │ │ └── build.sh │ ├── javac/ │ │ ├── build.sh │ │ └── javac │ ├── libfakechroot/ │ │ └── build.sh │ ├── libffi-updated/ │ │ └── build.sh │ ├── libjemalloc/ │ │ └── build.sh │ ├── libressl/ │ │ └── build.sh │ ├── lrzsz/ │ │ ├── build.sh │ │ └── src-Makefile.in.patch │ ├── man-db/ │ │ └── build.sh │ ├── mono/ │ │ ├── build.sh │ │ ├── complex.h │ │ ├── math_private.h │ │ └── tkill.patch │ ├── ocaml/ │ │ └── build.sh │ ├── openjdk-9-jre-headless/ │ │ ├── build.sh │ │ ├── build_ldflags.patch │ │ ├── elfFile.hpp.patch │ │ ├── generated-configure.sh.patch │ │ ├── getgr_r.patch │ │ ├── hotspot-jvm_home.patch │ │ ├── jdk-java_home.patch │ │ ├── libpthread.patch │ │ ├── openjdk-9-jdk-headless.subpackage.sh │ │ ├── openjdk-9-source.subpackage.sh │ │ ├── osName.patch │ │ ├── os_linux_aarch64.cpp.patch │ │ └── sendfile64.patch │ ├── openvpn/ │ │ ├── build.sh │ │ ├── configure.ac.patch.old │ │ ├── netbsd_getpass.c │ │ ├── src-openvpn-console_builtin.c.patch │ │ ├── src-openvpn-tun.c.patch │ │ └── termux-openvpn │ ├── pacman/ │ │ ├── build.sh │ │ ├── ensure-matching-database-and-package-version.patch │ │ ├── makepkg.conf │ │ ├── pacman.conf │ │ └── pacman.patch │ ├── pkgconf/ │ │ └── build.sh │ ├── premake/ │ │ ├── build-gmake.unix-Premake4.make.patch │ │ └── build.sh │ ├── sbcl/ │ │ ├── build.sh │ │ └── make-config.sh.patch │ ├── sslscan/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ └── sslscan.c.patch │ ├── tf/ │ │ └── build.sh │ ├── toybox/ │ │ └── build.sh │ └── unnethack/ │ ├── build.sh │ ├── dat_town_wildcard.patch │ └── dont_delete_makedefs.patch ├── generate-bootstraps.sh ├── ndk-patches/ │ ├── asm-generic-termbits.h.patch │ ├── bits-struct_file.h.patch │ ├── grp.h.patch │ ├── ifaddrs.h │ ├── langinfo.h │ ├── langinfo.h.patch │ ├── libintl.h │ ├── linux-fcntl.h.patch │ ├── paths.h.patch │ ├── pwd.h.patch │ ├── stdio.h.patch │ ├── stdlib.h.patch │ ├── sys-cdefs.h.patch │ ├── sys-wait.h.patch │ ├── syslog.patch │ └── unistd.h.patch ├── packages/ │ ├── aapt/ │ │ ├── aapt-Main.cpp.patch.txt │ │ ├── build.sh │ │ ├── libbase-patch.txt │ │ ├── libcutils-patch.txt │ │ ├── libziparchive.patch.txt │ │ └── log.h.patch.txt │ ├── abduco/ │ │ └── build.sh │ ├── abook/ │ │ ├── build.sh │ │ ├── database.h.patch │ │ └── filter.c.patch │ ├── ack-grep/ │ │ └── build.sh │ ├── acr/ │ │ ├── build.sh │ │ └── no_dev-stderr.patch │ ├── algernon/ │ │ ├── build.sh │ │ └── fix-hardcoded-paths.patch │ ├── alpine/ │ │ ├── build.sh │ │ ├── configure.patch │ │ ├── env_unix.c.patch │ │ ├── fdstring.c.patch │ │ ├── imap-src-osdep-unix-Makefile.patch │ │ ├── imapmkf.patch │ │ ├── mlockmake.patch │ │ ├── mtest.c.patch │ │ ├── os_lnx.c.patch │ │ ├── os_lnx.h.patch │ │ ├── pine.conf │ │ └── pw_stuff.c.patch │ ├── antiword/ │ │ ├── Makefile.Linux.patch │ │ ├── antiword.h.patch │ │ └── build.sh │ ├── apache2/ │ │ ├── Termux.layout │ │ ├── build-instdso.sh.patch │ │ ├── build.sh │ │ └── configure.patch │ ├── apg/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ └── install-sh.patch │ ├── apksigner/ │ │ └── build.sh │ ├── apr/ │ │ ├── Makefile.in.patch │ │ └── build.sh │ ├── apr-util/ │ │ └── build.sh │ ├── apt/ │ │ ├── 0000-cmake-fix.patch │ │ ├── 0001-hardcoded-paths-fix.patch │ │ ├── 0002-glob.patch │ │ ├── 0003-langinfo-and-codeset.patch │ │ ├── 0004-srv-records.patch │ │ ├── 0005-http2-fix.patch │ │ ├── 0006-apt-key-nonroot.patch │ │ ├── 0007-termux-apt-vendor.patch │ │ ├── 0008-apt-init.patch │ │ ├── 0009-fix-macro-redefinition.patch │ │ ├── 0010-prevent-usage-as-root.patch │ │ ├── apt-ftparchive.subpackage.sh │ │ ├── apt-transport-tor.subpackage.sh │ │ ├── build.sh │ │ ├── man/ │ │ │ ├── man5/ │ │ │ │ ├── apt.conf.5 │ │ │ │ ├── apt_preferences.5 │ │ │ │ └── sources.list.5 │ │ │ └── man8/ │ │ │ ├── apt-cache.8 │ │ │ ├── apt-config.8 │ │ │ ├── apt-get.8 │ │ │ ├── apt-key.8 │ │ │ ├── apt-mark.8 │ │ │ ├── apt-secure.8 │ │ │ └── apt.8 │ │ └── trusted.gpg │ ├── aptly/ │ │ ├── Makefile.patch │ │ └── build.sh │ ├── argp/ │ │ ├── argp-fmtstream.h.patch │ │ └── build.sh │ ├── aria2/ │ │ └── build.sh │ ├── arj/ │ │ ├── 001_arches_align.patch │ │ ├── 002_no_remove_static_const.patch │ │ ├── 003_64_bit_clean.patch │ │ ├── 004_parallel_build.patch │ │ ├── 005_use_system_strnlen.patch │ │ ├── 006_use_safe_strcpy.patch │ │ ├── build.sh │ │ ├── doc_refer_robert_k_jung.patch │ │ ├── gnu_build_fix.patch │ │ ├── gnu_build_flags.patch │ │ ├── gnu_build_pie.patch │ │ ├── gnu_build_strip.patch │ │ ├── hurd_no_fcntl_getlk.patch │ │ ├── integr.patch │ │ ├── mode.patch │ │ ├── out-of-bounds-read.patch │ │ ├── security-afl.patch │ │ ├── security-traversal-dir.patch │ │ ├── security-traversal-symlink.patch │ │ ├── security_format.patch │ │ ├── self_integrity_64bit.patch │ │ └── z_cross_compile.patch │ ├── asciidoc/ │ │ └── build.sh │ ├── asciinema/ │ │ ├── asciinema-__main__.py.patch │ │ └── build.sh │ ├── assimp/ │ │ ├── build.sh │ │ └── test-CMakeLists.txt.patch │ ├── atomicparsley/ │ │ └── build.sh │ ├── attr/ │ │ ├── build.sh │ │ ├── tools-attr.c.patch │ │ └── walk_tree.c.patch │ ├── autoconf/ │ │ ├── General.pm.patch │ │ └── build.sh │ ├── automake/ │ │ └── build.sh │ ├── autossh/ │ │ └── build.sh │ ├── axel/ │ │ └── build.sh │ ├── babl/ │ │ ├── babl-meson.build.patch │ │ ├── build.sh │ │ ├── tests-meson.build.patch │ │ └── tools-meson.build.patch │ ├── barcode/ │ │ └── build.sh │ ├── bash/ │ │ ├── build.sh │ │ ├── config-top.h.patch │ │ ├── error.c.patch │ │ ├── etc-bash.bashrc │ │ ├── etc-profile │ │ ├── lib-malloc-stats.c.patch │ │ ├── lib-malloc-table.c.patch │ │ ├── lib-malloc-trace.c.patch │ │ ├── lib-readline-complete.c.patch │ │ ├── lib-readline-rlconf.h.patch │ │ ├── lib-readline-util.c.patch │ │ ├── lib-sh-tmpfile.c.patch │ │ ├── pathnames.h.in.patch │ │ └── shell.c.patch │ ├── bash-completion/ │ │ ├── build.sh │ │ └── completions-man.patch │ ├── bat/ │ │ └── build.sh │ ├── bc/ │ │ └── build.sh │ ├── beanshell/ │ │ └── build.sh │ ├── binutils/ │ │ ├── binutils-gold.subpackage.sh │ │ ├── binutils.patch │ │ ├── build.sh │ │ ├── dirsearch.cc.patch │ │ ├── ld-emultempl-elf32.em.patch │ │ ├── ldd │ │ ├── native_lib_dirs.patch32 │ │ ├── native_lib_dirs.patch64 │ │ ├── options.cc.patch32 │ │ └── options.cc.patch64 │ ├── bison/ │ │ └── build.sh │ ├── bitcoin/ │ │ ├── 0001-android-patches.patch │ │ ├── build-aux-m4-ax_boost_thread.m4.patch │ │ └── build.sh │ ├── blogc/ │ │ ├── build.sh │ │ └── termux-prefix.patch │ ├── bmon/ │ │ ├── build.sh │ │ └── config.h.patch │ ├── boost/ │ │ ├── bootstrap.sh.patch │ │ ├── build.sh │ │ ├── python.jam.patch │ │ └── tools-build-src-tools-common.jam.patch │ ├── brotli/ │ │ ├── CMakeLists.txt.patch │ │ └── build.sh │ ├── build-essential/ │ │ └── build.sh │ ├── busybox/ │ │ ├── 0000-use-clang.patch │ │ ├── 0001-clang-fix.patch │ │ ├── 0002-hardcoded-paths-fix.patch │ │ ├── 0003-strchrnul-fix.patch │ │ ├── 0004-missing-syscalls.patch │ │ ├── 0005-no-change-identity.patch │ │ ├── 0006-no-crypt.h.patch │ │ ├── 0007-miscutils-crond.patch │ │ ├── 0008-miscutils-crontab.patch │ │ ├── 0009-networking-ftpd-no-chroot.patch │ │ ├── 0010-networking-httpd-default-port.patch │ │ ├── 0011-networking-telnetd-default-port.patch │ │ ├── 0012-networking-tftp-no-chroot.patch │ │ ├── build.sh │ │ └── busybox.config │ ├── bvi/ │ │ ├── Makefile.in.patch │ │ ├── build.sh │ │ ├── column_number_bugfix.patch │ │ └── comm.c.patch │ ├── byobu/ │ │ ├── build.sh │ │ └── usr-bin-byobu.in.patch │ ├── c-ares/ │ │ ├── build.sh │ │ ├── disable-ares-android.patch │ │ └── fix-path-etc-hosts.patch │ ├── c-toxcore/ │ │ └── build.sh │ ├── ca-certificates/ │ │ ├── build.sh │ │ └── ca-certificates-java.subpackage.sh │ ├── cabextract/ │ │ └── build.sh │ ├── caddy/ │ │ └── build.sh │ ├── calcurse/ │ │ ├── build.sh │ │ ├── io.c.patch │ │ ├── src-notify.c.patch │ │ └── src-ui-calendar.c.patch │ ├── capstone/ │ │ └── build.sh │ ├── cava/ │ │ ├── Makefile.am.patch │ │ ├── build.sh │ │ ├── config.c.patch │ │ └── configure.ac.patch │ ├── cboard/ │ │ ├── build.sh │ │ ├── configure.patch │ │ └── libchess-pgn.c.patch │ ├── ccache/ │ │ └── build.sh │ ├── ccnet/ │ │ ├── build.sh │ │ └── configure.ac.patch │ ├── ccrypt/ │ │ └── build.sh │ ├── cgdb/ │ │ ├── build.sh │ │ └── cgdb.cpp.patch │ ├── chromaprint/ │ │ └── build.sh │ ├── clamav/ │ │ ├── build.sh │ │ ├── clamd.conf.in │ │ ├── configure.patch │ │ ├── fix-hardcoded-paths.patch │ │ ├── freshclam.conf.in │ │ └── no-lutimes.patch │ ├── cmake/ │ │ ├── Modules-CMakeDetermineSystem.cmake.patch │ │ ├── Modules-Platform-Android-Clang.cmake.patch │ │ ├── Modules-Platform-Android-Determine-Compiler.cmake.patch │ │ ├── Modules-Platform-Android-Determine.cmake.patch │ │ ├── Modules-Platform-Android-Initialize.cmake.patch │ │ ├── Modules-Platform-Android.cmake.patch │ │ ├── Source-CMakeLists.txt.patch │ │ ├── Source-cmExecProgramCommand.cxx.patch │ │ ├── Source-cmLocalUnixMakefileGenerator3.cxx.patch │ │ ├── Source-cmStateSnapshot.cxx.patch │ │ ├── build.sh │ │ └── cmake-curses-gui.subpackage.sh │ ├── cmark/ │ │ └── build.sh │ ├── cmatrix/ │ │ └── build.sh │ ├── cmus/ │ │ ├── build.sh │ │ ├── checks.patch │ │ └── configure.patch │ ├── cmusfm/ │ │ └── build.sh │ ├── codecrypt/ │ │ ├── autogen.sh.patch │ │ ├── build.sh │ │ └── getpass.patch │ ├── colordiff/ │ │ ├── Makefile.patch │ │ └── build.sh │ ├── command-not-found/ │ │ └── build.sh │ ├── coreutils/ │ │ ├── build.sh │ │ ├── configure.patch │ │ ├── fix-paths.patch │ │ ├── nohup.c.patch │ │ ├── pwd.c.patch │ │ ├── src-ls.c.patch │ │ └── tests/ │ │ └── tails-c-flag.sh │ ├── corkscrew/ │ │ ├── build.sh │ │ └── corkscrew.1 │ ├── cowsay/ │ │ ├── build.sh │ │ └── install.sh.patch │ ├── cpio/ │ │ └── build.sh │ ├── cppi/ │ │ └── build.sh │ ├── crunch/ │ │ ├── Makefile.patch │ │ └── build.sh │ ├── cryptopp/ │ │ ├── build.sh │ │ ├── cpu.cpp.patch │ │ └── fix-lib-symlinks.patch │ ├── cscope/ │ │ ├── build.sh │ │ ├── errno.patch │ │ └── src-main.c.patch │ ├── ctags/ │ │ ├── build.sh │ │ └── configure.ac.patch │ ├── cvs/ │ │ ├── build.sh │ │ └── src-log.c.patch │ ├── daemonize/ │ │ ├── build.sh │ │ └── daemonize.c.patch │ ├── darkhttpd/ │ │ ├── Makefile.patch │ │ └── build.sh │ ├── dart/ │ │ ├── build.sh │ │ ├── dart-pub-bin.sh │ │ ├── fix-shell-path.patch │ │ └── sdk-runtime-bin-directory_android.cc.patch │ ├── dash/ │ │ ├── build.sh │ │ ├── etc-profile.patch │ │ ├── mktokens.patch │ │ └── src-var.c.patch │ ├── dasm/ │ │ └── build.sh │ ├── datamash/ │ │ └── build.sh │ ├── dcraw/ │ │ ├── build.sh │ │ └── swab.c │ ├── ddrescue/ │ │ ├── build.sh │ │ └── fix-configure.patch │ ├── debianutils/ │ │ ├── add-shell.patch │ │ ├── build.sh │ │ └── remove-shell.patch │ ├── debootstrap/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ ├── debootstrap.patch │ │ ├── fix-keyring-paths.patch │ │ ├── functions.patch │ │ └── scripts-debian-common.patch │ ├── deutex/ │ │ └── build.sh │ ├── dialog/ │ │ ├── build.sh │ │ └── configure.patch │ ├── dictd/ │ │ ├── build.sh │ │ └── dictd.patch │ ├── diffutils/ │ │ └── build.sh │ ├── direnv/ │ │ └── build.sh │ ├── direvent/ │ │ ├── build.sh │ │ └── preproc.c.patch │ ├── diskus/ │ │ └── build.sh │ ├── dnsutils/ │ │ ├── bin-delv-delv.c.patch │ │ ├── build.sh │ │ ├── lib-irs-context.c.patch │ │ └── lib-isc-pthreads-thread.c.patch │ ├── docbook-xml/ │ │ └── build.sh │ ├── docbook-xsl/ │ │ ├── 765567_non-recursive_string_subst.patch │ │ └── build.sh │ ├── dos2unix/ │ │ ├── Makefile.patch │ │ └── build.sh │ ├── double-conversion/ │ │ └── build.sh │ ├── doxygen/ │ │ ├── build.sh │ │ └── doxyparse.cpp.patch │ ├── dpkg/ │ │ ├── build.sh │ │ ├── configure.patch │ │ ├── dbmodify_dont_require_root.patch │ │ ├── extract.c.patch │ │ ├── lib-dpkg-atomic-file.c.patch │ │ ├── lib-dpkg-dpkg.h.patch │ │ ├── lib-dpkg-path-remove.c.patch │ │ ├── lib-dpkg-triglib.c.patch │ │ ├── src-archives.c.patch │ │ ├── src-configure.c.patch │ │ ├── src-help.c.patch │ │ └── src-statcmd.c.patch │ ├── dropbear/ │ │ ├── Makefile.in.patch │ │ ├── build.sh │ │ ├── common-session.c.patch │ │ ├── compat.c.patch │ │ ├── default_options.h.patch │ │ ├── gensignkey.c.patch │ │ ├── sshpty.c.patch │ │ ├── svr-agentfwd.c.patch │ │ ├── svr-auth.c.patch │ │ ├── svr-authpasswd.c.patch │ │ ├── svr-chansession.c.patch │ │ └── sysoptions.h.patch │ ├── dtc/ │ │ └── build.sh │ ├── dte/ │ │ └── build.sh │ ├── duc/ │ │ ├── build.sh │ │ └── cmd-ls.c.patch │ ├── dvtm/ │ │ ├── build.sh │ │ ├── fix-fifo-path.patch │ │ └── vt.c.patch │ ├── dx/ │ │ ├── build.sh │ │ └── dx │ ├── e2fsprogs/ │ │ ├── build.sh │ │ ├── clang-compat.patch │ │ ├── doc-Makefile.in.patch │ │ ├── fix-hardcoded-paths.patch │ │ ├── fsmap.h.patch │ │ └── hasmntopt.patch │ ├── ecj/ │ │ ├── build.sh │ │ ├── ecj │ │ └── ecj-24 │ ├── ed/ │ │ ├── build.sh │ │ └── configure.patch │ ├── elinks/ │ │ ├── build.sh │ │ └── elinks-fix-paths.patch │ ├── elixir/ │ │ └── build.sh │ ├── emacs/ │ │ ├── build.sh │ │ ├── lib-src-emacsclient.c.patch │ │ ├── lisp-cus-start.el.patch.beforehostbuild │ │ ├── lisp-loadup.el-2.patch.beforehostbuild │ │ ├── lisp-net-tramp.el.patch.beforehostbuild │ │ ├── lisp-server.el.patch.beforehostbuild │ │ ├── lisp-subr.el.patch.beforehostbuild │ │ ├── lisp-term.el.patch.beforehostbuild │ │ ├── lisp-textmodes-ispell.el.patch.beforehostbuild │ │ ├── no_user_fullname.patch │ │ ├── site-init.el │ │ ├── src-callproc.c.patch │ │ ├── src-filelock.c.patch │ │ └── src-keyboard.c.patch │ ├── erlang/ │ │ ├── build.sh │ │ ├── erts-emulator-Makefile.in.patch │ │ └── prefix.patch │ ├── espeak/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ └── compat-stdint.h.patch │ ├── exa/ │ │ ├── build.sh │ │ └── src-output-table.rs.patch │ ├── exiftool/ │ │ └── build.sh │ ├── exiv2/ │ │ ├── build.sh │ │ └── exiv2json.cpp.patch │ ├── expect/ │ │ ├── Makefile.in.patch │ │ ├── build.sh │ │ └── configure.in.patch │ ├── fakeroot/ │ │ ├── build.sh │ │ ├── fakeroot-1.23_faked.c.patch │ │ ├── fakeroot-1.23_libfakeroot.c.patch │ │ └── fakeroot-1.23_scripts_fakeroot.in.patch │ ├── fasd/ │ │ └── build.sh │ ├── fastmod/ │ │ ├── build.sh │ │ └── vi-as-default-editor.patch │ ├── fbless/ │ │ └── build.sh │ ├── fcgi/ │ │ └── build.sh │ ├── fcgiwrap/ │ │ ├── build.sh │ │ └── fix-kill-parameters.patch │ ├── fd/ │ │ ├── Cargo.toml.patch │ │ ├── build.sh │ │ └── src-main.rs.patch │ ├── fdupes/ │ │ └── build.sh │ ├── ffmpeg/ │ │ ├── build.sh │ │ └── libavutil-file_open.c.patch │ ├── ffsend/ │ │ └── build.sh │ ├── fftw/ │ │ ├── build.sh │ │ └── fix-wisdom_dir.patch │ ├── figlet/ │ │ ├── build.sh │ │ ├── figlet.c.patch │ │ └── makefile.patch │ ├── file/ │ │ ├── build.sh │ │ └── fix-paths.patch │ ├── finch/ │ │ ├── arpa/ │ │ │ ├── nameser.h │ │ │ └── nameser_compat.h │ │ ├── bonjour-makefile.patch │ │ ├── build.sh │ │ ├── configure.patch │ │ ├── dont-build-nullclient-example.patch │ │ ├── gg-makefile.patch │ │ ├── irc-makefile.patch │ │ ├── jabber-makefile.patch │ │ ├── libgnt-gntmain.c.patch │ │ ├── oscar-makefile.patch │ │ ├── sametime-makefile.patch │ │ ├── silc-makefile.patch │ │ ├── silc10-makefile.patch │ │ ├── simple-makefile.patch │ │ └── ssl-makefile.patch │ ├── findutils/ │ │ ├── build.sh │ │ ├── configure.patch │ │ ├── find-parser.c.patch │ │ └── gl-lib-mountlist.c.patch │ ├── fish/ │ │ ├── build.sh │ │ ├── create_manpage_completions.py.patch │ │ ├── share-functions-__fish_print_help.fish.patch │ │ ├── src-env.cpp.patch │ │ ├── src-fish.cpp.patch │ │ └── src-wutil.cpp.patch │ ├── flex/ │ │ ├── Makefile.in.patch │ │ └── build.sh │ ├── fontconfig/ │ │ ├── build.sh │ │ ├── fcatomic.c.patch │ │ └── fontconfig-utils.subpackage.sh │ ├── fortune/ │ │ ├── build.sh │ │ └── fortune.c.patch │ ├── fossil/ │ │ ├── build.sh │ │ ├── src-main.c.patch │ │ ├── src-popen.c.patch │ │ └── src-user.c.patch │ ├── freetype/ │ │ └── build.sh │ ├── fribidi/ │ │ └── build.sh │ ├── frobtads/ │ │ ├── build.sh │ │ └── no_asprintf.patch │ ├── fsmon/ │ │ └── build.sh │ ├── fwknop/ │ │ └── build.sh │ ├── fzf/ │ │ ├── bin-fzf-tmux.patch │ │ └── build.sh │ ├── game-repo/ │ │ └── build.sh │ ├── gawk/ │ │ ├── build.sh │ │ ├── io.c.patch │ │ ├── main.c.patch │ │ ├── no_pw_gecos.patch │ │ └── stack_index.patch │ ├── gbt/ │ │ └── build.sh │ ├── gcal/ │ │ └── build.sh │ ├── gdb/ │ │ ├── archive_c_st_mtime.patch │ │ ├── build.sh │ │ ├── fix-tmp_prefix.patch │ │ ├── gdb-amd64-linux-nat.c.patch │ │ ├── gdb-cli-cli-cmds.c.patch │ │ ├── gdb-common-job-control.c.patch │ │ ├── gdb-common-pathstuff.c.patch │ │ ├── gdb-common-signals-state-save-restore.c.patch │ │ ├── gdb-gdbserver-configure.patch │ │ ├── gdb-gnulib-import-string.in.h.patch │ │ ├── gdb-ser-pipe.c.patch │ │ ├── gdb-solib.c.patch │ │ ├── gregset.h.patch │ │ ├── linux_thread_db_no_th_unique.patch │ │ ├── readline-histlib.h.patch.debug │ │ └── readline.patch │ ├── gdbm/ │ │ ├── build.sh │ │ └── termios_h.patch │ ├── gdk-pixbuf/ │ │ └── build.sh │ ├── gegl/ │ │ ├── 6bcf95fd0f32cf5e8b1ddbe17b14d9ad049bded8.patch │ │ └── build.sh │ ├── geoip2-database/ │ │ └── build.sh │ ├── getconf/ │ │ └── build.sh │ ├── geth/ │ │ ├── build.sh │ │ ├── fix-names-conflict.patch │ │ └── geth-utils.subpackage.sh │ ├── getmail/ │ │ ├── build.sh │ │ └── utilities.py.patch │ ├── gettext/ │ │ ├── build.sh │ │ ├── gnulib-libmakefile.am.patch │ │ └── msginit.c.patch │ ├── gflags/ │ │ └── build.sh │ ├── ghostscript/ │ │ ├── arch-aarch64.h │ │ ├── arch-arm.h │ │ ├── arch-i686.h │ │ ├── arch-x86_64.h │ │ ├── build.sh │ │ ├── configure.patch │ │ └── gserrors.h.patch │ ├── giflib/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ └── giflib-utils.subpackage.sh │ ├── gifsicle/ │ │ └── build.sh │ ├── git/ │ │ ├── build.sh │ │ ├── config.c.patch │ │ ├── config.mak.uname.patch │ │ ├── disable_daemon_syslog.patch │ │ ├── git.patch │ │ ├── help.c.patch │ │ ├── run-command.c.patch │ │ └── tempfile.c.patch │ ├── git-crypt/ │ │ └── build.sh │ ├── git-lfs/ │ │ └── build.sh │ ├── gitea/ │ │ ├── app.ini │ │ ├── build.sh │ │ └── gitea-service.sh │ ├── gkermit/ │ │ ├── build.sh │ │ └── makefile.patch │ ├── glib/ │ │ ├── build.sh │ │ ├── fix-hardcoded-paths.patch │ │ ├── glib-bin.subpackage.sh │ │ ├── glib-gspawn.c.patch │ │ ├── glib-gtimezone.c.patch │ │ ├── glib-gutils.c.patch │ │ └── meson.build.patch │ ├── global/ │ │ ├── build.sh │ │ ├── echo-path.patch │ │ └── libutil-makepath.c.patch │ ├── gmic/ │ │ ├── CImg.h.patch │ │ ├── Makefile.patch │ │ ├── build.sh │ │ └── gmic-gm.subpackage.sh │ ├── gnuchess/ │ │ ├── build.sh │ │ ├── components.cc.patch │ │ └── main.cc.patch │ ├── gnuit/ │ │ ├── build.sh │ │ ├── system.c.patch │ │ └── tilde.c-history.c.patch.debug │ ├── gnupg/ │ │ ├── agent-agent.h.patch │ │ ├── build.sh │ │ ├── common-dotlock.c.patch │ │ ├── configure.patch │ │ ├── fix-paths.patch │ │ └── gpgv.subpackage.sh │ ├── gnuplot/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ ├── plot.c.patch │ │ └── src-command.c.patch │ ├── go-findimagedupes/ │ │ └── build.sh │ ├── goaccess/ │ │ ├── Makefile.in.patch │ │ ├── build.sh │ │ ├── configure.patch │ │ ├── tcbtdb.h.patch │ │ └── websocket.h.patch │ ├── golang/ │ │ ├── build.sh │ │ ├── golang-doc.subpackage.sh │ │ ├── src-os-file_unix.go.patch │ │ ├── src-runtime-cgo-cgo.go.patch │ │ └── src-runtime-cgo-gcc_android.c.patch │ ├── google-glog/ │ │ └── build.sh │ ├── googletest/ │ │ └── build.sh │ ├── gotty/ │ │ └── build.sh │ ├── gperf/ │ │ ├── build.sh │ │ └── output.cc.patch │ ├── gpgme/ │ │ └── build.sh │ ├── gpsbabel/ │ │ └── build.sh │ ├── graphicsmagick/ │ │ └── build.sh │ ├── graphviz/ │ │ ├── add-libcommon-to-gc.patch │ │ ├── build.sh │ │ ├── cmd-edgepaint-Makefile.in.patch │ │ ├── configure.patch │ │ ├── no-configure-dot-plugins.patch │ │ ├── no-mkdefs.patch │ │ └── sfdpgen-free.patch │ ├── grep/ │ │ └── build.sh │ ├── gsl/ │ │ └── build.sh │ ├── gst-plugins-bad/ │ │ └── build.sh │ ├── gst-plugins-base/ │ │ └── build.sh │ ├── gst-plugins-good/ │ │ ├── autoplug_libcaca.patch │ │ └── build.sh │ ├── gst-plugins-ugly/ │ │ └── build.sh │ ├── gstreamer/ │ │ └── build.sh │ ├── gtypist/ │ │ ├── build.sh │ │ ├── dont_build_manpage.patch │ │ ├── src-cursmenu.c.patch │ │ ├── src-gtypist.c.patch │ │ └── src-utf8.c.patch │ ├── gumbo-parser/ │ │ └── build.sh │ ├── gzip/ │ │ ├── build.sh │ │ ├── fix-gzexe.patch │ │ ├── lib-stdio-impl.h.patch │ │ ├── zdiff.in.patch │ │ └── zgrep.in.patch │ ├── harfbuzz/ │ │ ├── build.sh │ │ ├── harfbuzz-icu.subpackage.sh │ │ └── harfbuzz-utils.subpackage.sh │ ├── hashdeep/ │ │ ├── PRIu_PRId.patch │ │ ├── build.sh │ │ ├── configure.ac.patch │ │ └── hash.patch │ ├── help2man/ │ │ └── build.sh │ ├── hexcurse/ │ │ ├── build.sh │ │ └── hexcurse.c.patch │ ├── hexedit/ │ │ └── build.sh │ ├── hexyl/ │ │ └── build.sh │ ├── heyu/ │ │ └── build.sh │ ├── hfsutils/ │ │ ├── build.sh │ │ ├── lfs.patch │ │ └── replace_hardlink_with_symlink.patch │ ├── hiptext/ │ │ ├── artiste.cc.patch │ │ ├── build.sh │ │ ├── font.cc.patch │ │ └── movie.cc.patch │ ├── hoedown/ │ │ ├── Makefile.patch │ │ └── build.sh │ ├── htop/ │ │ ├── build.sh │ │ └── fix-missing-macros.patch │ ├── httping/ │ │ ├── build.sh │ │ ├── fix-spam_file-path.patch │ │ └── mssl.c.patch │ ├── httrack/ │ │ ├── build.sh │ │ ├── htsglobal.h.patch │ │ └── store.c.patch │ ├── hub/ │ │ ├── build.sh │ │ └── utils-utils.go.patch │ ├── hugo/ │ │ └── build.sh │ ├── hunspell/ │ │ ├── build.sh │ │ ├── fix-hardcoded-paths.patch │ │ └── src-tools-hunspell.cxx.patch │ ├── hunspell-en-us/ │ │ └── build.sh │ ├── hunspell-ru/ │ │ └── build.sh │ ├── hydra/ │ │ ├── build.sh │ │ └── hydra.c.patch │ ├── hyperfine/ │ │ └── build.sh │ ├── icecast/ │ │ ├── build.sh │ │ └── thread.c.patch │ ├── imagemagick/ │ │ └── build.sh │ ├── imgflo/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ ├── env.sh.in.patch │ │ └── library.c.patch │ ├── imlib2/ │ │ ├── build.sh │ │ ├── imlib2-1.5.1_src_bin_imlib2_show.c.patch │ │ ├── imlib2-1.5.1_src_lib_ximage.c.patch │ │ ├── imlib2-1.5.1_src_modules_loaders_loader_bz2.c.patch │ │ ├── imlib2-1.5.1_src_modules_loaders_loader_id3.c.patch │ │ ├── imlib2-1.5.1_src_modules_loaders_loader_xpm.c.patch │ │ └── imlib2-1.5.1_src_modules_loaders_loader_zlib.c.patch │ ├── indent/ │ │ ├── Makefile.in.patch │ │ ├── build.sh │ │ └── code_io.c.patch │ ├── inetutils/ │ │ ├── build.sh │ │ ├── configure-pthreads-no-weak.patch │ │ ├── ftp-getpass.patch │ │ ├── ftpd.c.patch │ │ ├── if_index.c.patch │ │ └── utmp_logout.c.patch │ ├── inotify-tools/ │ │ ├── build.sh │ │ └── src-Makefile.am.patch │ ├── ipcalc/ │ │ └── build.sh │ ├── iperf3/ │ │ ├── build.sh │ │ ├── main_Makefile.in.patch │ │ └── src-iperf_api.c.patch │ ├── ipfs/ │ │ ├── build.sh │ │ └── go-ipfs-0.4.15_bin_dist_get.patch │ ├── ipmitool/ │ │ ├── build.sh │ │ ├── index-strchr.patch │ │ └── openssl-1.1.patch │ ├── ired/ │ │ └── build.sh │ ├── irssi/ │ │ ├── build.sh │ │ └── fix-paths.patch │ ├── isync/ │ │ ├── build.sh │ │ └── isync.patch │ ├── iverilog/ │ │ ├── Makefile.in.patch │ │ ├── build.sh │ │ ├── driver-main.c.patch │ │ └── vvp-Makefile.in.patch │ ├── jbig2dec/ │ │ └── build.sh │ ├── jhead/ │ │ └── build.sh │ ├── joe/ │ │ ├── build.sh │ │ ├── do_not_build_utils.patch │ │ ├── fix_errno.patch │ │ └── no_getpwent.patch │ ├── jp2a/ │ │ └── build.sh │ ├── jq/ │ │ └── build.sh │ ├── json-c/ │ │ └── build.sh │ ├── json-glib/ │ │ └── build.sh │ ├── jsoncpp/ │ │ └── build.sh │ ├── jupp/ │ │ └── build.sh │ ├── kakoune/ │ │ ├── build.sh │ │ └── src-cs-path-compat.patch │ ├── keybase/ │ │ ├── build.sh │ │ └── go-libkb-env.go.patch │ ├── keystone/ │ │ └── build.sh │ ├── kona/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ ├── getline_android.c.patch │ │ ├── src-0.c.patch │ │ ├── src-bswap.c.patch │ │ ├── src-getline.h.patch │ │ ├── src-kn.c.patch │ │ ├── src-p.c.patch │ │ └── src-v.h.patch │ ├── krb5/ │ │ ├── build.sh │ │ ├── config-files-kdc.conf.patch │ │ ├── include-osconf.hin.patch │ │ ├── krb5-config_LDFLAGS.patch │ │ ├── netbsd_getpass.c │ │ ├── plugins-kdb-db2.patch │ │ └── sethostent.patch │ ├── kubectl/ │ │ └── build.sh │ ├── ldc/ │ │ ├── build.sh │ │ ├── ldc-readme.patch │ │ ├── ldc-x64-sprintf.patch │ │ └── tests/ │ │ └── hello_world.sh │ ├── ldns/ │ │ ├── build.sh │ │ ├── fix-hardcoded-paths.patch │ │ └── keys.c.patch │ ├── ledger/ │ │ └── build.sh │ ├── leptonica/ │ │ ├── build.sh │ │ ├── silence-tmpfile-warnings.patch │ │ └── src-recogbasic.c.patch │ ├── less/ │ │ ├── build.sh │ │ ├── configure.patch │ │ └── less_multilib.patch │ ├── leveldb/ │ │ └── build.sh │ ├── lftp/ │ │ ├── build.sh │ │ ├── lftp_ssl.cc.patch │ │ ├── lib-vasnprintf.c.patch │ │ ├── src-Filter.cc.patch │ │ ├── src-PtyShell.cc.patch │ │ ├── src-SysCmdJob.cc.patch │ │ └── src-commands.cc.patch │ ├── lhasa/ │ │ └── build.sh │ ├── libandroid-glob/ │ │ ├── build.sh │ │ ├── glob.c │ │ └── glob.h │ ├── libandroid-shmem/ │ │ └── build.sh │ ├── libandroid-spawn/ │ │ ├── build.sh │ │ ├── posix_spawn.cpp │ │ └── posix_spawn.h │ ├── libandroid-support/ │ │ └── build.sh │ ├── libao/ │ │ ├── ao_private.h.patch │ │ ├── ao_pulse.c.patch │ │ ├── build.sh │ │ └── configure.ac.patch │ ├── libarchive/ │ │ ├── archive.h.patch │ │ ├── archive_entry.h.patch │ │ ├── archive_string.c.patch │ │ ├── archive_util.c.patch │ │ ├── archive_write_disk_posix.c.patch │ │ ├── archive_write_set_format_zip.c.patch │ │ ├── bsdtar.subpackage.sh │ │ └── build.sh │ ├── libass/ │ │ └── build.sh │ ├── libassuan/ │ │ └── build.sh │ ├── libbsd/ │ │ ├── build.sh │ │ ├── endian.h.patch │ │ ├── funopen.c.patch │ │ ├── local-elf.h.patch │ │ └── nlist.c.patch │ ├── libbz2/ │ │ ├── build.sh │ │ ├── bzdiff.patch │ │ ├── bzip2.subpackage.sh │ │ ├── cross_compile.patch │ │ └── shared_library.patch │ ├── libc++/ │ │ └── build.sh │ ├── libcaca/ │ │ └── build.sh │ ├── libcairo/ │ │ ├── android-shmem.patch │ │ ├── build.sh │ │ ├── cairo-script-operators.c.patch │ │ └── fdr.c.patch │ ├── libcap/ │ │ ├── build.sh │ │ ├── libcap-makefile.patch │ │ └── progs-capsh.patch │ ├── libcln/ │ │ ├── build.sh │ │ ├── revert_configure_tests.patch │ │ ├── src-base-low-cl_low_div.cc.patch │ │ └── src-base-low-cl_low_mul.cc.patch │ ├── libcoap/ │ │ └── build.sh │ ├── libconfig/ │ │ └── build.sh │ ├── libconfuse/ │ │ └── build.sh │ ├── libcroco/ │ │ └── build.sh │ ├── libcrypt/ │ │ ├── build.sh │ │ ├── crypt.h │ │ └── crypt3.c │ ├── libcue/ │ │ └── build.sh │ ├── libcurl/ │ │ ├── build.sh │ │ └── curl.subpackage.sh │ ├── libdav1d/ │ │ └── build.sh │ ├── libdb/ │ │ ├── build.sh │ │ ├── db.subpackage.sh │ │ ├── fix-tmpdir.patch │ │ ├── lang-sql-generated-sqlite3.c.patch │ │ └── lang-sql-sqlite-src-os_unix.c.patch │ ├── libdispatch/ │ │ ├── build.sh │ │ └── src-CMakeLists.txt.patch │ ├── libduktape/ │ │ ├── build.sh │ │ └── duktape.subpackage.sh │ ├── libedit/ │ │ ├── build.sh │ │ ├── src-readline.c.patch │ │ └── src-vi.c.patch │ ├── libelf/ │ │ ├── aligned_alloc.c │ │ ├── build.sh │ │ ├── dwfl_error.c.patch │ │ ├── elf_getarsym.c.patch │ │ ├── elf_update.c.patch │ │ ├── error.h │ │ ├── lib-color.c.patch │ │ ├── libdwflP.h.patch │ │ ├── libelfmakefile.am.patch │ │ ├── obstack.h │ │ ├── qsort_r.h │ │ ├── ranlib.c.patch │ │ ├── src-readelf.c.patch │ │ ├── stdio_ext.h │ │ ├── strings.c.patch │ │ ├── strip.c.patch │ │ └── unstrip.c.patch │ ├── libev/ │ │ ├── Makefile.in.patch │ │ └── build.sh │ ├── libevent/ │ │ ├── build.sh │ │ ├── evdns.c.patch │ │ ├── evutil.c.patch │ │ └── evutil_rand.c.patch │ ├── libexif/ │ │ └── build.sh │ ├── libexpat/ │ │ └── build.sh │ ├── libffi/ │ │ └── build.sh │ ├── libflac/ │ │ ├── build.sh │ │ └── flac.subpackage.sh │ ├── libgc/ │ │ ├── build.sh │ │ └── include-private-gcconfig.h.patch │ ├── libgcrypt/ │ │ ├── build.sh │ │ └── fix-hardcoded-paths.patch │ ├── libgd/ │ │ └── build.sh │ ├── libgfshare/ │ │ └── build.sh │ ├── libgit2/ │ │ ├── build.sh │ │ └── fix-etc-dir-path.patch │ ├── libgmime/ │ │ ├── build.sh │ │ └── iconv-detect.h.patch │ ├── libgmp/ │ │ └── build.sh │ ├── libgnutls/ │ │ ├── build.sh │ │ └── gnutls.subpackage.sh │ ├── libgpg-error/ │ │ ├── atexit.patch │ │ ├── build.sh │ │ ├── gawk5.0-support.patch │ │ └── lock-obj-pub.aarch64-unknown-linux-android.h │ ├── libgraphite/ │ │ ├── CMakeLists.txt.patch │ │ ├── build.sh │ │ └── src-CMakeLists.txt.patch │ ├── libgrpc/ │ │ ├── CMakeLists.txt.diff │ │ ├── CMakeLists.txt.patch │ │ ├── Makefile.patch │ │ ├── build.sh │ │ ├── fix-arg-list-too-long.patch.beforehostbuild │ │ ├── log_android.cc.patch │ │ └── src-core-lib-grpc-wrap_memcpy.cc.patch │ ├── libgsasl/ │ │ └── build.sh │ ├── libical/ │ │ ├── CMakeLists.txt.patch │ │ ├── build.sh │ │ └── src-libical-CMakeLists.txt.patch │ ├── libiconv/ │ │ ├── build.sh │ │ └── iconv.subpackage.sh │ ├── libicu/ │ │ ├── build.sh │ │ └── icu-devtools.subpackage.sh │ ├── libid3tag/ │ │ └── build.sh │ ├── libidn/ │ │ └── build.sh │ ├── libidn2/ │ │ └── build.sh │ ├── libisl/ │ │ └── build.sh │ ├── libjansson/ │ │ └── build.sh │ ├── libjasper/ │ │ ├── CMakeLists.txt.patch │ │ ├── build.sh │ │ └── libjasper-utils.subpackage.sh │ ├── libjpeg-turbo/ │ │ ├── build.sh │ │ └── libjpeg-turbo-progs.subpackage.sh │ ├── libksba/ │ │ └── build.sh │ ├── libllvm/ │ │ ├── ORCv2.rst.patch │ │ ├── build.sh │ │ ├── clang.subpackage.sh │ │ ├── cxx-libm.patch │ │ ├── lld.subpackage.sh │ │ ├── llvm-config.in │ │ ├── llvm.subpackage.sh │ │ ├── nl_types.h │ │ ├── nltypes_stubs.cpp │ │ ├── openmp-config-ix-m32.patch │ │ ├── project-openmp-runtime-src-CMakeLists.txt.patch │ │ ├── tools-clang-lib-Driver-ToolChain.cpp.patch │ │ ├── tools-clang-lib-Driver-ToolChains-Gnu.cpp.patch │ │ ├── tools-clang-lib-Driver-ToolChains-Linux.cpp.patch │ │ └── tools-llvm-shlib-CMakeLists.txt.patch │ ├── liblua/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ ├── fix-lua_tmpnametemplate.patch │ │ ├── lua.subpackage.sh │ │ ├── src-Makefile.patch │ │ ├── src-loslib.c.patch │ │ └── src-luaconf.h.patch │ ├── liblua52/ │ │ ├── build.sh │ │ ├── lua-5.2.4_Makefile.patch │ │ ├── lua-5.2.4_src_Makefile.patch │ │ ├── lua-5.2.4_src_loslib.c.patch │ │ ├── lua-5.2.4_src_luaconf.h.patch │ │ ├── lua.pc.in │ │ └── lua52.subpackage.sh │ ├── libluajit/ │ │ ├── build.sh │ │ ├── etc-luajit.pc.patch │ │ ├── luajit.subpackage.sh │ │ └── src-Makefile.patch │ ├── liblz4/ │ │ ├── Makefile.inc.patch │ │ ├── build.sh │ │ └── lz4.subpackage.sh │ ├── liblzma/ │ │ ├── build.sh │ │ ├── configure.patch │ │ └── xz-utils.subpackage.sh │ ├── liblzo/ │ │ └── build.sh │ ├── libmaa/ │ │ ├── build.sh │ │ └── libmaa.patch │ ├── libmad/ │ │ └── build.sh │ ├── libmaxminddb/ │ │ ├── build.sh │ │ └── libmaxminddb-tools.subpackage.sh │ ├── libmcrypt/ │ │ └── build.sh │ ├── libmesode/ │ │ └── build.sh │ ├── libmhash/ │ │ └── build.sh │ ├── libmicrohttpd/ │ │ └── build.sh │ ├── libmnl/ │ │ └── build.sh │ ├── libmosquitto/ │ │ ├── CMakeLists.txt.patch │ │ ├── build.sh │ │ └── mosquitto.subpackage.sh │ ├── libmp3lame/ │ │ ├── build.sh │ │ └── lame.subpackage.sh │ ├── libmp3splt/ │ │ └── build.sh │ ├── libmpc/ │ │ └── build.sh │ ├── libmpdclient/ │ │ └── build.sh │ ├── libmpfr/ │ │ └── build.sh │ ├── libmsgpack/ │ │ └── build.sh │ ├── libnet/ │ │ └── build.sh │ ├── libnettle/ │ │ ├── build.sh │ │ ├── configure.patch │ │ └── nettle.subpackage.sh │ ├── libnfs/ │ │ ├── add-timeh.patch │ │ └── build.sh │ ├── libnftnl/ │ │ └── build.sh │ ├── libnghttp2/ │ │ └── build.sh │ ├── libnl/ │ │ ├── build.sh │ │ ├── include-netlink-private-netlink.h.patch │ │ ├── nf-log.c.patch │ │ ├── nf-monitor.c.patch │ │ ├── nf-queue.c.patch │ │ └── nl-monitor.c.patch │ ├── libnpth/ │ │ └── build.sh │ ├── libogg/ │ │ └── build.sh │ ├── liboggz/ │ │ └── build.sh │ ├── libopus/ │ │ └── build.sh │ ├── libopusenc/ │ │ └── build.sh │ ├── libotr/ │ │ ├── build.sh │ │ └── configure.patch │ ├── libpcap/ │ │ ├── build.sh │ │ └── fix-path-etc-ethers.patch │ ├── libpipeline/ │ │ └── build.sh │ ├── libpixman/ │ │ ├── build.sh │ │ └── pixman-arm.c.patch │ ├── libpng/ │ │ └── build.sh │ ├── libpopt/ │ │ ├── build.sh │ │ └── fix-hardcoded-paths.patch │ ├── libprotobuf/ │ │ ├── build.sh │ │ ├── protobuf.subpackage.sh │ │ └── remove-android-logging.patch │ ├── libprotobuf-c/ │ │ └── build.sh │ ├── libpsl/ │ │ ├── build-fix.patch │ │ └── build.sh │ ├── libqrencode/ │ │ └── build.sh │ ├── librsvg/ │ │ └── build.sh │ ├── librsync/ │ │ ├── build.sh │ │ └── rdiff.subpackage.sh │ ├── libsasl/ │ │ ├── auth_getpwent.c.patch │ │ └── build.sh │ ├── libsearpc/ │ │ ├── build.sh │ │ └── lib-Makefile.am.patch │ ├── libsignal-protocol-c/ │ │ └── build.sh │ ├── libsigsegv/ │ │ └── build.sh │ ├── libsndfile/ │ │ ├── Makefile.am.patch │ │ ├── autogen.sh.patch │ │ ├── build.sh │ │ └── tmpdir.patch │ ├── libsodium/ │ │ └── build.sh │ ├── libsoup/ │ │ └── build.sh │ ├── libsoxr/ │ │ ├── build.sh │ │ └── go.patch │ ├── libsqlite/ │ │ ├── build.sh │ │ ├── sqlite.subpackage.sh │ │ └── sqlite3.c.patch │ ├── libssh/ │ │ ├── build.sh │ │ └── fix-paths.patch │ ├── libssh2/ │ │ └── build.sh │ ├── libtalloc/ │ │ ├── build.sh │ │ ├── lib-replace-wscript.patch │ │ └── wscript.patch │ ├── libtermkey/ │ │ └── build.sh │ ├── libtiff/ │ │ ├── build.sh │ │ └── libtiff-utils.subpackage.sh │ ├── libtool/ │ │ ├── build.sh │ │ └── libltdl.subpackage.sh │ ├── libunibilium/ │ │ └── build.sh │ ├── libunistring/ │ │ └── build.sh │ ├── libusb/ │ │ └── build.sh │ ├── libuuid/ │ │ ├── build.sh │ │ ├── gen_uuid.c.patch │ │ └── uuidP.h.patch │ ├── libuv/ │ │ ├── build.sh │ │ ├── pthread-sigmask.patch │ │ └── src-unix-fs.c.patch │ ├── libvorbis/ │ │ ├── build.sh │ │ └── configure.patch │ ├── libvpx/ │ │ ├── arm_cpudetect-always-neon.patch │ │ ├── build-make-configure.sh.patch │ │ ├── build.sh │ │ └── configure.patch │ ├── libvterm/ │ │ └── build.sh │ ├── libwebp/ │ │ ├── CMakeLists.txt.patch │ │ └── build.sh │ ├── libwebsockets/ │ │ └── build.sh │ ├── libx11/ │ │ ├── build.sh │ │ ├── src-CrGlCur.c.patch │ │ └── src-XlibInt.c.patch │ ├── libx264/ │ │ ├── build.sh │ │ └── x264.subpackage.sh │ ├── libx265/ │ │ ├── build.sh │ │ ├── source-CMakeLists.txt.patch │ │ └── x265.subpackage.sh │ ├── libxapian/ │ │ ├── build.sh │ │ └── xapian-tools.subpackage.sh │ ├── libxau/ │ │ ├── build.sh │ │ └── libXau-1.0.8_AuLock.c.patch │ ├── libxcb/ │ │ ├── build.sh │ │ ├── libxcb-1.12_configure.patch │ │ └── libxcb-1.12_src_xcb_util.c.patch │ ├── libxdmcp/ │ │ └── build.sh │ ├── libxext/ │ │ └── build.sh │ ├── libxft/ │ │ └── build.sh │ ├── libxml2/ │ │ ├── build.sh │ │ ├── fix-catalog-paths.patch │ │ └── libxml2-utils.subpackage.sh │ ├── libxrender/ │ │ └── build.sh │ ├── libxslt/ │ │ ├── build.sh │ │ └── xsltproc.subpackage.sh │ ├── libxss/ │ │ └── build.sh │ ├── libyaml/ │ │ └── build.sh │ ├── libzip/ │ │ └── build.sh │ ├── libzmq/ │ │ └── build.sh │ ├── libzopfli/ │ │ ├── build.sh │ │ └── zopfli.subpackage.sh │ ├── lighttpd/ │ │ └── build.sh │ ├── links/ │ │ ├── build.sh │ │ └── fix-hardcoded-paths.patch │ ├── linux-man-pages/ │ │ └── build.sh │ ├── littlecms/ │ │ ├── build.sh │ │ └── littlecms-utils.subpackage.sh │ ├── llbuild/ │ │ ├── CMakeLists.txt.patch │ │ ├── build.sh │ │ ├── include-llbuild-BuildSystem-BuildSystemFrontend.h.patch │ │ ├── include-llvm-Config-config.h.patch │ │ ├── lib-Basic-PlatformUtility.cpp.patch │ │ ├── lib-llvm-Support-CmakeLists.txt.patch │ │ └── products-llbuild-CMakeLists.txt.patch │ ├── lldb/ │ │ ├── ArchSpec.cpp.patch │ │ ├── Editline.h.patch │ │ ├── LLDBStandalone.cmake.patch │ │ ├── ProcessLauncherPosixFork.cpp.patch │ │ ├── build.sh │ │ └── cmakelists.txt.patch │ ├── lnd/ │ │ └── build.sh │ ├── loksh/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ ├── clock_monotonic.patch │ │ ├── fix-hardcoded-paths.patch │ │ └── no-cs_path.patch │ ├── ltrace/ │ │ ├── build.sh │ │ ├── ltrace-elf.c.patch │ │ └── sysdeps-linux-gnu-proc.c.patch │ ├── lua-lpeg/ │ │ ├── build.sh │ │ └── makefile.patch │ ├── luarocks/ │ │ ├── GNUmakefile.patch │ │ ├── build.sh │ │ ├── configure.patch │ │ ├── lua.lua.patch │ │ ├── src-luarocks-core-cfg.lua.patch │ │ └── unix-tools.lua.patch │ ├── luv/ │ │ ├── CMakeLists.txt.patch │ │ └── build.sh │ ├── lynx/ │ │ ├── build.sh │ │ ├── fix-paths.patch │ │ ├── lynx2.8.9dev.19_WWW_Library_Implementation_www_tcp.h.patch │ │ ├── lynx2.8.9dev.19_src_LYMain.c.patch │ │ └── lynx2.8.9dev.19_userdefs.h.patch │ ├── lzip/ │ │ ├── build.sh │ │ └── configure.patch │ ├── lzlib/ │ │ ├── build.sh │ │ └── configure.patch │ ├── lzop/ │ │ └── build.sh │ ├── m4/ │ │ ├── build.sh │ │ ├── fix-paths.patch │ │ ├── lib-vasnprintf.c.patch │ │ ├── lib-xalloc-oversized.h.patch │ │ └── spawn.patch │ ├── make/ │ │ ├── build.sh │ │ ├── make.patch │ │ └── no-append.patch │ ├── man/ │ │ ├── build.sh │ │ ├── configure.patch │ │ ├── main.c.patch │ │ ├── mandocdb.c.patch │ │ ├── tag.c.patch │ │ └── tag.h.patch │ ├── mariadb/ │ │ ├── CMakeLists.txt.patch │ │ ├── build.sh │ │ ├── client-CMakeLists.txt.patch │ │ ├── client-mysql.cc.patch │ │ ├── cmake-install_layout.cmake.patch │ │ ├── cmake-mariadb_connector_c.cmake.patch.beforehostbuild │ │ ├── cmake-pcre.cmake.patch │ │ ├── cmake-readline.cmake.patch │ │ ├── etc-my.cnf.patch │ │ ├── libmariadb-libmariadb-CMakeLists.txt.patch │ │ ├── scripts-mysql_install_db.sh.patch │ │ └── sql-CMakeLists.txt.patch │ ├── mathomatic/ │ │ ├── build.sh │ │ └── fix-paths.patch │ ├── mbedtls/ │ │ └── build.sh │ ├── mc/ │ │ ├── build.sh │ │ ├── configure.patch │ │ ├── filegui_magics.patch │ │ ├── filemanager_ext.c.patch │ │ ├── lib-shell.c.patch │ │ ├── lib-tty-key.c.patch │ │ ├── lib-tty-tty.c.patch │ │ ├── lib-utilunix.c.patch │ │ ├── lib-widget-input_complete.c.patch │ │ ├── man2hlp.in.patch │ │ ├── src-filemanager-achown.c.patch │ │ ├── src-filemanager-chown.c.patch │ │ ├── src-filemanager-file.c.patch │ │ ├── src-usermenu.c.patch │ │ ├── src-vfs-sfs-sfs.c.patch │ │ ├── tmpdir_default.patch │ │ └── use-python2-for-extfs-helpers.patch │ ├── mdp/ │ │ └── build.sh │ ├── megatools/ │ │ ├── build.sh │ │ └── lib-mega.c.patch │ ├── memcached/ │ │ ├── build.sh │ │ ├── getsubopt.c │ │ ├── getsubopt.h │ │ └── memcached.c.patch │ ├── mg/ │ │ ├── GNUmakefile.patch │ │ └── build.sh │ ├── micro/ │ │ └── build.sh │ ├── mime-support/ │ │ └── build.sh │ ├── minicom/ │ │ ├── build.sh │ │ ├── dial.c.patch │ │ ├── file.c.patch │ │ ├── getdir.c.patch │ │ ├── getdir.h.patch │ │ ├── script.h.patch │ │ └── wkeys.c.patch │ ├── miniupnpc/ │ │ ├── build.sh │ │ ├── miniupnpc-2.1_minissdpc.c.patch │ │ └── miniupnpc-2.1_miniupnpc.c.patch │ ├── mksh/ │ │ ├── build.sh │ │ └── sh.h.patch │ ├── mktorrent/ │ │ ├── build.sh │ │ └── seekdir_telldir.patch │ ├── mlocate/ │ │ ├── build.sh │ │ ├── conf.c.patch │ │ ├── no_getid.patch │ │ ├── src-locate.c.patch │ │ └── updatedb.c.patch │ ├── morse2ascii/ │ │ ├── Makefile.patch │ │ └── build.sh │ ├── mosh/ │ │ ├── build.sh │ │ ├── mosh-server.cc.patch │ │ ├── mosh.cc │ │ ├── mosh.pl.patch │ │ └── src-network-network.cc.patch │ ├── mp3splt/ │ │ └── build.sh │ ├── mpc/ │ │ ├── build.sh │ │ └── meson.build.patch │ ├── mpd/ │ │ ├── HybridDsdDecoderPlugin.cxx.patch │ │ ├── build.sh │ │ ├── doc-mpdconf.example.patch │ │ ├── mpd-script.sh │ │ ├── registry.cxx.patch │ │ ├── src-fs-io-FileOutputStream.hxx.patch │ │ ├── src-input-Error.cxx.patch │ │ ├── src-lib-gcrypt-meson.build.patch │ │ ├── src-output-plugins-meson.build.patch │ │ └── thread-Util.cxx.patch │ ├── mpdscribble/ │ │ ├── Makefile.am.patch │ │ ├── build.sh │ │ ├── file.c.patch │ │ └── mpdscribble.conf.patch │ ├── mpv/ │ │ ├── build.sh │ │ ├── main.c.patch │ │ ├── mpv.conf │ │ └── wscript.patch │ ├── msmtp/ │ │ └── build.sh │ ├── mtd-utils/ │ │ ├── build.sh │ │ └── mkfs.jffs2.c.patch │ ├── mtools/ │ │ ├── build.sh │ │ └── sysinc.patch │ ├── mu/ │ │ └── build.sh │ ├── multitail/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ ├── mt.c.patch │ │ ├── my_pty.c.patch │ │ ├── term.c.patch │ │ └── utils.c.patch │ ├── mutt/ │ │ ├── build.sh │ │ ├── getdomain.c.patch │ │ ├── init.c.patch │ │ ├── lib.c.patch │ │ ├── muttlib.c.patch │ │ └── smime_keys_path.patch │ ├── myrepos/ │ │ └── build.sh │ ├── nano/ │ │ ├── build.sh │ │ ├── src-files.c.patch │ │ └── src-text.c.patch │ ├── ncdc/ │ │ └── build.sh │ ├── ncdu/ │ │ └── build.sh │ ├── ncmpcpp/ │ │ ├── build.sh │ │ ├── config.patch │ │ ├── configure.ac.patch │ │ ├── locale.patch │ │ ├── ncmpcpp.cpp.patch │ │ └── settings.cpp.patch │ ├── ncompress/ │ │ └── build.sh │ ├── ncurses/ │ │ ├── build.sh │ │ ├── fix-paths.patch │ │ ├── ncurses-tinfo-lib_setup.c.patch │ │ ├── ncurses-tinfo-tinfo_driver.c.patch │ │ ├── ncurses-ui-libs-static.subpackage.sh │ │ ├── ncurses-ui-libs.subpackage.sh │ │ └── ncurses-utils.subpackage.sh │ ├── ndk-multilib/ │ │ └── build.sh │ ├── ndk-sysroot/ │ │ ├── build.sh │ │ └── math-header.diff │ ├── ne/ │ │ └── build.sh │ ├── neofetch/ │ │ └── build.sh │ ├── neovim/ │ │ ├── build.sh │ │ ├── runtime-CMakeLists.txt.patch │ │ ├── runtime-autoload-man.vim.patch │ │ ├── runtime-autoload-provider-clipboard.vim.patch │ │ ├── src-nvim-os-stdpaths.c.patch │ │ └── sysinit.vim │ ├── net-tools/ │ │ ├── arp.c.patch │ │ ├── build.sh │ │ ├── ifconfig.c.patch │ │ ├── lib-inet.c.patch │ │ ├── lib-inet6.c.patch │ │ ├── lib-inet6_sr.c.patch │ │ ├── lib-pathnames.h.patch │ │ ├── nameif.c.patch │ │ ├── rarp.c.patch │ │ ├── slattach.c.patch │ │ └── unknown_state.patch │ ├── netpbm/ │ │ ├── GNUmakefile.patch │ │ ├── build.sh │ │ ├── buildtools-Makefile.patch │ │ ├── buildtools-installnetpbm.pl.patch │ │ ├── camera.c.patch │ │ ├── lib-Makefile.patch │ │ ├── standardppmdfont.c │ │ └── util.c.patch │ ├── netsed/ │ │ └── build.sh │ ├── newsboat/ │ │ ├── Makefile.patch │ │ ├── avoid-gettext.patch │ │ ├── build.sh │ │ ├── fix-paths.patch │ │ └── mbc-buffer-length-fix.patch │ ├── nginx/ │ │ ├── Android-crossfile.patch32 │ │ ├── Android-crossfile.patch64 │ │ ├── auto-threads.patch │ │ ├── build.sh │ │ ├── cross-compile-nginx.patch │ │ ├── src-core-ngx_cycle.c.patch │ │ ├── src-core-ngx_file.c.patch │ │ └── src-event-modules-ngx_epoll_module.c.patch │ ├── nim/ │ │ ├── build.sh │ │ └── osproc.nim.patch │ ├── ninja/ │ │ ├── build.sh │ │ ├── src-subprocess-posix.cc.patch │ │ └── src-util.cc.patch │ ├── nmap/ │ │ ├── build.sh │ │ ├── fix-paths.patch │ │ ├── netcat.subpackage.sh │ │ └── nping-EchoServer.cc.patch │ ├── nnn/ │ │ └── build.sh │ ├── nodejs/ │ │ ├── build.sh │ │ ├── configure.py.patch │ │ ├── deps-uv-src-unix-core.c.patch │ │ ├── deps-uv-src-unix-process.c.patch │ │ ├── deps-uv-uv.gyp.patch │ │ ├── deps-v8-src-flags-flag-definitions.h.patch │ │ ├── deps-v8-src-logging-log.cc.patch │ │ ├── fix_multiple_definitions.patch │ │ ├── lib-child_process.js.patch │ │ ├── lib-os.js.patch │ │ ├── node.gyp.patch │ │ ├── npm-link-patch.patch │ │ ├── src-cares_wrap.cc.patch │ │ ├── src-node_internals.h.patch │ │ ├── src-node_main.cc.patch │ │ └── tools-v8_gypfiles-v8.gyp.patch │ ├── nodejs-lts/ │ │ ├── build.sh │ │ ├── configure.py.patch │ │ ├── deps-uv-src-unix-core.c.patch │ │ ├── deps-uv-uv.gyp.patch │ │ ├── deps-v8-src-flags-flag-definitions.h.patch │ │ ├── deps-v8-src-logging-log.cc.patch │ │ ├── fix_multiple_definitions.patch │ │ ├── lib-child_process.js.patch │ │ ├── lib-os.js.patch │ │ ├── node.gyp.patch │ │ ├── npm-link-patch.patch │ │ ├── src-cares_wrap.cc.patch │ │ ├── src-node_internals.h.patch │ │ ├── src-node_main.cc.patch │ │ └── tools-v8_gypfiles-v8.gyp.patch │ ├── notmuch/ │ │ ├── Makefile.global.patch │ │ ├── build.sh │ │ ├── configure.patch │ │ └── notmuch-config.c.patch │ ├── nyancat/ │ │ ├── build.sh │ │ └── makefile.patch │ ├── nzbget/ │ │ ├── build.sh │ │ └── options.cpp.patch │ ├── oathtool/ │ │ └── build.sh │ ├── obfs4proxy/ │ │ └── build.sh │ ├── ocrad/ │ │ ├── build.sh │ │ └── configure.patch │ ├── odt2txt/ │ │ ├── Makefile.patch │ │ └── build.sh │ ├── oleo/ │ │ ├── basic.h.patch │ │ ├── build.sh │ │ ├── global.h.patch │ │ ├── io-term.c.patch │ │ ├── io-term.h.patch │ │ ├── plotter.c.patch │ │ ├── texi2html.in.patch │ │ └── xrdb.c.patch │ ├── openal-soft/ │ │ ├── alc-alconfig.cpp.patch │ │ ├── build.sh │ │ └── native-tools-CMakeLists.txt.patch │ ├── openjpeg/ │ │ ├── CMakeLists.txt.patch │ │ ├── build.sh │ │ └── openjpeg-tools.subpackage.sh │ ├── openssh/ │ │ ├── Makefile.in.patch │ │ ├── auth.c.patch │ │ ├── auth2-passwd.c.patch │ │ ├── build.sh │ │ ├── fix-hardcoded-paths.patch │ │ ├── hostfile.c.patch │ │ ├── misc_c.patch │ │ ├── mux.c.patch │ │ ├── no_loginrec.patch │ │ ├── no_tty_chmod.patch │ │ ├── openbsd-compat-explicit_bzero.c.patch │ │ ├── openbsd-compat-xcrypt.c.patch │ │ ├── servconf.c.patch │ │ ├── session.c.patch │ │ ├── sftp-server.c.patch │ │ ├── sftp-with-agent.sh │ │ ├── source-ssh-agent.sh │ │ ├── ssh-agent.c.patch │ │ ├── ssh-keygen.c.patch │ │ ├── ssh-with-agent.sh │ │ ├── sshd.c.patch │ │ └── sshd_config.5.patch │ ├── openssl/ │ │ ├── Configurations-15-android.conf.patch │ │ ├── add-trusted-certificate │ │ ├── apps-ocsp.c.patch │ │ ├── build.sh │ │ ├── crypto-armcap.c.patch │ │ ├── e_os.h.patch │ │ └── openssl-tool.subpackage.sh │ ├── optipng/ │ │ ├── build.sh │ │ └── configure.patch │ ├── opus-tools/ │ │ └── build.sh │ ├── opusfile/ │ │ └── build.sh │ ├── ossp-uuid/ │ │ ├── build.sh │ │ ├── ossp.patch │ │ ├── uuid-aarch64.patch │ │ └── z-no-docs-no-strip.patch │ ├── p7zip/ │ │ ├── 1-CVE-2016-9296.patch │ │ ├── 2-CVE-2017-17969.patch │ │ ├── 3-CVE-2018-5996.patch │ │ ├── 4-CVE-2018-10115.patch │ │ ├── build.sh │ │ └── makefile.patch │ ├── pango/ │ │ ├── bsearch-fix.patch │ │ ├── build.sh │ │ └── pango-view.1 │ ├── par2/ │ │ └── build.sh │ ├── parallel/ │ │ ├── build.sh │ │ ├── parallel.patch │ │ └── sem.patch │ ├── parted/ │ │ ├── 01_devmapper.patch │ │ ├── 02_lseek.patch │ │ ├── 03_minormajor.patch │ │ ├── build.sh │ │ └── configure-pthreads-no-weak.patch │ ├── pass/ │ │ ├── build.sh │ │ └── src-password-store.sh.patch │ ├── pass-otp/ │ │ └── build.sh │ ├── pastebinit/ │ │ ├── build.sh │ │ └── pastebinit.patch │ ├── patch/ │ │ ├── build.sh │ │ └── tmpdir-path.patch │ ├── patchelf/ │ │ └── build.sh │ ├── pathpicker/ │ │ └── build.sh │ ├── pcre/ │ │ ├── build.sh │ │ └── libpcreposix.subpackage.sh │ ├── pcre2/ │ │ └── build.sh │ ├── pdfgrep/ │ │ └── build.sh │ ├── perl/ │ │ ├── Cwd.pm.patch │ │ ├── build.sh │ │ ├── cnf-configure_func.sh.patch │ │ ├── cnf-configure_path.sh.patch │ │ ├── file-spec-unix.pm.patch │ │ └── perlio.c.patch │ ├── pforth/ │ │ └── build.sh │ ├── php/ │ │ ├── Makefile.global.patch │ │ ├── build.sh │ │ ├── ext-opcache-config.m4.patch │ │ ├── ext-opcache-zend_accelerator_module.c.patch │ │ ├── ext-pdo_pgsql-config.m4.patch │ │ ├── ext-pgsql-config.m4.patch │ │ ├── ext-phar-Makefile.frag.patch │ │ ├── ext-posix-posix.c.patch │ │ ├── ext-standard-basic_functions.c.patch │ │ ├── ext-standard-dns.c.patch │ │ ├── ext-standard-php_fopen_wrapper.c.patch │ │ ├── ext-standard-proc_open.c.patch │ │ ├── iconv-config.m4.patch │ │ ├── pear-Makefile.frag.patch │ │ ├── php-apache.subpackage.sh │ │ ├── php-fpm.patch │ │ ├── php-fpm.subpackage.sh │ │ ├── php-pgsql.subpackage.sh │ │ └── sapi-apache2handler-config.m4.patch │ ├── pianobar/ │ │ ├── Makefile.patch │ │ └── build.sh │ ├── pick/ │ │ ├── build.sh │ │ ├── configure.patch │ │ └── pick.c.patch │ ├── picolisp/ │ │ ├── build.sh │ │ ├── src-Makefile.patch │ │ ├── src-ext.c.patch │ │ └── src64-mkAsm.patch │ ├── pigz/ │ │ ├── build.sh │ │ ├── pigz-2.4_Makefile.patch │ │ └── pigz-2.4_yarn.c.patch │ ├── pinentry/ │ │ ├── build.sh │ │ ├── pinentry-emacs.c.patch │ │ └── pinentry-pinentry.c.patch │ ├── pkg-config/ │ │ └── build.sh │ ├── play-audio/ │ │ └── build.sh │ ├── plzip/ │ │ ├── Makefile.in.patch │ │ ├── build.sh │ │ └── configure.patch │ ├── pngquant/ │ │ ├── build.sh │ │ └── configure.patch │ ├── poppler/ │ │ ├── build.sh │ │ ├── gstrtod.cc.patch │ │ └── poppler-Form.cc.patch │ ├── postgresql/ │ │ ├── build.sh │ │ ├── src-backend-Makefile.patch │ │ ├── src-backend-commands-collationcmds.c.patch │ │ ├── src-bin-initdb-initdb.c.patch │ │ ├── src-bin-pg_ctl-pg_ctl.c.patch │ │ ├── src-bin-pg_upgrade-check.c.patch │ │ ├── src-bin-psql-command.c.patch │ │ ├── src-include-pg_config_manual.h.patch │ │ └── src-timezone-zic.c.patch.beforehostbuild │ ├── potrace/ │ │ └── build.sh │ ├── privoxy/ │ │ ├── GNUmakefile.in.patch │ │ ├── build.sh │ │ ├── jcc.c.patch │ │ └── project.h.patch │ ├── procps/ │ │ ├── Makefile.in.patch │ │ ├── build.sh │ │ ├── pgrep.c.patch │ │ ├── pmap.c.patch │ │ ├── proc-sysinfo.c.patch │ │ ├── procio.c.patch │ │ ├── sysctl.c.patch │ │ ├── top-top.c.patch │ │ └── w.c.patch │ ├── profanity/ │ │ ├── build.sh │ │ ├── cmd_funcs.c.patch │ │ └── ui-inputwin.c.patch │ ├── progress/ │ │ ├── Makefile.patch │ │ ├── WithoutWordexp.patch │ │ └── build.sh │ ├── proot/ │ │ ├── build.sh │ │ └── termux-chroot │ ├── proxychains-ng/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ ├── hostreader.c.patch │ │ └── libproxychains.c.patch │ ├── psmisc/ │ │ ├── build.sh │ │ ├── pstree.patch │ │ └── src-fuser.c.patch │ ├── pulseaudio/ │ │ ├── 0001-atomic-Explicitly-cast-void-to-unsigned-long.patch │ │ ├── aaudio.patch │ │ ├── build.sh │ │ ├── fix-paths.patch │ │ ├── module-aaudio-sink.c │ │ ├── module-sles-sink.c │ │ ├── module-sles-source.c │ │ ├── no_priv_drop.patch │ │ └── sles.patch │ ├── pure-ftpd/ │ │ ├── build.sh │ │ ├── pure-pwconvert.c.patch │ │ ├── src-ftpd.h.patch │ │ └── src-ftpd_p.h.patch │ ├── pv/ │ │ ├── build.sh │ │ ├── header.in.patch │ │ └── src-pv-cursor.c.patch │ ├── pwgen/ │ │ └── build.sh │ ├── python/ │ │ ├── 0001-compileall-Fix-ddir-when-recursing.patch │ │ ├── Lib-pathlib.py.patch │ │ ├── Lib-subprocess.py.patch │ │ ├── Lib-tmpfile.py.patch │ │ ├── Modules-socketmodule.c.patch │ │ ├── _cursesmodule.c.patch │ │ ├── build.sh │ │ ├── configure.patch │ │ ├── cryptmodule.c.patch │ │ ├── distutils-command-build.py.patch │ │ ├── fix-paths.patch │ │ ├── python-tkinter.subpackage.sh │ │ └── setup.py.patch │ ├── python2/ │ │ ├── Lib-subprocess.py.patch │ │ ├── Lib-tempfile.py.patch │ │ ├── Makefile.pre.in.patch │ │ ├── Modules-pwdmodule.c.patch │ │ ├── Python-bltinmodule.c.patch │ │ ├── build.sh │ │ ├── configure.patch │ │ ├── cryptmodule.c.patch │ │ ├── fix-dlfcn.patch32 │ │ ├── fix-dlfcn.patch64 │ │ ├── fix-paths.patch │ │ └── setup.py.patch │ ├── qalc/ │ │ ├── build.sh │ │ └── util.cc.patch │ ├── qpdf/ │ │ └── build.sh │ ├── quickjs/ │ │ └── build.sh │ ├── radare2/ │ │ ├── 5d76b9ff992b1b7dd64b1ccb89afa40318ff25fa.patch │ │ ├── build.sh │ │ ├── f639c3b6a17a57c9a0fa1790811eff27dd124b59.patch │ │ ├── libr-core-cconfig.c.patch │ │ ├── libr-include-r_magic.h.patch │ │ ├── libr-util-diff.c.patch │ │ ├── libr-util-file.c.patch │ │ ├── libr-util-sandbox.c.patch │ │ ├── mk-termux-host.mk.patch │ │ └── sys-ldconfig.sh.patch │ ├── ragel/ │ │ └── build.sh │ ├── ranger/ │ │ ├── build.sh │ │ ├── ranger-core-actions.py.patch │ │ └── ranger.patch │ ├── rclone/ │ │ └── build.sh │ ├── rcs/ │ │ ├── build.sh │ │ └── noreturn.patch │ ├── readline/ │ │ ├── build.sh │ │ ├── inputrc │ │ └── rlconf.h.patch │ ├── redir/ │ │ ├── build.sh │ │ └── redir.c.patch │ ├── redis/ │ │ ├── bio.c.patch │ │ ├── build.sh │ │ ├── config.h.patch │ │ ├── redis.conf.patch │ │ ├── src-Makefile.patch │ │ └── src-server.h.patch │ ├── remind/ │ │ └── build.sh │ ├── resolv-conf/ │ │ └── build.sh │ ├── restic/ │ │ └── build.sh │ ├── rgbds/ │ │ ├── Makefile.patch │ │ └── build.sh │ ├── rhash/ │ │ ├── build.sh │ │ ├── configure.patch │ │ ├── librhash-byte_order.h.patch │ │ └── parse_cmdline.c.patch │ ├── ripgrep/ │ │ └── build.sh │ ├── rlwrap/ │ │ ├── build.sh │ │ ├── fix-hardcoded-paths.patch │ │ └── ptytty.c.patch │ ├── root-repo/ │ │ └── build.sh │ ├── rsync/ │ │ ├── build.sh │ │ ├── rsync-3.1.3_lib_getpass.c.patch │ │ └── rsync.h.patch │ ├── rtmpdump/ │ │ ├── Makefile.patch │ │ └── build.sh │ ├── ruby/ │ │ ├── Makefile.in.patch │ │ ├── build.sh │ │ ├── ext-etc-etc.c.patch │ │ ├── ext-syslog-extconf.rb.patch │ │ ├── fix-paths.patch │ │ ├── lib-rubygems-install_update_options.rb.patch │ │ ├── lib-tmpdir.rb.patch │ │ ├── mkmf.rb.patch │ │ ├── process.c.patch │ │ ├── pty.c.patch │ │ ├── ruby-ri.subpackage.sh │ │ ├── src-signal.c.patch │ │ ├── tests/ │ │ │ ├── default_encoding_isutf8.sh │ │ │ └── extension_modules_installed.sh │ │ └── tool-rbinstall.rb.patch │ ├── rust/ │ │ ├── build.sh │ │ ├── config.toml │ │ ├── os-tmpdir.patch │ │ ├── rust-std-wasm32.subpackage.sh │ │ └── src-librustc_llvm-build.rs.patch │ ├── samefile/ │ │ └── build.sh │ ├── sc/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ └── cmds.c.patch │ ├── sc-im/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ ├── cmds_command.c.patch │ │ ├── cmds_normal.c.patch │ │ ├── cmds_visual.c.patch │ │ ├── file.c.patch │ │ └── main.c.patch │ ├── science-repo/ │ │ └── build.sh │ ├── screen/ │ │ ├── attacher.c.patch │ │ ├── build.sh │ │ ├── config.h.in.patch │ │ ├── fileio.c.patch │ │ ├── misc.c.patch │ │ ├── no-setuid.patch │ │ ├── os.h.patch │ │ ├── osdef.h.in.patch │ │ ├── screen.h.patch │ │ ├── utmp.c.patch │ │ └── window.c.patch │ ├── screenfetch/ │ │ ├── build.sh │ │ └── screenfetch-dev.patch │ ├── scrypt/ │ │ └── build.sh │ ├── sdcv/ │ │ ├── build.sh │ │ └── src-mapfile.hpp.patch │ ├── seafile-client/ │ │ ├── build.sh │ │ └── configure.ac.patch │ ├── seccure/ │ │ ├── Makefile.patch │ │ └── build.sh │ ├── secure-delete/ │ │ ├── 000-from-debian.patch │ │ ├── 001-makefile-cc.patch │ │ └── build.sh │ ├── sed/ │ │ └── build.sh │ ├── sensible-utils/ │ │ └── build.sh │ ├── serf/ │ │ ├── build.sh │ │ └── sconstruct.patch │ ├── sharutils/ │ │ ├── build.sh │ │ └── config.h.in.patch │ ├── shellharden/ │ │ └── build.sh │ ├── silversearcher-ag/ │ │ └── build.sh │ ├── sl/ │ │ ├── build.sh │ │ └── makefile.patch │ ├── socat/ │ │ ├── build.sh │ │ ├── dont_use_resolv_h.patch │ │ ├── no-o_append.patch │ │ └── openpty.c.patch │ ├── sox/ │ │ └── build.sh │ ├── speexdsp/ │ │ └── build.sh │ ├── spiped/ │ │ ├── Makefile.patch │ │ └── build.sh │ ├── squid/ │ │ ├── CpuAffinitySet.cc.patch │ │ ├── build.sh │ │ ├── dns_internal.cc.patch │ │ ├── src-esi-VarState.cc.patch │ │ └── sys-stat.h.patch │ ├── sshpass/ │ │ └── build.sh │ ├── ssss/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ └── ssss.1 │ ├── stag/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ └── stag.c.patch │ ├── starship/ │ │ └── build.sh │ ├── steghide/ │ │ ├── build.sh │ │ ├── gcc-4.2.patch │ │ ├── libtool-fix.patch │ │ ├── steghide-climits.patch │ │ └── steghide-gcc6.patch │ ├── stfl/ │ │ ├── 001-makefile.patch │ │ └── build.sh │ ├── stow/ │ │ └── build.sh │ ├── strace/ │ │ ├── build.sh │ │ ├── ipc_msgctl.c.patch │ │ ├── ipc_shmctl.c.patch │ │ └── strace.c.patch │ ├── stunnel/ │ │ └── build.sh │ ├── subversion/ │ │ ├── build.sh │ │ ├── configure.patch │ │ └── no_setlocale.patch │ ├── swi-prolog/ │ │ └── build.sh │ ├── swig/ │ │ └── build.sh │ ├── syncthing/ │ │ └── build.sh │ ├── taglib/ │ │ └── build.sh │ ├── tar/ │ │ ├── build.sh │ │ ├── gnu-stdio-impl.h.patch │ │ ├── gnu-vasnprintf.c.patch │ │ ├── src-system.c.patch │ │ └── tmpdir-path.patch │ ├── tasksh/ │ │ └── build.sh │ ├── taskwarrior/ │ │ ├── CMakeLists.txt.patch │ │ └── build.sh │ ├── tcl/ │ │ └── build.sh │ ├── tcsh/ │ │ ├── Makefile.in.patch │ │ ├── build.sh │ │ └── sh.h.patch │ ├── teckit/ │ │ └── build.sh │ ├── tergent/ │ │ └── build.sh │ ├── termimage/ │ │ └── build.sh │ ├── termux-am/ │ │ └── build.sh │ ├── termux-api/ │ │ └── build.sh │ ├── termux-apt-repo/ │ │ └── build.sh │ ├── termux-auth/ │ │ └── build.sh │ ├── termux-create-package/ │ │ └── build.sh │ ├── termux-elf-cleaner/ │ │ └── build.sh │ ├── termux-exec/ │ │ └── build.sh │ ├── termux-keyring/ │ │ ├── build.sh │ │ ├── fornwall.gpg │ │ ├── grimler.gpg │ │ ├── termux-autobuilds.gpg │ │ └── xeffyr.gpg │ ├── termux-licenses/ │ │ ├── LICENSES/ │ │ │ ├── AGPL-V3.txt │ │ │ ├── Apache-2.0.txt │ │ │ ├── Artistic-License-2.0.txt │ │ │ ├── BSD 2-Clause.txt │ │ │ ├── BSD 3-Clause.txt │ │ │ ├── BSD.txt │ │ │ ├── BSL-1.0.txt │ │ │ ├── CC0-1.0.txt │ │ │ ├── CeCILL-2.1.txt │ │ │ ├── EPL-1.0.txt │ │ │ ├── EPL-2.0.txt │ │ │ ├── GPL-2.0.txt │ │ │ ├── GPL-3.0.txt │ │ │ ├── ISC.txt │ │ │ ├── ImageMagick.txt │ │ │ ├── LGPL-2.0.txt │ │ │ ├── LGPL-2.1.txt │ │ │ ├── LGPL-3.0.txt │ │ │ ├── Libpng.txt │ │ │ ├── MIT.txt │ │ │ ├── MPL-2.0.txt │ │ │ ├── NCSA.txt │ │ │ ├── Nethack.txt │ │ │ ├── OpenLDAP.txt │ │ │ ├── PHP-3.0.txt │ │ │ ├── Public Domain.txt │ │ │ ├── PythonPL.txt │ │ │ ├── Unlicense.txt │ │ │ ├── VIM License.txt │ │ │ ├── WTFPL.txt │ │ │ ├── ZLIB.txt │ │ │ └── wxWindows.txt │ │ └── build.sh │ ├── termux-services/ │ │ └── build.sh │ ├── termux-tools/ │ │ ├── build.sh │ │ ├── chsh │ │ ├── dalvikvm │ │ ├── login │ │ ├── motd │ │ ├── pkg │ │ ├── su │ │ ├── termux-fix-shebang │ │ ├── termux-info │ │ ├── termux-open │ │ ├── termux-open-url │ │ ├── termux-reload-settings │ │ ├── termux-setup-storage │ │ ├── termux-wake-lock │ │ └── termux-wake-unlock │ ├── teseq/ │ │ └── build.sh │ ├── tesseract/ │ │ └── build.sh │ ├── texinfo/ │ │ ├── build.sh │ │ └── texindex-texindex.in.patch │ ├── texlive/ │ │ ├── build.sh │ │ ├── check_for_conflicts.py │ │ ├── fmtutil.cnf.patch │ │ ├── parse_tlpdb.py │ │ ├── texlive-bibtexextra.subpackage.sh │ │ ├── texlive-binextra.subpackage.sh │ │ ├── texlive-context.subpackage.sh │ │ ├── texlive-fontsextra.subpackage.sh │ │ ├── texlive-fontsrecommended.subpackage.sh │ │ ├── texlive-fontutils.subpackage.sh │ │ ├── texlive-formatsextra.subpackage.sh │ │ ├── texlive-full.subpackage.sh │ │ ├── texlive-games.subpackage.sh │ │ ├── texlive-humanities.subpackage.sh │ │ ├── texlive-langarabic.subpackage.sh │ │ ├── texlive-langchinese.subpackage.sh │ │ ├── texlive-langcjk.subpackage.sh │ │ ├── texlive-langcyrillic.subpackage.sh │ │ ├── texlive-langczechslovak.subpackage.sh │ │ ├── texlive-langenglish.subpackage.sh │ │ ├── texlive-langeuropean.subpackage.sh │ │ ├── texlive-langfrench.subpackage.sh │ │ ├── texlive-langgerman.subpackage.sh │ │ ├── texlive-langgreek.subpackage.sh │ │ ├── texlive-langitalian.subpackage.sh │ │ ├── texlive-langjapanese.subpackage.sh │ │ ├── texlive-langkorean.subpackage.sh │ │ ├── texlive-langother.subpackage.sh │ │ ├── texlive-langpolish.subpackage.sh │ │ ├── texlive-langportuguese.subpackage.sh │ │ ├── texlive-langspanish.subpackage.sh │ │ ├── texlive-latexextra.subpackage.sh │ │ ├── texlive-latexrecommended.subpackage.sh │ │ ├── texlive-luatex.subpackage.sh │ │ ├── texlive-mathscience.subpackage.sh │ │ ├── texlive-metapost.subpackage.sh │ │ ├── texlive-music.subpackage.sh │ │ ├── texlive-pictures.subpackage.sh │ │ ├── texlive-plaingeneric.subpackage.sh │ │ ├── texlive-pstricks.subpackage.sh │ │ ├── texlive-publishers.subpackage.sh │ │ ├── texlive-xetex.subpackage.sh │ │ ├── texmf.cnf.patch │ │ └── web2c-texmf.cnf │ ├── texlive-bin/ │ │ ├── build.sh │ │ ├── pdftoepdf-poppler0.76.0.cc │ │ ├── pdftosrc-poppler0.76.0.cc │ │ ├── texk-kpathsea-texmf.cnf.patch │ │ ├── texk-web2c-luatexdir-luaffi-ffi.h.patch │ │ ├── xetex-poppler-fixes.patch │ │ └── zziplib_disable_have_dirent.patch │ ├── texlive-tlmgr/ │ │ ├── TLConfig.pm.patch │ │ ├── TLUtils.pm.patch │ │ ├── build.sh │ │ └── texlive.tlpdb │ ├── tidy/ │ │ ├── build.sh │ │ └── disable-target-manpages.patch │ ├── tig/ │ │ └── build.sh │ ├── timewarrior/ │ │ ├── build.sh │ │ ├── cmake-CXXSniffer.cmake.patch │ │ └── src-CMakeLists.txt.patch │ ├── tintin++/ │ │ ├── build.sh │ │ └── src-system.c.patch │ ├── tinyproxy/ │ │ ├── build.sh │ │ ├── child.c.patch │ │ ├── configure.patch │ │ └── heap.c.patch │ ├── tinyscheme/ │ │ ├── build.sh │ │ ├── makefile.patch │ │ └── schema.c.patch │ ├── tk/ │ │ ├── build.sh │ │ └── no-hardlinks.patch │ ├── tmate/ │ │ ├── build.sh │ │ └── tmux.h.patch │ ├── tmux/ │ │ ├── build.sh │ │ ├── compat-imsg.c.patch │ │ ├── compat-setproctitle.c.patch │ │ ├── configure.patch │ │ ├── socket-path.patch │ │ └── tmux.conf │ ├── toilet/ │ │ └── build.sh │ ├── tokei/ │ │ └── build.sh │ ├── tor/ │ │ ├── build.sh │ │ ├── src-app-main-main.c.patch │ │ └── src-feature-relay-dns.c.patch │ ├── torsocks/ │ │ ├── Makefile.am.patch │ │ ├── build.sh │ │ ├── configure.ac.patch │ │ ├── src-common-compat.h.patch │ │ ├── src-common-config-file.h.patch │ │ ├── src-lib-gethostbyname.c.patch │ │ └── src-lib-syscall.c.patch │ ├── toxic/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ └── cfg-checks-audio.mk.patch │ ├── tracepath/ │ │ ├── build.sh │ │ └── tracepath.c.patch │ ├── translate-shell/ │ │ └── build.sh │ ├── transmission/ │ │ ├── arpa_inet_h.patch │ │ ├── build.sh │ │ ├── libtransmission-fdlimit.c.patch │ │ ├── miniwget_min.patch │ │ ├── no_locale.patch │ │ └── no_quota.patch │ ├── tree/ │ │ ├── build.sh │ │ └── tree.c.patch │ ├── tsocks/ │ │ ├── 00_patch_from_1.8beta5-9.2.patch │ │ ├── 01_symbolexport.patch │ │ ├── 02_hyphenfix.patch │ │ ├── 03_fixloop.patch │ │ ├── 04_getpeername.patch │ │ ├── 05_config_in_home.patch │ │ ├── 06_fallback.patch │ │ ├── 07_tsocks-1.8_beta5-hostname-config-fix.patch │ │ ├── 08_manpages-fixes.patch │ │ ├── 10_hardening.patch │ │ ├── build.sh │ │ ├── configure.patch │ │ ├── no-static-linking.patch │ │ ├── tsocks.c.patch │ │ └── tsocks.patch │ ├── tsu/ │ │ └── build.sh │ ├── tty-clock/ │ │ ├── Makefile.patch │ │ └── build.sh │ ├── ttyd/ │ │ ├── CMakeLists.txt.patch │ │ ├── build.sh │ │ └── src-utils.c.patch │ ├── ttyrec/ │ │ ├── Makefile.patch │ │ ├── build.sh │ │ └── ttyrec.c.patch │ ├── tweego/ │ │ └── build.sh │ ├── uftrace/ │ │ ├── arm-clang-mcount-hook.patch │ │ ├── build.sh │ │ ├── cmds-live.c.patch │ │ ├── cmds-record.c.patch │ │ ├── disable-librt.patch │ │ ├── kernel.c.patch │ │ ├── libmcount-record.c.patch │ │ ├── libmcount-wrap.c.patch │ │ └── pr_warn.patch │ ├── unicorn/ │ │ ├── build.sh │ │ └── samples-Makefile.patch │ ├── unifdef/ │ │ └── build.sh │ ├── units/ │ │ ├── build.sh │ │ └── units.h.patch.debug │ ├── unrar/ │ │ ├── build.sh │ │ ├── makefile.patch │ │ └── os.hpp.patch │ ├── unstable-repo/ │ │ └── build.sh │ ├── unzip/ │ │ ├── bugfix-crc32.patch │ │ ├── bugfix-csiz-underflow.patch │ │ ├── bugfix-cve20149636.patch │ │ ├── bugfix-empty-input.patch │ │ ├── bugfix-getZip64Data.patch │ │ ├── bugfix-nextbyte-overflow.patch │ │ ├── bugfix-overflow-fsize.patch │ │ ├── bugfix-test_compr_eb.patch │ │ ├── build.sh │ │ ├── makefile.patch │ │ ├── unix-configure.patch │ │ └── unzip.c.patch │ ├── utf8cpp/ │ │ └── build.sh │ ├── utf8proc/ │ │ ├── Makefile.patch │ │ └── build.sh │ ├── utfdecode/ │ │ └── build.sh │ ├── util-linux/ │ │ ├── build.sh │ │ ├── configure.patch │ │ ├── fix-paths.patch │ │ ├── lib-ismounted.c.patch │ │ ├── sys-utils-ipcutils.c.patch │ │ └── sys-utils-ipcutils.h.patch │ ├── valac/ │ │ ├── build.sh │ │ └── valadoc.subpackage.sh │ ├── valgrind/ │ │ ├── aarch64-setjmp.S │ │ ├── build.sh │ │ ├── coregrind-vgdb.c.patch │ │ ├── coregrindmake.am.patch │ │ ├── dont-redefine-elf32_nhdr.patch │ │ ├── libcsetjmp.h.patch │ │ ├── memcheckmake.am.patch │ │ └── vg_preloaded.c.patch │ ├── vcsh/ │ │ └── build.sh │ ├── vegeta/ │ │ └── build.sh │ ├── vifm/ │ │ ├── build.sh │ │ ├── cmd_completion.c.patch │ │ ├── configure.ac.patch │ │ ├── file_info.c.patch │ │ ├── src-Makefile.am.patch │ │ ├── src-registers.c.patch │ │ ├── src-utils-path.c.patch │ │ └── src-utils-shmem_nix.c.patch │ ├── vim/ │ │ ├── build.sh │ │ ├── option.c.patch │ │ ├── os_unix.h.patch │ │ ├── src-auto-configure.patch │ │ ├── src-if_cscope.c.patch │ │ ├── vim-runtime.subpackage.sh │ │ ├── vimrc │ │ ├── vimtutor.patch │ │ └── vterm_internal.h.patch │ ├── vim-python/ │ │ ├── build.sh │ │ ├── option.c.patch │ │ ├── os_unix.h.patch │ │ ├── src-auto-configure.patch │ │ ├── src-if_cscope.c.patch │ │ ├── vimrc │ │ ├── vimtutor.patch │ │ └── vterm_internal.h.patch │ ├── virustotal-cli/ │ │ └── build.sh │ ├── vis/ │ │ ├── build.sh │ │ └── configure.patch │ ├── vorbis-tools/ │ │ └── build.sh │ ├── vttest/ │ │ └── build.sh │ ├── vtutils/ │ │ └── build.sh │ ├── w3m/ │ │ ├── Makefile.in.patch │ │ ├── Str.h.patch │ │ ├── build.sh │ │ └── gc.h │ ├── wcalc/ │ │ └── build.sh │ ├── weechat/ │ │ ├── build.sh │ │ ├── cmake-FindPerl.cmake.patch │ │ ├── no-setuid.patch │ │ ├── src-core-wee-config.c.patch │ │ ├── src-core-weechat.c.patch │ │ ├── src-gui-curses-CMakeLists.txt.patch │ │ ├── weechat-lua-plugin.subpackage.sh │ │ ├── weechat-perl-plugin.subpackage.sh │ │ ├── weechat-python-plugin.subpackage.sh │ │ ├── weechat-python38.patch │ │ └── weechat-ruby-plugin.subpackage.sh │ ├── wget/ │ │ ├── build.sh │ │ ├── lib-stdio-impl.h.patch │ │ └── tmpdir-path.patch │ ├── wireguard-tools/ │ │ ├── android.c.patch │ │ └── build.sh │ ├── wol/ │ │ ├── build.sh │ │ ├── lib-getline.h.patch │ │ └── src-magic.c.patch │ ├── wordgrinder/ │ │ ├── Makefile.patch │ │ ├── build.lua.patch │ │ └── build.sh │ ├── wren/ │ │ ├── build.sh │ │ ├── libuv-sys-include.patch │ │ └── util-wren.mk.patch │ ├── wuzz/ │ │ └── build.sh │ ├── x11-repo/ │ │ └── build.sh │ ├── xcb-proto/ │ │ └── build.sh │ ├── xmlsec/ │ │ └── build.sh │ ├── xmlstarlet/ │ │ └── build.sh │ ├── xorg-util-macros/ │ │ ├── build.sh │ │ └── util-macros-1.19.1_xorg-macros.m4.in.patch │ ├── xorgproto/ │ │ ├── build.sh │ │ ├── include-x11-Xos_r.h.patch │ │ ├── include-x11-Xpoll.h.in.patch │ │ └── meson.build.patch │ ├── xorriso/ │ │ ├── build.sh │ │ └── pthread.patch │ ├── xtrans/ │ │ ├── build.sh │ │ ├── xtrans-1.3.5_Xtransutil.c.patch │ │ ├── xtrans-1.4.0_Xtranslcl.c.patch │ │ └── xtrans-1.4.0_Xtranssock.c.patch │ ├── xvidcore/ │ │ └── build.sh │ ├── yadm/ │ │ └── build.sh │ ├── yajl/ │ │ └── build.sh │ ├── yarn/ │ │ └── build.sh │ ├── yasm/ │ │ └── build.sh │ ├── zbar/ │ │ ├── build.sh │ │ ├── configure.ac.patch │ │ └── zbarimg.c.patch │ ├── zile/ │ │ ├── build.sh │ │ ├── configure-pthreads-no-weak.patch │ │ ├── lib-vasnprintf.c.patch │ │ ├── spawn.patch │ │ └── zile.1 │ ├── zip/ │ │ ├── build.sh │ │ ├── makefile.patch │ │ └── unix-configure.patch │ ├── zlib/ │ │ └── build.sh │ ├── zsh/ │ │ ├── Src-exec.c.patch │ │ ├── build.sh │ │ ├── compaudit.patch │ │ ├── configure.patch │ │ ├── etc-zshrc │ │ ├── src-init.c.patch │ │ ├── src-module.c.patch │ │ └── tmp_path.patch │ ├── zstd/ │ │ ├── build.sh │ │ └── no-timespec_get.patch │ └── zsync/ │ └── build.sh ├── print.txt ├── sample/ │ ├── build.sh │ └── sample-sub.subpackage.sh └── scripts/ ├── Dockerfile ├── Vagrantfile ├── apt-compare-versions ├── build/ │ ├── ci/ │ │ └── cirrus-ci_dispatcher.sh │ ├── configure/ │ │ ├── termux_step_configure.sh │ │ ├── termux_step_configure_autotools.sh │ │ ├── termux_step_configure_cmake.sh │ │ └── termux_step_configure_meson.sh │ ├── setup/ │ │ ├── termux_setup_cmake.sh │ │ ├── termux_setup_golang.sh │ │ ├── termux_setup_meson.sh │ │ ├── termux_setup_ninja.sh │ │ ├── termux_setup_protobuf.sh │ │ └── termux_setup_rust.sh │ ├── termux_create_subpackages.sh │ ├── termux_download.sh │ ├── termux_download_deb.sh │ ├── termux_error_exit.sh │ ├── termux_extract_dep_info.sh │ ├── termux_get_repo_files.sh │ ├── termux_step_create_datatar.sh │ ├── termux_step_create_debfile.sh │ ├── termux_step_extract_into_massagedir.sh │ ├── termux_step_extract_package.sh │ ├── termux_step_finish_build.sh │ ├── termux_step_handle_buildarch.sh │ ├── termux_step_handle_hostbuild.sh │ ├── termux_step_host_build.sh │ ├── termux_step_install_license.sh │ ├── termux_step_make.sh │ ├── termux_step_make_install.sh │ ├── termux_step_massage.sh │ ├── termux_step_patch_package.sh │ ├── termux_step_replace_guess_scripts.sh │ ├── termux_step_setup_toolchain.sh │ ├── termux_step_setup_variables.sh │ └── termux_step_start_build.sh ├── buildorder.py ├── check-built-packages.py ├── check-pie.sh ├── check-versions.sh ├── config.guess ├── config.sub ├── get_hash_from_file.py ├── ldd ├── lint-packages.sh ├── list-packages.sh ├── list-versions.sh ├── package_uploader.sh ├── print.txt ├── properties.sh ├── run-docker.ps1 ├── run-docker.sh ├── setup-android-sdk.sh ├── setup-archlinux.sh ├── setup-termux.sh ├── setup-ubuntu.sh ├── test-runner.sh └── update-docker.sh ================================================ FILE CONTENTS ================================================ ================================================ FILE: .cirrus.yml ================================================ container: image: andronixapp/package-builder:latest ## ## When doing release builds (branch 'master'), update Docker image if ## required. ## docker_builder: name: Update docker image only_if: $CIRRUS_BRANCH == 'master' env: DOCKER_USERNAME: andronixapp DOCKER_PASSWORD: ENCRYPTED[f1e136ddb0b71978bd017089b1ba5101d43e263b5e22d3121055b948890110b8f98208eb26424ffe4bdbd99a7a0502b5] script: | bash ./scripts/build/ci/cirrus-ci_dispatcher.sh --update-docker ## ## Perform basic check for errors in build.sh package scripts. ## If error found, exit with error code to stop build. ## task: container: cpu: 1 memory: 4 name: Lint packages timeout_in: 5m depends_on: - Update docker image script: | bash scripts/lint-packages.sh ## ## Determine changes in the last push, find modified packages and ## build them for aarch64/arm/i686/x86_64 architectures. ## ## Built packages are accessible from Cirrus CI web interface. ## task: container: # Max configuration required by few large packages such as `rust`. cpu: 8 memory: 24 name: Build packages # 2 hours is a maximal timeout available for free use. timeout_in: 120m depends_on: - Lint packages environment: TERMUX_MAKE_PROCESSES: 8 matrix: - TERMUX_ARCH: aarch64 - TERMUX_ARCH: arm - TERMUX_ARCH: i686 - TERMUX_ARCH: x86_64 # Do not use built-in git client provided by Cirrus as it may # cause problems when determining changed files. clone_script: | if [[ -z "$CIRRUS_PR" ]]; then git clone --recursive --branch="$CIRRUS_BRANCH" "https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git" "$CIRRUS_WORKING_DIR" git reset --hard "$CIRRUS_CHANGE_IN_REPO" else git clone --recursive "https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git" "$CIRRUS_WORKING_DIR" git fetch origin "pull/$CIRRUS_PR/head:pull/$CIRRUS_PR" git reset --hard "$CIRRUS_CHANGE_IN_REPO" fi build_script: | export TERMUX_DEBDIR="/tmp/debs-${TERMUX_ARCH}" ln -s "$TERMUX_DEBDIR" debs bash ./scripts/build/ci/cirrus-ci_dispatcher.sh aarch64_debs_cache: folder: "/tmp/debs-aarch64" fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-aarch64" arm_debs_cache: folder: "/tmp/debs-arm" fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-arm" i686_debs_cache: folder: "/tmp/debs-i686" fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-i686" x86-64_debs_cache: folder: "/tmp/debs-x86_64" fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-x86_64" output_artifacts: path: "./debs/*.deb" ## ## When doing release build (branch 'master'), upload built packages ## to APT repository on Bintray. ## task: container: cpu: 1 memory: 4 name: Upload packages to Bintray only_if: $CIRRUS_BRANCH == 'master' timeout_in: 60m depends_on: - Build packages environment: BINTRAY_USERNAME: imprakharshukla BINTRAY_API_KEY: ENCRYPTED[6dd62eec639e531a066d198368d73a890d91f28d92652b4b7b4eed40a175c1bb13b43b66e74441c3d4b7e85d2eb3e808] BINTRAY_GPG_SUBJECT: andronixapp BINTRAY_GPG_PASSPHRASE: ENCRYPTED[c766a2569ac7b479de6aba07da6ba146e90d96013cdc8a86d1d68e4d76e9e855c05d93f8727d2838140856ff85ac655a] TERMUX_ANDROID_HOME: /data/data/studio.com.techriz.andronix/files/home TERMUX_PREFIX: /data/data/studio.com.techriz.andronix/files/usr # Do not use built-in git client provided by Cirrus as it may # cause problems when determining changed files. clone_script: | if [[ -z "$CIRRUS_PR" ]]; then git clone --recursive --branch="$CIRRUS_BRANCH" "https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git" "$CIRRUS_WORKING_DIR" git reset --hard "$CIRRUS_CHANGE_IN_REPO" else git clone --recursive "https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git" "$CIRRUS_WORKING_DIR" git fetch origin "pull/$CIRRUS_PR/head:pull/$CIRRUS_PR" git reset --hard "$CIRRUS_CHANGE_IN_REPO" fi aarch64_debs_cache: folder: "./debs" fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-aarch64" arm_debs_cache: folder: "./debs" fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-arm" i686_debs_cache: folder: "./debs" fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-i686" x86-64_debs_cache: folder: "./debs" fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-x86_64" script: | bash ./scripts/build/ci/cirrus-ci_dispatcher.sh --upload ================================================ FILE: .github/main.workflow ================================================ workflow "Discord" { on = "check_suite" resolves = "Discord Webhook" } action "Discord Webhook" { uses = "docker://cirrusactions/discord:latest" secrets = ["WEBHOOK_URL"] } ================================================ FILE: .gitignore ================================================ ### Vim ### [._]*.s[a-w][a-z] [._]s[a-w][a-z] *.un~ Session.vim .netrwhist *~ /debs/ ### Vagrant ### scripts/*.log scripts/.vagrant/ env.sh /scripts/env.sh env.sh env2.sh bootstrap-aarch64.zip bootstrap-arm.zip bootstrap-i686.zip bootstrap-x86_64.zip ================================================ FILE: LICENSE.md ================================================ # License for package patches The scripts and patches to build each package is licensed under the same license as the actual package (so the patches and scripts to build bash are licensed under the same license as bash, while the patches and scripts to build python are licensed under the same license as python). # License for the build infrastructure For build infrastructure outside the `packages/` folder the license is [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). ================================================ FILE: README.md ================================================

      [![build status](https://api.cirrus-ci.com/github/imprakharshukla/termux-packages.svg?branch=master)](https://cirrus-ci.com/andronixapp/termux-packages) This project contains all the essential packages and utilities required to build packages for **Termux integrated within Andronix**.

Find the packages @ [official Andronix Repository](https://androfile.online)

> Do not confuse this repository with the official [Termux packages repository](https://github.com/termux/termux-packages). Packages built with the instructions given in this project will not work across apps. ***DO NOT MIX THE PACKAGES WITH THE OFFICIAL TERMUX REPOSITORY IN YOUR ANDRONIX INSTALLATION (visa versa).***

Termux package management quick how-to available on https://github.com/imprakharshukla/termux-packages/wiki. To learn about using our build environment, read the [Developer's Wiki](https://github.com/imprakharshukla/termux-packages/wiki). ## Project structure There 2 main branches available: - [master] - packages for Android 7.0 or higher. Directories: - [disabled-packages](disabled-packages/): Packages that cannot be published due to serious issues. - [ndk-patches](ndk-patches/): Our changes to Android NDK headers. - [packages](packages/): Main set of packages. - [sample](sample/): Sample structure for creating new packages. - [scripts](scripts/): Set of utilities and build system scripts. ## Contributing ### Bug reports Do not request the addition of any packages. We are using the bare minimum packages like `proot,tar,pulseaudio` for example. We will only be updating those packages. **Rest all the packages will be not maintained.** ## Reach us **AndroNix communities** Twitter- https://twitter.com/AndronixApp Telegram- https://t.me/AndronixApp Discord- https://discord.gg/jywhBH4 ## Credits Termux- https://play.google.com/store/apps/details?id=com.termux ================================================ FILE: build-all.sh ================================================ #!/bin/bash # build-all.sh - script to build all packages with a build order specified by buildorder.py set -e -u -o pipefail if [ "$(uname -o)" = "Android" ] || [ -e "/system/bin/app_process" ]; then echo "On-device execution of this script is not supported." exit 1 fi # Read settings from .termuxrc if existing test -f $HOME/.termuxrc && . $HOME/.termuxrc : ${TERMUX_TOPDIR:="$HOME/.termux-build"} : ${TERMUX_ARCH:="aarch64"} : ${TERMUX_DEBUG:=""} : ${TERMUX_INSTALL_DEPS:="-s"} # Set TERMUX_INSTALL_DEPS to -s unless set to -i _show_usage() { echo "Usage: ./build-all.sh [-a ARCH] [-d] [-i] [-o DIR]" echo "Build all packages." echo " -a The architecture to build for: aarch64(default), arm, i686, x86_64 or all." echo " -d Build with debug symbols." echo " -i Build dependencies." echo " -o Specify deb directory. Default: debs/." exit 1 } while getopts :a:hdio: option; do case "$option" in a) TERMUX_ARCH="$OPTARG";; d) TERMUX_DEBUG='-d';; i) TERMUX_INSTALL_DEPS='-i';; o) TERMUX_DEBDIR="$(realpath -m $OPTARG)";; h) _show_usage;; esac done shift $((OPTIND-1)) if [ "$#" -ne 0 ]; then _show_usage; fi if [[ ! "$TERMUX_ARCH" =~ ^(all|aarch64|arm|i686|x86_64)$ ]]; then echo "ERROR: Invalid arch '$TERMUX_ARCH'" 1>&2 exit 1 fi BUILDSCRIPT=$(dirname $0)/build-package.sh BUILDALL_DIR=$TERMUX_TOPDIR/_buildall-$TERMUX_ARCH BUILDORDER_FILE=$BUILDALL_DIR/buildorder.txt BUILDSTATUS_FILE=$BUILDALL_DIR/buildstatus.txt if [ -e $BUILDORDER_FILE ]; then echo "Using existing buildorder file: $BUILDORDER_FILE" else mkdir -p $BUILDALL_DIR ./scripts/buildorder.py > $BUILDORDER_FILE fi if [ -e $BUILDSTATUS_FILE ]; then echo "Continuing build-all from: $BUILDSTATUS_FILE" fi exec > >(tee -a $BUILDALL_DIR/ALL.out) exec 2> >(tee -a $BUILDALL_DIR/ALL.err >&2) trap "echo ERROR: See $BUILDALL_DIR/\${PKG}.err" ERR while read PKG PKG_DIR; do # Check build status (grepping is a bit crude, but it works) if [ -e $BUILDSTATUS_FILE ] && grep "^$PKG\$" $BUILDSTATUS_FILE >/dev/null; then echo "Skipping $PKG" continue fi echo -n "Building $PKG... " BUILD_START=$(date "+%s") bash -x $BUILDSCRIPT -a $TERMUX_ARCH $TERMUX_DEBUG \ ${TERMUX_DEBDIR+-o $TERMUX_DEBDIR} $TERMUX_INSTALL_DEPS $PKG_DIR \ > $BUILDALL_DIR/${PKG}.out 2> $BUILDALL_DIR/${PKG}.err BUILD_END=$(date "+%s") BUILD_SECONDS=$(( $BUILD_END - $BUILD_START )) echo "done in $BUILD_SECONDS" # Update build status echo "$PKG" >> $BUILDSTATUS_FILE done<${BUILDORDER_FILE} # Update build status rm -f $BUILDSTATUS_FILE echo "Finished" ================================================ FILE: build-package.sh ================================================ #!/bin/bash # shellcheck disable=SC1117 set -e -o pipefail -u : "${TMPDIR:=/tmp}" export TMPDIR if [ "$(uname -o)" = "Android" ] || [ -e "/system/bin/app_process" ]; then if [ "$(id -u)" = "0" ]; then echo "On-device execution of this script as root is disabled." exit 1 fi # This variable tells all parts of build system that build # is performed on device. export TERMUX_ON_DEVICE_BUILD=true else export TERMUX_ON_DEVICE_BUILD=false fi cd "$(realpath "$(dirname "$0")")" TERMUX_SCRIPTDIR=$(pwd) export TERMUX_SCRIPTDIR # Lock file to prevent parallel running in the same environment. TERMUX_BUILD_LOCK_FILE="${TMPDIR}/.termux-build.lck" if [ ! -e "$TERMUX_BUILD_LOCK_FILE" ]; then touch "$TERMUX_BUILD_LOCK_FILE" fi # Special variable for internal use. It forces script to ignore # lock file. : "${TERMUX_BUILD_IGNORE_LOCK:=false}" # Utility function to log an error message and exit with an error code. # shellcheck source=scripts/build/termux_error_exit.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_error_exit.sh" # Utility function to download a resource with an expected checksum. # shellcheck source=scripts/build/termux_download.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_download.sh" # Utility function for golang-using packages to setup a go toolchain. # shellcheck source=scripts/build/setup/termux_setup_golang.sh source "$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_golang.sh" # Utility function for rust-using packages to setup a rust toolchain. # shellcheck source=scripts/build/setup/termux_setup_rust.sh source "$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_rust.sh" # Utility function to setup a current ninja build system. # shellcheck source=scripts/build/setup/termux_setup_ninja.sh source "$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_ninja.sh" # Utility function to setup a current meson build system. # shellcheck source=scripts/build/setup/termux_setup_meson.sh source "$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_meson.sh" # Utility function to setup a current cmake build system # shellcheck source=scripts/build/setup/termux_setup_cmake.sh source "$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_cmake.sh" # Utility function to setup protobuf: # shellcheck source=scripts/build/setup/termux_setup_protobuf.sh source "$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_protobuf.sh" # Setup variables used by the build. Not to be overridden by packages. # shellcheck source=scripts/build/termux_step_setup_variables.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_setup_variables.sh" # Save away and restore build setups which may change between builds. # shellcheck source=scripts/build/termux_step_handle_buildarch.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_handle_buildarch.sh" # Function to get TERMUX_PKG_VERSION from build.sh # shellcheck source=scripts/build/termux_extract_dep_info.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_extract_dep_info.sh" # Function that downloads a .deb (using the termux_download function) # shellcheck source=scripts/build/termux_download_deb.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_download_deb.sh" # Script to download InRelease, verify it's signature and then download Packages.xz by hash # shellcheck source=scripts/build/termux_get_repo_files.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_get_repo_files.sh" # Source the package build script and start building. No to be overridden by packages. # shellcheck source=scripts/build/termux_step_start_build.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_start_build.sh" # Run just after sourcing $TERMUX_PKG_BUILDER_SCRIPT. May be overridden by packages. # shellcheck source=scripts/build/termux_step_extract_package.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_extract_package.sh" # Hook for packages to act just after the package has been extracted. # Invoked in $TERMUX_PKG_SRCDIR. termux_step_post_extract_package() { return } # Optional host build. Not to be overridden by packages. # shellcheck source=scripts/build/termux_step_handle_hostbuild.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_handle_hostbuild.sh" # Perform a host build. Will be called in $TERMUX_PKG_HOSTBUILD_DIR. # After termux_step_post_extract_package() and before termux_step_patch_package() # shellcheck source=scripts/build/termux_step_host_build.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_host_build.sh" # Setup a standalone Android NDK toolchain. Not to be overridden by packages. # shellcheck source=scripts/build/termux_step_setup_toolchain.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_setup_toolchain.sh" # Apply all *.patch files for the package. Not to be overridden by packages. # shellcheck source=scripts/build/termux_step_patch_package.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_patch_package.sh" # Replace autotools build-aux/config.{sub,guess} with ours to add android targets. # shellcheck source=scripts/build/termux_step_replace_guess_scripts.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_replace_guess_scripts.sh" # For package scripts to override. Called in $TERMUX_PKG_BUILDDIR. termux_step_pre_configure() { return } # Setup configure args and run $TERMUX_PKG_SRCDIR/configure. This function is called from termux_step_configure # shellcheck source=scripts/build/configure/termux_step_configure_autotools.sh source "$TERMUX_SCRIPTDIR/scripts/build/configure/termux_step_configure_autotools.sh" # Setup configure args and run cmake. This function is called from termux_step_configure # shellcheck source=scripts/build/configure/termux_step_configure_cmake.sh source "$TERMUX_SCRIPTDIR/scripts/build/configure/termux_step_configure_cmake.sh" # Setup configure args and run meson. This function is called from termux_step_configure # shellcheck source=scripts/build/configure/termux_step_configure_meson.sh source "$TERMUX_SCRIPTDIR/scripts/build/configure/termux_step_configure_meson.sh" # Configure the package # shellcheck source=scripts/build/configure/termux_step_configure.sh source "$TERMUX_SCRIPTDIR/scripts/build/configure/termux_step_configure.sh" # Hook for packages after configure step termux_step_post_configure() { return } # Make package, either with ninja or make # shellcheck source=scripts/build/termux_step_make.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_make.sh" # Make install, either with ninja, make of cargo # shellcheck source=scripts/build/termux_step_make_install.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_make_install.sh" # Hook function for package scripts to override. termux_step_post_make_install() { return } # Link/copy the LICENSE for the package to $TERMUX_PREFIX/share/$TERMUX_PKG_NAME/ # shellcheck source=scripts/build/termux_step_install_license.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_install_license.sh" # Function to cp (through tar) installed files to massage dir # shellcheck source=scripts/build/termux_step_extract_into_massagedir.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_extract_into_massagedir.sh" # Create all subpackages. Run from termux_step_massage # shellcheck source=scripts/build/termux_create_subpackages.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_create_subpackages.sh" # Function to run various cleanup/fixes # shellcheck source=scripts/build/termux_step_massage.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_massage.sh" # Hook for packages after massage step termux_step_post_massage() { return } # Create data.tar.gz with files to package. Not to be overridden by package scripts. # shellcheck source=scripts/build/termux_step_create_datatar.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_create_datatar.sh" # Hook function to create {pre,post}install, {pre,post}rm-scripts and similar termux_step_create_debscripts() { return } # Create the build deb file. Not to be overridden by package scripts. # shellcheck source=scripts/build/termux_step_create_debfile.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_create_debfile.sh" # Finish the build. Not to be overridden by package scripts. # shellcheck source=scripts/build/termux_step_finish_build.sh source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_finish_build.sh" ################################################################################ # shellcheck source=scripts/properties.sh . "$TERMUX_SCRIPTDIR/scripts/properties.sh" if [ "$TERMUX_ON_DEVICE_BUILD" = "true" ]; then # For on device builds cross compiling is not supported. # Target architecture must be same as for environment used currently. TERMUX_ARCH=$(dpkg --print-architecture) export TERMUX_ARCH fi _show_usage() { echo "Usage: ./build-package.sh [options] PACKAGE_1 PACKAGE_2 ..." echo echo "Build a package by creating a .deb file in the debs/ folder." echo echo "Available options:" [ "$TERMUX_ON_DEVICE_BUILD" = "false" ] && echo " -a The architecture to build for: aarch64(default), arm, i686, x86_64 or all." echo " -d Build with debug symbols." echo " -D Build a disabled package in disabled-packages/." echo " -f Force build even if package has already been built." [ "$TERMUX_ON_DEVICE_BUILD" = "false" ] && echo " -i Download and extract dependencies instead of building them." echo " -I Download and extract dependencies instead of building them, keep existing /data/data/com.termux files." echo " -q Quiet build." echo " -s Skip dependency check." echo " -o Specify deb directory. Default: debs/." exit 1 } while getopts :a:hdDfiIqso: option; do case "$option" in a) if [ "$TERMUX_ON_DEVICE_BUILD" = "true" ]; then termux_error_exit "./build-package.sh: option '-a' is not available for on-device builds" else export TERMUX_ARCH="$OPTARG" fi ;; h) _show_usage;; d) export TERMUX_DEBUG=true;; D) TERMUX_IS_DISABLED=true;; f) TERMUX_FORCE_BUILD=true;; i) if [ "$TERMUX_ON_DEVICE_BUILD" = "true" ]; then termux_error_exit "./build-package.sh: option '-i' is not available for on-device builds" else export TERMUX_INSTALL_DEPS=true fi ;; I) export TERMUX_INSTALL_DEPS=true && export TERMUX_NO_CLEAN=true;; q) export TERMUX_QUIET_BUILD=true;; s) export TERMUX_SKIP_DEPCHECK=true;; o) TERMUX_DEBDIR=$(realpath -m "$OPTARG");; ?) termux_error_exit "./build-package.sh: illegal option -$OPTARG";; esac done shift $((OPTIND-1)) if [ "$#" -lt 1 ]; then _show_usage; fi unset -f _show_usage while (($# > 0)); do # Following commands must be executed under lock to prevent running # multiple instances of "./build-package.sh". # # To provide sane environment for each package, builds are done # in subshell. ( if ! $TERMUX_BUILD_IGNORE_LOCK; then flock -n 5 || termux_error_exit "Another build is already running within same environment." fi # Handle 'all' arch: if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ] && [ -n "${TERMUX_ARCH+x}" ] && [ "${TERMUX_ARCH}" = 'all' ]; then for arch in 'aarch64' 'arm' 'i686' 'x86_64'; do env TERMUX_ARCH="$arch" TERMUX_BUILD_IGNORE_LOCK=true ./build-package.sh \ ${TERMUX_FORCE_BUILD+-f} ${TERMUX_INSTALL_DEPS+-i} ${TERMUX_IS_DISABLED+-D} \ ${TERMUX_DEBUG+-d} ${TERMUX_DEBDIR+-o $TERMUX_DEBDIR} "$1" done exit fi # Check the package to build: TERMUX_PKG_NAME=$(basename "$1") if [[ $1 == *"/"* ]]; then # Path to directory which may be outside this repo: if [ ! -d "$1" ]; then termux_error_exit "'$1' seems to be a path but is not a directory"; fi export TERMUX_PKG_BUILDER_DIR TERMUX_PKG_BUILDER_DIR=$(realpath "$1") else # Package name: if [ -n "${TERMUX_IS_DISABLED=""}" ]; then export TERMUX_PKG_BUILDER_DIR=$TERMUX_SCRIPTDIR/disabled-packages/$TERMUX_PKG_NAME else export TERMUX_PKG_BUILDER_DIR=$TERMUX_SCRIPTDIR/packages/$TERMUX_PKG_NAME fi fi TERMUX_PKG_BUILDER_SCRIPT=$TERMUX_PKG_BUILDER_DIR/build.sh if test ! -f "$TERMUX_PKG_BUILDER_SCRIPT"; then termux_error_exit "No build.sh script at package dir $TERMUX_PKG_BUILDER_DIR!" fi termux_step_setup_variables termux_step_handle_buildarch termux_step_start_build termux_step_extract_package cd "$TERMUX_PKG_SRCDIR" termux_step_post_extract_package termux_step_handle_hostbuild termux_step_setup_toolchain termux_step_patch_package termux_step_replace_guess_scripts cd "$TERMUX_PKG_SRCDIR" termux_step_pre_configure cd "$TERMUX_PKG_BUILDDIR" termux_step_configure cd "$TERMUX_PKG_BUILDDIR" termux_step_post_configure cd "$TERMUX_PKG_BUILDDIR" termux_step_make cd "$TERMUX_PKG_BUILDDIR" termux_step_make_install cd "$TERMUX_PKG_BUILDDIR" termux_step_post_make_install termux_step_install_license cd "$TERMUX_PKG_MASSAGEDIR" termux_step_extract_into_massagedir cd "$TERMUX_PKG_MASSAGEDIR" termux_step_massage cd "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX" termux_step_post_massage termux_step_create_datatar termux_step_create_debfile termux_step_finish_build ) 5< "$TERMUX_BUILD_LOCK_FILE" shift 1 done ================================================ FILE: clean.sh ================================================ #!/bin/sh # clean.sh - clean everything. set -e -u # Checking if script is running on Android with 2 different methods. # Needed for safety to prevent execution of potentially dangerous # operations such as 'rm -rf /data/*' on Android device. if [ "$(uname -o)" = "Android" ] || [ -e "/system/bin/app_process" ]; then TERMUX_ON_DEVICE_BUILD=true else TERMUX_ON_DEVICE_BUILD=false fi if [ "$(id -u)" = "0" ] && $TERMUX_ON_DEVICE_BUILD; then echo "On-device execution of this script as root is disabled." exit 1 fi # Read settings from .termuxrc if existing test -f "$HOME/.termuxrc" && . "$HOME/.termuxrc" : "${TERMUX_TOPDIR:="$HOME/.termux-build"}" : "${TMPDIR:=/tmp}" export TMPDIR # Lock file. Same as used in build-package.sh. TERMUX_BUILD_LOCK_FILE="${TMPDIR}/.termux-build.lck" if [ ! -e "$TERMUX_BUILD_LOCK_FILE" ]; then touch "$TERMUX_BUILD_LOCK_FILE" fi { if ! flock -n 5; then echo "Not cleaning build directory since you have unfinished build running." exit 1 fi if [ -d "$TERMUX_TOPDIR" ]; then chmod +w -R "$TERMUX_TOPDIR" fi if $TERMUX_ON_DEVICE_BUILD; then # For on-device build cleanup /data shouldn't be erased. rm -Rf "$TERMUX_TOPDIR" else rm -Rf /data/* "$TERMUX_TOPDIR" fi } 5< "$TERMUX_BUILD_LOCK_FILE" ================================================ FILE: disabled-packages/abuild/Makefile.patch ================================================ diff -u -r ../abuild-3.2.0/Makefile ./Makefile --- ../abuild-3.2.0/Makefile 2018-06-22 07:24:10.000000000 +0000 +++ ./Makefile 2018-11-18 01:32:10.950452195 +0000 @@ -95,7 +95,6 @@ for i in $(USR_BIN_FILES); do\ install -m 755 $$i $(DESTDIR)/$(bindir)/$$i;\ done - chmod 4111 $(DESTDIR)/$(prefix)/bin/abuild-sudo for i in adduser addgroup apk; do \ ln -fs abuild-sudo $(DESTDIR)/$(bindir)/abuild-$$i; \ done ================================================ FILE: disabled-packages/abuild/abuild-fetch.c.patch ================================================ diff -uNr abuild-3.4.0/abuild-fetch.c abuild-3.4.0.mod/abuild-fetch.c --- abuild-3.4.0/abuild-fetch.c 2019-06-14 15:13:23.000000000 +0300 +++ abuild-3.4.0.mod/abuild-fetch.c 2019-07-21 16:45:34.475241394 +0300 @@ -189,7 +189,7 @@ int main(int argc, char *argv[]) { int opt; - char *destdir = "/var/cache/distfiles"; + char *destdir = "@TERMUX_PREFIX@/var/cache/distfiles"; program = argv[0]; while ((opt = getopt(argc, argv, "hd:")) != -1) { ================================================ FILE: disabled-packages/abuild/abuild-keygen.in.patch ================================================ --- abuild-3.2.0/abuild-keygen.in 2018-06-22 10:24:10.000000000 +0300 +++ abuild-3.2.0.mod/abuild-keygen.in 2018-11-18 20:02:12.017576128 +0200 @@ -56,14 +56,14 @@ if [ -n "$install_pubkey" ]; then - msg "Installing $pubkey to /etc/apk/keys..." - sudo mkdir -p /etc/apk/keys - sudo cp -i "$pubkey" /etc/apk/keys/ + msg "Installing $pubkey to \$PREFIX/etc/apk/keys..." + mkdir -p @TERMUX_PREFIX@/etc/apk/keys + cp -i "$pubkey" @TERMUX_PREFIX@/etc/apk/keys/ else msg "" msg "You'll need to install $pubkey into " - msg "/etc/apk/keys to be able to install packages and repositories signed with" + msg "\$PREFIX/etc/apk/keys to be able to install packages and repositories signed with" msg "$privkey" fi @@ -94,7 +94,7 @@ Options: -a, --append Set PACKAGER_PRIVKEY= in $ABUILD_USERCONF - -i, --install Install public key into /etc/apk/keys using sudo + -i, --install Install public key into \$PREFIX/etc/apk/keys -n Non-interactive. Use defaults -q, --quiet -h, --help Show this help ================================================ FILE: disabled-packages/abuild/abuild-rmtemp.c.patch ================================================ --- abuild-3.2.0/abuild-rmtemp.c 2018-06-22 10:24:10.000000000 +0300 +++ abuild-3.2.0.mod/abuild-rmtemp.c 2018-11-18 19:54:49.254290401 +0200 @@ -16,7 +16,7 @@ #include #include -#define PREFIX "/var/tmp/abuild." +#define PREFIX "@TERMUX_PREFIX@/var/tmp/abuild." static void fail() { errx(1, "%s", strerror(errno)); @@ -29,10 +29,12 @@ int main(int argc, char **argv) { if (argc < 2) return 0; +#ifndef __ANDROID__ if (getuid()) { argv[0] = "-abuild-rmtemp"; execv("/usr/bin/abuild-sudo", argv); } +#endif if (strncmp(argv[1], PREFIX, strlen(PREFIX)) || \ strchr(argv[1] + strlen(PREFIX), '/')) @@ -40,9 +42,12 @@ struct stat s; if (lstat(argv[1], &s)) fail(); + +#ifndef __ANDROID__ struct passwd *p = getpwnam(getenv("USER")); if (!p) errx(1, "Incorrect user"); if (s.st_uid != p->pw_uid) errx(1, "Permission denied"); +#endif if (nftw(argv[1], handler, 512, FTW_DEPTH)) fail(); ================================================ FILE: disabled-packages/abuild/abuild-sign.in.patch ================================================ --- abuild-3.2.0/abuild-sign.in 2018-06-22 10:24:10.000000000 +0300 +++ abuild-3.2.0.mod/abuild-sign.in 2018-11-18 20:28:48.283970248 +0200 @@ -51,7 +51,7 @@ -e, --installed Check only of there exist a private key for signing -k, --private KEY The private key to use for signing -p, --public KEY The name of public key. apk add will look for - /etc/apk/keys/KEY + \$PREFIX/etc/apk/keys/KEY -q, --quiet -h, --help Show this help ================================================ FILE: disabled-packages/abuild/abuild.conf.patch ================================================ diff -uNr abuild-3.2.0/abuild.conf abuild-3.2.0.mod/abuild.conf --- abuild-3.2.0/abuild.conf 2018-06-22 10:24:10.000000000 +0300 +++ abuild-3.2.0.mod/abuild.conf 2018-11-18 16:42:45.897130881 +0200 @@ -1,4 +1,4 @@ -export CFLAGS="-Os -fomit-frame-pointer" +export CFLAGS="-Os" export CXXFLAGS="$CFLAGS" export CPPFLAGS="$CFLAGS" export LDFLAGS="-Wl,--as-needed" @@ -9,7 +9,7 @@ # remove line below to disable colors USE_COLORS=1 -SRCDEST=/var/cache/distfiles +SRCDEST=@TERMUX_PREFIX@/var/cache/distfiles # uncomment line below to store built packages in other location # The package will be stored as $REPODEST/$repo/$pkgname-$pkgver-r$pkgrel.apk ================================================ FILE: disabled-packages/abuild/abuild.in.patch ================================================ diff -uNr abuild-3.4.0/abuild.in abuild-3.4.0.mod/abuild.in --- abuild-3.4.0/abuild.in 2019-06-14 15:13:23.000000000 +0300 +++ abuild-3.4.0.mod/abuild.in 2019-07-21 16:56:56.898285307 +0300 @@ -1,4 +1,4 @@ -#!/bin/ash -e +#!/bin/bash -e # abuild - build apk packages (light version of makepkg) # Copyright (c) 2008-2015 Natanael Copa @@ -21,11 +21,7 @@ . "$datadir/functions.sh" # defaults -: ${FAKEROOT:="fakeroot"} -: ${SUDO_APK:="abuild-apk"} : ${APK:="apk"} -: ${ADDUSER:="abuild-adduser"} -: ${ADDGROUP:="abuild-addgroup"} apk_opt_wait="--wait 30" @@ -438,7 +434,7 @@ initdcheck || return 1 mkdir -p "$srcdir" local gunzip=$(command -v pigz || echo gunzip) - [ $gunzip = "/usr/bin/pigz" ] && gunzip="$gunzip -d" + [ $gunzip = "@TERMUX_PREFIX@/bin/pigz" ] && gunzip="$gunzip -d" for u in $source; do local s if is_remote "$u"; then @@ -466,7 +462,7 @@ *.tar.xz) msg "Unpacking $s..." local threads_opt - if [ $(readlink -f $(command -v unxz)) != "/bin/busybox" ]; then + if [ $(realpath $(command -v unxz)) != "@TERMUX_PREFIX@/bin/busybox" ]; then threads_opt="--threads=0" fi unxz $threads_opt -c "$s" | tar -C "$srcdir" -x || return 1;; @@ -554,26 +550,6 @@ return 0 } -mkusers() { - local i - for i in $pkggroups; do - if ! getent group $i >/dev/null; then - msg "Creating group $i" - $ADDGROUP -S $i || return 1 - fi - done - for i in $pkgusers; do - if ! getent passwd $i >/dev/null; then - local gopt= - msg "Creating user $i" - if getent group $i >/dev/null; then - gopt="-G $i" - fi - $ADDUSER -S -D -H $gopt $i || return 1 - fi - done -} - # helper to update config.sub to a recent version update_config_sub() { find . -name config.sub | (local changed=false; while read f; do @@ -687,10 +663,10 @@ find "$dir" -name '*.la' -type f -delete fi - # look for /usr/lib/charset.alias - if [ -e "$dir"/usr/lib/charset.alias ] \ + # look for @TERMUX_PREFIX@/lib/charset.alias + if [ -e "$dir"/@TERMUX_PREFIX@/lib/charset.alias ] \ && ! options_has "charset.alias"; then - error "Found /usr/lib/charset.alias" + error "Found @TERMUX_PREFIX@/lib/charset.alias" return 1 fi # look for /etc/init.d and /etc/conf.d @@ -704,22 +680,15 @@ warning "Found static archive on ${i##*$dir/} but name doesn't end with -static" done fi - # look for /usr/share/doc - if [ -e "$dir"/usr/share/doc ] \ + # look for @TERMUX_PREFIX@/share/doc + if [ -e "$dir"/@TERMUX_PREFIX@/share/doc ] \ && ! is_doc_pkg "$name"; then - warning "Found /usr/share/doc but package name doesn't end with -doc" + warning "Found @TERMUX_PREFIX@/share/doc but package name doesn't end with -doc" fi - # look for /usr/share/man - if [ -e "$dir"/usr/share/man ]; then + # look for @TERMUX_PREFIX@/share/man + if [ -e "$dir"/@TERMUX_PREFIX@/share/man ]; then if ! is_doc_pkg "$name"; then - warning "Found /usr/share/man but package name doesn't end with -doc" - fi - # check for uncompressed man pages - i=$(find "$dir"/usr/share/man -name '*.[0-8]' -type f | sed "s|^$dir|\t|") - if [ -n "$i" ]; then - error "Found uncompressed man pages:" - echo "$i" - return 1 + warning "Found @TERMUX_PREFIX@/share/man but package name doesn't end with -doc" fi fi # check directory permissions @@ -780,9 +749,9 @@ && postcheck "$pkgbasedir/$subpkgname" "$subpkgname" ) || return 1 done postcheck "$pkgdir" "$pkgname" || return 1 - # post check for /usr/share/locale - if [ -d "$pkgdir"/usr/share/locale ]; then - warning "Found /usr/share/locale" + # post check for @TERMUX_PREFIX@/share/locale + if [ -d "$pkgdir"/@TERMUX_PREFIX@/share/locale ]; then + warning "Found @TERMUX_PREFIX@/share/locale" warning2 "Maybe add \$pkgname-lang to subpackages?" fi } @@ -792,7 +761,7 @@ install_if="$pkgname=$pkgver-r$pkgrel lang" local dir - for dir in ${langdir:-/usr/share/locale}; do + for dir in ${langdir:-@TERMUX_PREFIX@/share/locale}; do mkdir -p "$subpkgdir"/${dir%/*} mv "$pkgdir"/"$dir" "$subpkgdir"/"$dir" || return 1 done @@ -811,7 +780,7 @@ install_if="$pkgname=$pkgver-r$pkgrel lang-$lang" local dir - for dir in ${langdir:-/usr/share/locale}; do + for dir in ${langdir:-@TERMUX_PREFIX@/share/locale}; do mkdir -p "$subpkgdir"/$dir mv "$pkgdir"/$dir/$lang* \ "$subpkgdir"/$dir/ \ @@ -866,7 +835,7 @@ check_license() { local ret=0 - local license_list=/usr/share/spdx/license.lst + local license_list=@TERMUX_PREFIX@/share/spdx/license.lst local exclude="AND OR WITH" if options_has "!spdx" || ! [ -f "$license_list" ]; then return 0 @@ -939,10 +908,7 @@ local builddate=$(date -u "+%s") # Fix package size on several filesystems - case "$(df -PT . | awk 'END {print $2}')" in - btrfs|ecryptfs|zfs) - sync;; - esac + sync local size=$(du -sk | awk '{print $1 * 1024}') @@ -955,7 +921,7 @@ echo "# Generated by $(basename "$abuild_path") $program_version" >"$pkginfo" if [ -n "$FAKEROOTKEY" ]; then - echo "# using $($FAKEROOT -v)" >> "$pkginfo" + echo "# using $(fakeroot -v)" >> "$pkginfo" fi echo "# $(date -u)" >> "$pkginfo" cat >> "$pkginfo" <<-EOF @@ -975,9 +941,9 @@ for i in $install $triggers; do local s=${i%=*} [ "$name" != "${s%.*}" ] && continue - if head -n 1 "$startdir/$s" | grep '^#!/bin/sh' >/dev/null ; then - msg "Script found. /bin/sh added as a dependency for $pkg" - deps="$deps /bin/sh" + if head -n 1 "$startdir/$s" | grep '^#!@TERMUX_PREFIX@/bin/sh' >/dev/null ; then + msg "Script found. @TERMUX_PREFIX@/bin/sh added as a dependency for $pkg" + deps="$deps @TERMUX_PREFIX@/bin/sh" break fi done @@ -1049,8 +1015,8 @@ scanelf --quiet --recursive --rpath "$dir" \ | sed -e 's/[[:space:]].*//' -e 's/:/\n/' | sort -u \ >"$controldir"/.rpaths - if grep -q -x '/usr/lib' "$controldir"/.rpaths; then - warning "Redundant /usr/lib in rpath found" + if grep -q -x '@TERMUX_PREFIX@/lib' "$controldir"/.rpaths; then + warning "Redundant @TERMUX_PREFIX@/lib in rpath found" fi if grep '^/home/' "$controldir"/.rpaths; then error "Has /home/... in rpath" @@ -1076,12 +1042,12 @@ local dir="${subpkgdir:-$pkgdir}" options_has "!tracedeps" && return 0 cd "$dir" || return 1 - for i in usr/lib/pkgconfig/*.pc; do + for i in ./@TERMUX_PREFIX@/lib/pkgconfig/*.pc; do if ! [ -e "$i" ]; then continue fi local f=${i##*/} - local v=$(PKG_CONFIG_PATH="$dir"/usr/lib/pkgconfig PKG_CONFIG_MAXIMUM_TRAVERSE_DEPTH=1 pkg-config \ + local v=$(PKG_CONFIG_PATH="$dir"/@TERMUX_PREFIX@/lib/pkgconfig PKG_CONFIG_MAXIMUM_TRAVERSE_DEPTH=1 pkg-config \ --modversion ${f%.pc}) echo "$pcprefix${f%.pc}=${v:-0}" >> "$controldir"/.provides-pc done @@ -1176,12 +1142,19 @@ return 1 } -# search rpaths and /usr/lib /lib for given so files +# search rpaths and @TERMUX_PREFIX@/lib for given so files find_so_files() { + local android_libs local rpaths=$(cat "$1") shift + + case ${CTARGET_ARCH} in + aarch64|x86_64) android_libs="/system/lib64" ;; + *) android_libs="/system/lib" ;; + esac + while [ $# -gt 0 ]; do - real_so_path "$1" /usr/lib /lib $rpaths || return 1 + real_so_path "$1" @TERMUX_PREFIX@/lib $rpaths $android_libs || return 1 shift done return 0 @@ -1219,20 +1192,12 @@ esac msg "Tracing dependencies..." - # add pkgconfig if usr/lib/pkgconfig is found - if [ -d "$pkgbasedir"/$name/usr/lib/pkgconfig ] \ + # add pkgconfig if @TERMUX_PREFIX@/lib/pkgconfig is found + if [ -d "$pkgbasedir"/$name/@TERMUX_PREFIX@/lib/pkgconfig ] \ && ! grep -q '^depend = pkgconfig' "$dir"/.PKGINFO; then autodeps="$autodeps pkgconfig" fi - # special case for libpthread: we need depend on libgcc - if [ "$CLIBC" = "uclibc" ] && [ -f "$dir"/.needs-so ] \ - && grep -q -w '^libpthread.so.*' "$dir"/.needs-so \ - && ! grep -q -w "^depend = libgcc" "$dir"/.PKGINFO; then - autodeps="$autodeps libgcc" - msg " added libgcc (due to libpthread)" - fi - [ -f "$dir"/.needs-so ] && for i in $(cat "$dir"/.needs-so); do # first check if its provided by same apkbuild grep -q -w "^$sonameprefix$i" "$dir"/.provides-so 2>/dev/null && continue @@ -1249,7 +1214,7 @@ # find all packages that holds the so files if [ -f "$dir"/.rpaths ]; then - local so_files=$(find_so_files "$dir"/.rpaths $missing) \ + local so_files=$(find_so_files "$dir"/.rpaths $missing | grep -v /system/lib) \ || return 1 deppkgs=$($APK $apkroot info --quiet --who-owns $so_files) || return 1 fi @@ -1283,7 +1248,7 @@ autodeps="$autodeps pc:$i" else warning "Could not find any provider for pc:$i" - local pcfile=/usr/lib/pkgconfig/"${i%%[<>=]*}".pc + local pcfile=@TERMUX_PREFIX@/lib/pkgconfig/"${i%%[<>=]*}".pc if [ -e "$pcfile" ]; then local owner=$($APK $apkroot info --quiet --who-owns $pcfile) warning "${owner:-package providing $pcfile} needs to be rebuilt" @@ -1315,7 +1280,7 @@ find_scanelf_paths() { local datadir="$1" - local paths="$datadir/lib:$datadir/usr/lib" i= rpaths= + local paths="$datadir/lib" i= rpaths= if [ -n "$ldpath" ]; then paths="$paths:$(echo "${datadir}${ldpath}" | sed "s|:|:$datadir|g")" fi @@ -1461,7 +1426,7 @@ name="$(pkginfo_val pkgname "$controldir"/.PKGINFO)" datadir="$pkgbasedir"/$name for i in $(sort -u "$provides_pc"); do - PKG_CONFIG_PATH="$datadir"/usr/lib/pkgconfig pkg-config \ + PKG_CONFIG_PATH="$datadir"/@TERMUX_PREFIX@/lib/pkgconfig pkg-config \ --print-requires \ --print-requires-private ${i%=*} \ | sed -E 's/\s*([<>=]+)\s*/\1/' \ @@ -1555,7 +1520,7 @@ logcmd "building $repo/$pkgname-$pkgver-r$pkgrel" local _starttime=$(date --utc +%s) msg "Building $repo/$pkgname $pkgver-r$pkgrel (using $program $program_version) started $(date -R)" - for part in sanitycheck builddeps clean fetch unpack prepare mkusers build \ + for part in sanitycheck builddeps clean fetch unpack prepare build \ $_check rootpkg; do runpart $part done @@ -1625,14 +1590,14 @@ local i for i in doc man info html sgml licenses gtk-doc ri help; do - if [ -d "$pkgdir/usr/share/$i" ]; then - mkdir -p "$subpkgdir/usr/share" - mv "$pkgdir/usr/share/$i" "$subpkgdir/usr/share/" + if [ -d "$pkgdir/@TERMUX_PREFIX@/share/$i" ]; then + mkdir -p "$subpkgdir/@TERMUX_PREFIX@/share" + mv "$pkgdir/@TERMUX_PREFIX@/share/$i" "$subpkgdir/@TERMUX_PREFIX@/share/" fi done # compress man pages - local mandir="$subpkgdir"/usr/share/man + local mandir="$subpkgdir"/@TERMUX_PREFIX@/share/man [ -d "$mandir" ] && find "$mandir" -type l \ -a \( -name \*.[0-8n] -o -name \*.[0-8][a-z]* \) \ -a \! \( -name '*.gz' -o -name '*.bz2' -o -name '*.xz' \) \ @@ -1664,10 +1629,10 @@ [ $islink -eq 0 ] && $gzip -9 "$name" done - rm -f "$subpkgdir/usr/share/info/dir" + rm -f "$subpkgdir/@TERMUX_PREFIX@/share/info/dir" # remove if empty, ignore error (not empty) - rmdir "$pkgdir/usr/share" "$pkgdir/usr" 2>/dev/null || : + rmdir "$pkgdir/@TERMUX_PREFIX@/share" "$pkgdir" 2>/dev/null || : } doc() { @@ -1682,19 +1647,15 @@ scanelf -R "$pkgdir" | grep ET_DYN | sed "s:$pkgdir\/::g" | sed "s:ET_DYN ::g" | while read f; do local ddbg_srcdir=$(dirname "$pkgdir/$f") local ddbg_srcfile=$(basename "$pkgdir/$f") - local ddbg_dstdir=$(dirname "$subpkgdir/usr/lib/debug/$f.debug") - local ddbg_dstfile=$(basename "$subpkgdir/usr/lib/debug/$f.debug") + local ddbg_dstdir=$(dirname "$subpkgdir/@TERMUX_PREFIX@/lib/debug/$f.debug") + local ddbg_dstfile=$(basename "$subpkgdir/@TERMUX_PREFIX@/lib/debug/$f.debug") mkdir -p "$ddbg_dstdir" cd "$ddbg_srcdir" - local xattr=$(getfattr --match="" --dump "${ddbg_srcfile}") ${CROSS_COMPILE}objcopy --only-keep-debug "$ddbg_srcfile" "$ddbg_dstfile" ${CROSS_COMPILE}objcopy --add-gnu-debuglink="$ddbg_dstfile" "$ddbg_srcdir/$ddbg_srcfile" mv "$ddbg_dstfile" "$ddbg_dstdir" ${CROSS_COMPILE}strip "$ddbg_srcfile" - if [ -n "$xattr" ]; then - echo "$xattr" | setfattr --restore=- - fi done return 0 } @@ -1710,14 +1671,14 @@ pkgdesc="$pkgdesc (development files)" cd "$pkgdir" || return 0 - local libdirs=usr/ + local libdirs=./@TERMUX_PREFIX@/lib [ -d lib/ ] && libdirs="lib/ $libdirs" - for i in usr/include usr/lib/pkgconfig usr/share/aclocal\ - usr/share/gettext usr/bin/*-config \ - usr/share/vala/vapi usr/share/gir-[0-9]*\ - usr/share/qt*/mkspecs \ - usr/lib/qt*/mkspecs \ - usr/lib/cmake \ + for i in ./@TERMUX_PREFIX@/lib/pkgconfig ./@TERMUX_PREFIX@/share/aclocal \ + ./@TERMUX_PREFIX@/share/gettext ./@TERMUX_PREFIX@/bin/*-config \ + ./@TERMUX_PREFIX@/share/vala/vapi ./@TERMUX_PREFIX@/share/gir-[0-9]* \ + ./@TERMUX_PREFIX@/share/qt*/mkspecs \ + ./@TERMUX_PREFIX@/lib/qt*/mkspecs \ + ./@TERMUX_PREFIX@/lib/cmake \ $(find . -name include -type d) \ $([ -z "${subpackages##*$pkgname-static*}" ] && find $libdirs \ -name '*.a' 2>/dev/null) \ @@ -1808,27 +1769,11 @@ type "$1" 2>&1 | head -n 1 | egrep -q "is a (shell )?function" } -do_fakeroot() { - if [ -n "$FAKEROOT" ]; then - $FAKEROOT -- "$@" - else - "$@" - fi -} - -# wrap check() with fakeroot -check_fakeroot() { - cd "$startdir" - [ -n "$FAKEROOT" ] && msg "Entering fakeroot..." - do_fakeroot "$abuild_path" $forceroot $color_opt $keep_build check -} - # build and package in fakeroot rootpkg() { cd "$startdir" rm -rf "$pkgdir" - [ -n "$FAKEROOT" ] && msg "Entering fakeroot..." - do_fakeroot "$abuild_path" $forceroot $color_opt $keep_build \ + "$abuild_path" $forceroot $color_opt $keep_build \ package \ prepare_subpackages \ prepare_language_packs \ @@ -2151,7 +2096,7 @@ $install_deps $recursive $upgrade $color_opt \ abuildindex || return 1 done - $SUDO_APK add --upgrade --repository "$REPODEST/$repo" \ + $APK add --upgrade --repository "$REPODEST/$repo" \ $apk_opt_wait \ --virtual .makedepends-$pkgname $builddeps \ || return 1 @@ -2218,8 +2163,6 @@ msg "Preparing build chroot..." - mkusers - BUILD_ROOT=$(mktemp -d /var/tmp/abuild.XXXXXXXXXX) local aportsgit=${APORTSDIR:-${startdir}} @@ -2260,7 +2203,7 @@ ) < "$repo_template" > "$BUILD_ROOT/etc/apk/repositories" calcdeps - $SUDO_APK add --initdb --root "$BUILD_ROOT" --update \ + $APK add --initdb --root "$BUILD_ROOT" --update \ abuild alpine-base build-base git $hostdeps $builddeps local bwrap_opts="" @@ -2307,11 +2250,7 @@ [ -e "$filename" ] || continue [ "$osabi" != "STANDALONE" ] || continue - local XATTR=$(getfattr --match="" --dump "${filename}") "${stripcmd}" "${filename}" - if [ -n "$XATTR" ]; then - echo "$XATTR" | setfattr --restore=- - fi done } @@ -2401,22 +2340,22 @@ local _quiet="$1" [ -z "$_quiet" ] && msg "Installing for build:$builddeps" - $SUDO_APK add $_quiet $apk_opt_wait --repository "$REPODEST/$repo" \ + $APK add $_quiet $apk_opt_wait --repository "$REPODEST/$repo" \ --virtual .makedepends-$pkgname \ $builddeps \ || return 1 if [ -n "$CBUILDROOT" ]; then [ -z "$_quiet" ] && msg "Installing for host:$hostdeps" - $SUDO_APK add $_quiet --root "$CBUILDROOT" --arch "$CTARGET_ARCH" --repository "$REPODEST/$repo" $apk_opt_wait \ + $APK add $_quiet --root "$CBUILDROOT" --arch "$CTARGET_ARCH" --repository "$REPODEST/$repo" $apk_opt_wait \ --no-scripts --virtual .makedepends-$pkgname $hostdeps || return 1 fi } undeps() { local _quiet="$@" - $SUDO_APK del $_quiet $apk_opt_wait .makedepends-$pkgname || : + $APK del $_quiet $apk_opt_wait .makedepends-$pkgname || : if [ -n "$CBUILDROOT" ]; then - $SUDO_APK del $_quiet --root "$CBUILDROOT" --arch "$CTARGET_ARCH" $apk_opt_wait \ + $APK del $_quiet --root "$CBUILDROOT" --arch "$CTARGET_ARCH" $apk_opt_wait \ --no-scripts .makedepends-$pkgname || : fi } @@ -2536,7 +2475,7 @@ package Install project into $pkgdir prepare Apply patches rootbld Build package in clean chroot - rootpkg Run 'package', the split functions and create apks as fakeroot + rootpkg Run 'package', the split functions and create apks sanitycheck Basic sanity check of APKBUILD snapshot Create a \$giturl or \$svnurl snapshot and upload to \$disturl sourcecheck Check if remote source package exists upstream @@ -2618,7 +2557,7 @@ if [ -z "$REPODEST" ]; then warning "REPODEST is not set and is now required. Defaulting to ~/packages" [ -n "$PKGDEST" ] && die "PKGDEST is no longer supported." - REPODEST="~/packages" + REPODEST="$HOME/packages" fi # for recursive action ================================================ FILE: disabled-packages/abuild/build.sh ================================================ ## ## Since Termux is continuing to use APT as package manager, abuild & apk-tools ## are disabled because don't have real use-cases currently. ## ## TODO: restore fakeroot functionality TERMUX_PKG_HOMEPAGE=https://github.com/alpinelinux/abuild TERMUX_PKG_DESCRIPTION="Build script to build Alpine packages" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=3.4.0 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/alpinelinux/abuild/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=f6f704e34f9d388a0228b645050dc7db7bf92f15a088835ae2c9b244420b9b61 TERMUX_PKG_DEPENDS="apk-tools, autoconf, automake, bash, clang, curl, libtool, make, openssl-tool, pkg-config, tar, zlib" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_MAKE_ARGS="sysconfdir=$TERMUX_PREFIX/etc" TERMUX_PKG_CONFFILES="etc/abuild.conf" TERMUX_PKG_RM_AFTER_INSTALL=" bin/abuild-adduser bin/abuild-addgroup bin/abuild-apk bin/abuild-sudo bin/buildlab " termux_step_post_make_install() { install -Dm600 "$TERMUX_PKG_SRCDIR/abuild.conf" "$TERMUX_PREFIX/etc/abuild.conf" } ================================================ FILE: disabled-packages/abuild/checkapk.in.patch ================================================ --- abuild-3.2.0/checkapk.in 2018-06-22 10:24:10.000000000 +0300 +++ abuild-3.2.0.mod/checkapk.in 2018-11-18 20:27:51.357171116 +0200 @@ -64,7 +64,7 @@ [ -f "$filepath" ] || die "can't find $pkgfile" # generate a temp repositories file with only the http(s) repos - grep -E "^https?:" /etc/apk/repositories > $tmpdir/repositories + grep -E "^https?:" @TERMUX_PREFIX@/etc/apk/repositories > $tmpdir/repositories oldpkg=$(apk fetch --repositories-file $tmpdir/repositories --simulate 2>&1 | sed 's/^Downloading //') if [ "${oldpkg}" = "${pkg}" ]; then ================================================ FILE: disabled-packages/abuild/functions.sh.in.patch ================================================ diff -uNr abuild-3.4.0/functions.sh.in abuild-3.4.0.mod/functions.sh.in --- abuild-3.4.0/functions.sh.in 2019-06-14 15:13:23.000000000 +0300 +++ abuild-3.4.0.mod/functions.sh.in 2019-07-21 17:00:19.730135313 +0300 @@ -5,40 +5,20 @@ arch_to_hostspec() { case "$1" in - aarch64) echo "aarch64-alpine-linux-musl" ;; - armel) echo "armv5-alpine-linux-musleabi" ;; - armhf) echo "armv6-alpine-linux-musleabihf" ;; - armv7) echo "armv7-alpine-linux-musleabihf" ;; - mips) echo "mips-alpine-linux-musl" ;; - mips64) echo "mips64-alpine-linux-musl" ;; - mipsel) echo "mipsel-alpine-linux-musl" ;; - mips64el) echo "mips64el-alpine-linux-musl" ;; - ppc) echo "powerpc-alpine-linux-musl" ;; - ppc64) echo "powerpc64-alpine-linux-musl" ;; - ppc64le) echo "powerpc64le-alpine-linux-musl" ;; - s390x) echo "s390x-alpine-linux-musl" ;; - x86) echo "i586-alpine-linux-musl" ;; - x86_64) echo "x86_64-alpine-linux-musl" ;; + aarch64) echo "aarch64-linux-android" ;; + arm) echo "arm-linux-androideabi" ;; + i686) echo "i686-linux-android" ;; + x86_64) echo "x86_64-linux-android" ;; *) echo "unknown" ;; esac } hostspec_to_arch() { case "$1" in - aarch64*-*-*-*) echo "aarch64" ;; - arm*-*-*-*eabi) echo "armel" ;; - armv6*-*-*-*eabihf) echo "armhf" ;; - armv7*-*-*-*eabihf) echo "armv7" ;; - i[0-9]86-*-*-*) echo "x86" ;; - mips-*-*-*) echo "mips" ;; - mips64-*-*-*) echo "mips64" ;; - mipsel-*-*-*) echo "mipsel" ;; - mips64el-*-*-*) echo "mips64el" ;; - powerpc-*-*-*) echo "ppc" ;; - powerpc64-*-*-*) echo "ppc64" ;; - powerpc64le-*-*-*) echo "ppc64le" ;; - s390x-*-*-*) echo "s390x" ;; - x86_64-*-*-*) echo "x86_64" ;; + aarch64-*) echo "aarch64" ;; + arm-*) echo "arm" ;; + i686-*) echo "i686" ;; + x86_64-*) echo "x86_64" ;; *) echo "unknown" ;; esac } @@ -114,7 +94,7 @@ PACKAGER=${_PACKAGER-$PACKAGER} USE_COLORS=${_USE_COLORS-$USE_COLORS} - [ -z "$CBUILD" ] && CBUILD="$(gcc -dumpmachine)" + [ -z "$CBUILD" ] && CBUILD="$(clang -dumpmachine)" [ -z "$CHOST" ] && CHOST="$CBUILD" [ -z "$CTARGET" ] && CTARGET="$CHOST" [ "$(arch_to_hostspec $CBUILD)" != "unknown" ] && CBUILD="$(arch_to_hostspec $CBUILD)" @@ -134,11 +114,71 @@ # setup build root [ -z "$CBUILDROOT" ] && export CBUILDROOT="$HOME/sysroot-$CTARGET_ARCH/" # prepare pkg-config for cross building - [ -z "$PKG_CONFIG_PATH" ] && export PKG_CONFIG_PATH="${CBUILDROOT}/usr/lib/pkgconfig/" + [ -z "$PKG_CONFIG_PATH" ] && export PKG_CONFIG_PATH="${CBUILDROOT}/lib/pkgconfig/" [ -z "$PKG_CONFIG_SYSROOT_DIR" ] && export PKG_CONFIG_SYSROOT_DIR="${CBUILDROOT}" + # libtool bug workaround for extra rpaths - [ -z "$lt_cv_sys_lib_dlsearch_path_spec" ] && \ - export lt_cv_sys_lib_dlsearch_path_spec="${CBUILDROOT}/lib ${CBUILDROOT}/usr/lib /usr/lib /lib /usr/local/lib" + if [ -z "$lt_cv_sys_lib_dlsearch_path_spec" ]; then + case $CTARGET_ARCH in + aarch64|x86_64) export lt_cv_sys_lib_dlsearch_path_spec="${CBUILDROOT}/lib @TERMUX_PREFIX@/lib /system/lib64" ;; + *) export lt_cv_sys_lib_dlsearch_path_spec="${CBUILDROOT}/lib @TERMUX_PREFIX@/lib /system/lib" ;; + esac + fi + + # Originally set in build-package.sh script in Termux build environment. + # https://github.com/termux/termux-packages/blob/master/build-package.sh + export ac_cv_func_getpwent=no + export ac_cv_func_getpwnam=no + export ac_cv_func_getpwuid=no + export ac_cv_func_sigsetmask=no + export ac_cv_c_bigendian=no + export ac_cv_func_calloc_0_nonnull=yes + export ac_cv_func_calloc_0_nonnull=yes + export ac_cv_func_chown_works=yes + export ac_cv_func_getgroups_works=yes + export ac_cv_func_malloc_0_nonnull=yes + export ac_cv_func_realloc_0_nonnull=yes + export am_cv_func_working_getline=yes + export gl_cv_C_locale_sans_EILSEQ=yes + export gl_cv_func_dup2_works=yes + export gl_cv_func_fcntl_f_dupfd_cloexec=yes + export gl_cv_func_fcntl_f_dupfd_works=yes + export gl_cv_func_fnmatch_posix=yes + export gl_cv_func_getcwd_abort_bug=no + export gl_cv_func_getcwd_null=yes + export gl_cv_func_getcwd_path_max=yes + export gl_cv_func_getcwd_posix_signature=yes + export gl_cv_func_gettimeofday_clobber=no + export gl_cv_func_gettimeofday_posix_signature=yes + export gl_cv_func_link_works=yes + export gl_cv_func_lstat_dereferences_slashed_symlink=yes + export gl_cv_func_malloc_0_nonnull=yes + export gl_cv_func_memchr_works=yes + export gl_cv_func_mkdir_trailing_dot_works=yes + export gl_cv_func_mkdir_trailing_slash_works=yes + export gl_cv_func_mkfifo_works=yes + export gl_cv_func_mknod_works=yes + export gl_cv_func_realpath_works=yes + export gl_cv_func_select_detects_ebadf=yes + export gl_cv_func_snprintf_posix=yes + export gl_cv_func_snprintf_retval_c99=yes + export gl_cv_func_snprintf_truncation_c99=yes + export gl_cv_func_stat_dir_slash=yes + export gl_cv_func_stat_file_slash=yes + export gl_cv_func_strerror_0_works=yes + export gl_cv_func_symlink_works=yes + export gl_cv_func_tzset_clobber=no + export gl_cv_func_unlink_honors_slashes=yes + export gl_cv_func_unlink_honors_slashes=yes + export gl_cv_func_vsnprintf_posix=yes + export gl_cv_func_vsnprintf_zerosize_c99=yes + export gl_cv_func_wcwidth_works=yes + export gl_cv_func_working_getdelim=yes + export gl_cv_func_working_mkstemp=yes + export gl_cv_func_working_mktime=yes + export gl_cv_func_working_strerror=yes + export gl_cv_header_working_fcntl_h=yes + # setup cross-compiler if [ -z "$CROSS_COMPILE" ]; then export CROSS_COMPILE="${CHOST}-" @@ -149,8 +189,8 @@ export HOSTCXXFLAGS="$CXXFLAGS" export HOSTCFLAGS="$CFLAGS" export HOSTLDFLAGS="$LDFLAGS" - export CC=${CROSS_COMPILE}gcc - export CXX=${CROSS_COMPILE}g++ + export CC=${CROSS_COMPILE}clang + export CXX=${CROSS_COMPILE}clang++ export LD=${CROSS_COMPILE}ld export CPPFLAGS="--sysroot=${CBUILDROOT} $CPPFLAGS" export CXXFLAGS="--sysroot=${CBUILDROOT} $CXXFLAGS" ================================================ FILE: disabled-packages/abuild/sample.APKBUILD.patch ================================================ --- abuild-3.2.0/sample.APKBUILD 2018-06-22 10:24:10.000000000 +0300 +++ abuild-3.2.0.mod/sample.APKBUILD 2018-11-19 01:28:10.783277331 +0200 @@ -27,10 +27,10 @@ build() { cd "$builddir" - ./configure --prefix=/usr \ - --sysconfdir=/etc \ - --mandir=/usr/share/man \ - --infodir=/usr/share/info + ./configure --prefix=$PREFIX \ + --sysconfdir=$PREFIX/etc \ + --mandir=$PREFIX/share/man \ + --infodir=$PREFIX/share/info make } ================================================ FILE: disabled-packages/alsa-lib/alsa-conf-dir.patch ================================================ --- ./src/conf/alsa.conf.orig 2016-12-20 14:43:20.000000000 +0000 +++ ./src/conf/alsa.conf 2017-03-06 22:51:47.242150837 +0000 @@ -15,7 +15,7 @@ "/alsa.conf.d/" ] } - "/etc/asound.conf" + "@TERMUX_PREFIX@/etc/asound.conf" "~/.asoundrc" ] errors false ================================================ FILE: disabled-packages/alsa-lib/build.sh ================================================ # patches taken from https://github.com/michaelwu/alsa-lib TERMUX_PKG_HOMEPAGE=http://www.alsa-project.org TERMUX_PKG_VERSION=1.1.3 # TERMUX_PKG_DEPENDS="libandroid-shmem, python2" TERMUX_PKG_DEPENDS="libandroid-shmem" TERMUX_PKG_SRCURL=ftp://ftp.alsa-project.org/pub/lib/alsa-lib-$TERMUX_PKG_VERSION.tar.bz2 TERMUX_PKG_SHA256=71282502184c592c1a008e256c22ed0ba5728ca65e05273ceb480c70f515969c # TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-pythonlibs=\"-lpython2.7\" --with-pythonincludes=-I/$TERMUX_PREFIX/include/python2.7" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-python" termux_step_pre_configure() { #LDFLAGS="$LDFLAGS -landroid-shmem" #_files='src/pcm/pcm_dsnoop.c src/pcm/pcm_mmap.c src/pcm/pcm_shm.c src/pcm/pcm_dmix.c src/pcm/pcm_dshare.c src/pcm/pcm_direct.c src/shmarea.c src/control/control_shm.c aserver/aserver.c' #for _file in $_files; do sed -i 's%#include %#include %' "$TERMUX_PKG_SRCDIR/$_file"; done #export ac_cv_header_sys_shm_h='no' CPPFLAGS="$CPPFLAGS -DTERMUX_SHMEM_STUBS -DTERMUX_SEMOPS_STUBS" } ================================================ FILE: disabled-packages/alsa-lib/pcm_direct.c.patch ================================================ --- ./src/pcm/pcm_direct.c 2016-08-02 23:18:38.000000000 +0530 +++ ./src/pcm/pcm_direct.c 2016-12-02 23:19:30.771819040 +0530 @@ -44,12 +44,14 @@ * */ +#if !defined(ANDROID) && !defined(__ANDROID__) union semun { int val; /* Value for SETVAL */ struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */ unsigned short *array; /* Array for GETALL, SETALL */ struct seminfo *__buf; /* Buffer for IPC_INFO (Linux specific) */ }; +#endif /* * FIXME: ================================================ FILE: disabled-packages/alsa-lib/pcm_mmap.c.patch.old ================================================ --- ./src/pcm/pcm_mmap.c 2016-08-02 23:18:38.000000000 +0530 +++ /home/vishal/AndroidDev/alsa/src/pcm/pcm_mmap.c 2016-12-03 00:06:36.620336924 +0530 @@ -344,7 +344,7 @@ i->addr = ptr; break; case SND_PCM_AREA_SHM: -#ifdef HAVE_SYS_SHM_H +#if 0 if (i->u.shm.shmid < 0) { int id; /* FIXME: safer permission? */ @@ -474,7 +474,7 @@ errno = 0; break; case SND_PCM_AREA_SHM: -#ifdef HAVE_SYS_SHM_H +#if 0 if (i->u.shm.area) { snd_shm_area_destroy(i->u.shm.area); i->u.shm.area = NULL; ================================================ FILE: disabled-packages/alsa-lib/versionsort.patch ================================================ diff -ruN ./src/conf.c /home/vishal/AndroidDev/alsa/src/conf.c --- ./src/conf.c 2016-08-02 23:18:38.000000000 +0530 +++ /home/vishal/AndroidDev/alsa/src/conf.c 2016-12-02 23:42:04.689785910 +0530 @@ -3558,7 +3558,7 @@ int n; #ifndef DOC_HIDDEN -#if defined(_GNU_SOURCE) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__sun) +#if defined(_GNU_SOURCE) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__sun) && !defined(__ANDROID__) && !defined(ANDROID) #define SORTFUNC versionsort #else #define SORTFUNC alphasort diff -ruN ./src/ucm/parser.c /home/vishal/AndroidDev/alsa/src/ucm/parser.c --- ./src/ucm/parser.c 2016-08-02 23:18:38.000000000 +0530 +++ /home/vishal/AndroidDev/alsa/src/ucm/parser.c 2016-12-02 23:42:17.406370931 +0530 @@ -1274,7 +1274,7 @@ "%s", env ? env : ALSA_USE_CASE_DIR); filename[MAX_FILE-1] = '\0'; -#if defined(_GNU_SOURCE) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__sun) +#if defined(_GNU_SOURCE) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__sun) && !defined(__ANDROID__) && !defined(ANDROID) #define SORTFUNC versionsort #else #define SORTFUNC alphasort ================================================ FILE: disabled-packages/alsa-plugins/asound.conf ================================================ # Use pulseaudio by default pcm.!default { type pulse fallback "sysdefault" hint { show on description "Default ALSA Output (currently PulseAudio Sound Server)" } } ctl.!default { type pulse fallback "sysdefault" } # vim:set ft=alsaconf: ================================================ FILE: disabled-packages/alsa-plugins/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.alsa-project.org TERMUX_PKG_VERSION=1.1.1 TERMUX_PKG_SRCURL=ftp://ftp.alsa-project.org/pub/plugins/alsa-plugins-$TERMUX_PKG_VERSION.tar.bz2 TERMUX_PKG_SHA256=8ea4d1e082c36528a896a2581e5eb62d4dc2683238e353050d0d624e65f901f1 TERMUX_PKG_DEPENDS="alsa-lib, pulseaudio" TERMUX_PKG_EXTRA_MAKE_ARGS='SUBDIRS=pulse' termux_step_post_make_install() { cp $TERMUX_PKG_BUILDER_DIR/asound.conf $TERMUX_PREFIX/etc } ================================================ FILE: disabled-packages/alsa-utils/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.alsa-project.org TERMUX_PKG_VERSION=1.1.3 TERMUX_PKG_SRCURL=ftp://ftp.alsa-project.org/pub/utils/alsa-utils-$TERMUX_PKG_VERSION.tar.bz2 TERMUX_PKG_SHA256=127217a54eea0f9a49700a2f239a2d4f5384aa094d68df04a8eb80132eb6167c TERMUX_PKG_DEPENDS="alsa-lib, ncurses" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-udev-rules-dir=$TERMUX_PREFIX/lib/udev/rules.d --with-asound-state-dir=$TERMUX_PREFIX/var/lib/alsa --disable-bat --disable-rst2man" termux_step_pre_configure() { LDFLAGS+=" -llog" } ================================================ FILE: disabled-packages/alsa-utils/configure.patch ================================================ --- ./configure 2016-08-02 22:44:23.000000000 +0530 +++ ../configure 2016-12-03 23:06:46.641370754 +0530 @@ -7123,7 +7123,7 @@ LDFLAGS="$LDFLAGS $ALSA_LIBS" fi -ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" +ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl" LIBS="$ALSA_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALSA_LIBS" >&5 $as_echo "$ALSA_LIBS" >&6; } @@ -7741,7 +7741,6 @@ $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7776,7 +7775,6 @@ #define HAVE_LIBPTHREAD 1 _ACEOF - LIBS="-lpthread $LIBS" else as_fn_error $? "Error: need PTHREAD library" "$LINENO" 5 ================================================ FILE: disabled-packages/alsa-utils/volume_mapping.c.patch ================================================ --- ./alsamixer/volume_mapping.c 2016-08-02 22:39:45.000000000 +0530 +++ ../volume_mapping.c 2016-12-03 23:15:26.390744307 +0530 @@ -37,7 +37,7 @@ #include #include "volume_mapping.h" -#ifdef __UCLIBC__ +#if defined(__UCLIBC__) || defined(__ANDROID__) /* 10^x = 10^(log e^x) = (e^x)^log10 = e^(x * log 10) */ #define exp10(x) (exp((x) * log(10))) #endif /* __UCLIBC__ */ ================================================ FILE: disabled-packages/ant/ant ================================================ #!@TERMUX_PREFIX@/bin/sh # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. set -e -u # Extract launch and ant arguments, (see details below). ant_exec_args= no_config=false ant_exec_debug=false show_help=false for arg in "$@" ; do if [ "$arg" = "--noconfig" ] ; then no_config=true elif [ "$arg" = "--execdebug" ] ; then ant_exec_debug=true elif [ my"$arg" = my"--h" -o my"$arg" = my"--help" ] ; then show_help=true ant_exec_args="$ant_exec_args -h" else if [ my"$arg" = my"-h" -o my"$arg" = my"-help" ] ; then show_help=true fi ant_exec_args="$ant_exec_args \"$arg\"" fi done if [ -z "$ANT_HOME" ]; then ANT_HOME=@TERMUX_PREFIX@/share/ant fi if ! $no_config ; then if [ -f "$HOME/.ant/ant.conf" ] ; then . $HOME/.ant/ant.conf fi if [ -f "$HOME/.antrc" ] ; then . "$HOME/.antrc" fi fi ANT_LIB="${ANT_HOME}/lib" if [ -z "$LOCALCLASSPATH" ] ; then LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar else LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar:$LOCALCLASSPATH fi # Show script help if requested if $show_help ; then echo $0 '[script options] [options] [target [target2 [target3] ..]]' echo 'Script Options:' echo ' --help, --h print this message and ant help' echo ' --noconfig suppress sourcing of /etc/ant.conf,' echo ' $HOME/.ant/ant.conf, and $HOME/.antrc' echo ' configuration files' echo ' --execdebug print ant exec line generated by this' echo ' launch script' echo ' ' fi # Execute ant using eval/exec to preserve spaces in paths, java options, and ant args ant_sys_opts= ant_exec_command="exec dalvikvm $ANT_OPTS -classpath \"$LOCALCLASSPATH\" -Dant.home=\"$ANT_HOME\" -Dant.library.dir=\"$ANT_LIB\" $ant_sys_opts org.apache.tools.ant.launch.Launcher $ANT_ARGS -cp \"$CLASSPATH\"" if $ant_exec_debug ; then echo $ant_exec_command $ant_exec_args fi eval $ant_exec_command "$ant_exec_args" ================================================ FILE: disabled-packages/ant/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://ant.apache.org/ TERMUX_PKG_DESCRIPTION="Java based build tool like make" TERMUX_PKG_VERSION=1.9.6 TERMUX_PKG_SRCURL=http://apache.mirrors.spacedump.net//ant/binaries/apache-ant-${TERMUX_PKG_VERSION}-bin.tar.bz2 TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_PLATFORM_INDEPENDENT=true termux_step_make_install() { mkdir -p $TERMUX_PREFIX/share/ant/lib for jar in ant ant-launcher; do $TERMUX_DX \ --dex \ --output=$TERMUX_PREFIX/share/ant/lib/${jar}.jar \ lib/${jar}.jar done install $TERMUX_PKG_BUILDER_DIR/ant $TERMUX_PREFIX/bin/ant perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/ant } ================================================ FILE: disabled-packages/apk-tools/Make.rules.patch ================================================ diff -u -r ../apk-tools-2.10.1/Make.rules ./Make.rules --- ../apk-tools-2.10.1/Make.rules 2018-09-10 08:04:03.000000000 +0000 +++ ./Make.rules 2018-09-10 21:36:27.914805239 +0000 @@ -64,9 +64,9 @@ # Utilities and default flags for them. CROSS_COMPILE ?= -CC := $(CROSS_COMPILE)gcc -AR := $(CROSS_COMPILE)ar -LD := $(CROSS_COMPILE)ld +CC ?= $(CROSS_COMPILE)gcc +AR ?= $(CROSS_COMPILE)ar +LD ?= $(CROSS_COMPILE)ld INSTALL := install INSTALLDIR := $(INSTALL) -d ================================================ FILE: disabled-packages/apk-tools/Makefile.patch ================================================ diff -u -r ../apk-tools-2.10.1/Makefile ./Makefile --- ../apk-tools-2.10.1/Makefile 2018-09-10 08:04:03.000000000 +0000 +++ ./Makefile 2018-09-10 21:58:19.631911343 +0000 @@ -10,11 +10,11 @@ # Default directories DESTDIR := -SBINDIR := /sbin -LIBDIR := /lib -CONFDIR := /etc/apk -MANDIR := /usr/share/man -DOCDIR := /usr/share/doc/apk +SBINDIR := @TERMUX_PREFIX@/bin +LIBDIR := @TERMUX_PREFIX@/lib +CONFDIR := @TERMUX_PREFIX@/etc/apk +MANDIR := @TERMUX_PREFIX@/share/man +DOCDIR := @TERMUX_PREFIX@/share/doc/apk export DESTDIR SBINDIR LIBDIR CONFDIR MANDIR DOCDIR ================================================ FILE: disabled-packages/apk-tools/build.sh ================================================ ## ## Since Termux is continuing to use APT as package manager, abuild & apk-tools ## are disabled because don't have real use-cases currently. ## TERMUX_PKG_HOMEPAGE=https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management TERMUX_PKG_DESCRIPTION="Alpine Linux package management tools" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.10.4 TERMUX_PKG_SRCURL=https://github.com/alpinelinux/apk-tools/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=c08aa725a0437a6a83c5364a1a3a468e4aef5d1d09523369074779021397281c TERMUX_PKG_DEPENDS="openssl, zlib" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_MAKE_ARGS="LUAAPK=" TERMUX_PKG_CONFFILES="etc/apk/repositories" termux_step_post_make_install() { mkdir -p $TERMUX_PREFIX/etc/apk/ echo $TERMUX_ARCH > $TERMUX_PREFIX/etc/apk/arch echo "https://termux.net/apk/main" > $TERMUX_PREFIX/etc/apk/repositories } termux_step_post_massage() { mkdir -p "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/etc/apk/keys" mkdir -p "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/etc/apk/protected_paths.d" mkdir -p "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib/apk/db/" mkdir -p "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/var/cache/apk" ln -sfr \ "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/var/cache/apk" \ "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/etc/apk/cache" } termux_step_create_debscripts() { { echo "#!$TERMUX_PREFIX/bin/sh" echo "touch $TERMUX_PREFIX/etc/apk/world" } > ./postinst chmod 755 postinst } ================================================ FILE: disabled-packages/apk-tools/libfetch-http.c.patch ================================================ diff -uNr apk-tools-2.10.4/libfetch/http.c apk-tools-2.10.4.mod/libfetch/http.c --- apk-tools-2.10.4/libfetch/http.c 2019-06-05 15:34:16.000000000 +0300 +++ apk-tools-2.10.4.mod/libfetch/http.c 2019-07-21 16:38:08.300760202 +0300 @@ -496,14 +496,11 @@ static int http_parse_mtime(const char *p, time_t *mtime) { - char *locale, *r; + char *r; struct tm tm; - locale = strdupa(setlocale(LC_TIME, NULL)); - setlocale(LC_TIME, "C"); r = strptime(p, "%a, %d %b %Y %H:%M:%S GMT", &tm); - /* XXX should add support for date-2 and date-3 */ - setlocale(LC_TIME, locale); + if (r == NULL) return (-1); *mtime = timegm(&tm); ================================================ FILE: disabled-packages/apk-tools/src-apk.c.patch ================================================ diff -u -r ../apk-tools-2.10.1/src/apk.c ./src/apk.c --- ../apk-tools-2.10.1/src/apk.c 2018-09-10 08:04:03.000000000 +0000 +++ ./src/apk.c 2018-09-10 22:02:50.668809543 +0000 @@ -486,7 +486,7 @@ apk_flags |= APK_PROGRESS; if (!(apk_flags & APK_SIMULATE) && - access("/etc/apk/interactive", F_OK) == 0) + access("@TERMUX_PREFIX@/etc/apk/interactive", F_OK) == 0) apk_flags |= APK_INTERACTIVE; } ================================================ FILE: disabled-packages/apk-tools/src-archive.c.patch ================================================ diff -uNr apk-tools-2.10.3/src/archive.c apk-tools-2.10.3.mod/src/archive.c --- apk-tools-2.10.3/src/archive.c 2018-11-15 15:09:07.000000000 +0200 +++ apk-tools-2.10.3.mod/src/archive.c 2018-11-19 17:36:03.835900565 +0200 @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -441,7 +442,9 @@ struct apk_istream *is, apk_progress_cb cb, void *cb_ctx) { +#ifndef __ANDROID__ struct apk_xattr *xattr; +#endif const char *fn = extract_name ?: ae->name; int fd, r = -1, atflags = 0, ret = 0; @@ -487,12 +490,14 @@ return ret; } +#ifndef __ANDROID__ r = fchownat(atfd, fn, ae->uid, ae->gid, atflags); if (r < 0) { apk_error("Failed to set ownership on %s: %s", fn, strerror(errno)); if (!ret) ret = -errno; } +#endif /* chown resets suid bit so we need set it again */ if (ae->mode & 07000) { @@ -506,6 +511,7 @@ } /* extract xattrs */ +#ifndef __ANDROID__ if (!S_ISLNK(ae->mode) && ae->xattrs && ae->xattrs->num) { r = 0; fd = openat(atfd, fn, O_RDWR); @@ -527,6 +533,7 @@ if (!ret) ret = r; } } +#endif if (!S_ISLNK(ae->mode)) { /* preserve modification time */ ================================================ FILE: disabled-packages/apk-tools/src-commit.c.patch ================================================ diff -uNr apk-tools-2.10.3/src/commit.c apk-tools-2.10.3.mod/src/commit.c --- apk-tools-2.10.3/src/commit.c 2018-11-15 15:09:07.000000000 +0200 +++ apk-tools-2.10.3.mod/src/commit.c 2018-11-19 17:44:44.799596053 +0200 @@ -19,6 +19,8 @@ #include "apk_print.h" +#include "termux_prefix.h" + static inline int pkg_available(struct apk_database *db, struct apk_package *pkg) { if (pkg->repos & db->available_repos) @@ -235,7 +237,7 @@ if (file[0] == '.') return 0; if ((apk_flags & (APK_NO_SCRIPTS | APK_SIMULATE)) != 0) return 0; - snprintf(fn, sizeof(fn), "etc/apk/commit_hooks.d" "/%s", file); + snprintf(fn, sizeof(fn), TERMUX_PREFIX_RELATIVE"etc/apk/commit_hooks.d" "/%s", file); if ((apk_flags & APK_NO_COMMIT_HOOKS) != 0) { apk_message("Skipping: %s %s", fn, commit_hook_str[hook->type]); return 0; @@ -251,7 +253,7 @@ static int run_commit_hooks(struct apk_database *db, int type) { struct apk_commit_hook hook = { .db = db, .type = type }; - return apk_dir_foreach_file(openat(db->root_fd, "etc/apk/commit_hooks.d", O_RDONLY | O_CLOEXEC), + return apk_dir_foreach_file(openat(db->root_fd, TERMUX_PREFIX_RELATIVE"etc/apk/commit_hooks.d", O_RDONLY | O_CLOEXEC), run_commit_hook, &hook); } ================================================ FILE: disabled-packages/apk-tools/src-database.c.patch ================================================ diff -uNr apk-tools-2.10.3/src/database.c apk-tools-2.10.3.mod/src/database.c --- apk-tools-2.10.3/src/database.c 2018-11-15 15:09:07.000000000 +0200 +++ apk-tools-2.10.3.mod/src/database.c 2018-11-19 17:45:05.469750983 +0200 @@ -37,6 +37,8 @@ #include "apk_print.h" #include "apk_openssl.h" +#include "termux_prefix.h" + static const apk_spn_match_def apk_spn_repo_separators = { [4] = (1<<0) /* */, [7] = (1<<2) /*:*/, @@ -54,22 +56,22 @@ static const char * const apkindex_tar_gz = "APKINDEX.tar.gz"; -static const char * const apk_static_cache_dir = "var/cache/apk"; +static const char * const apk_static_cache_dir = TERMUX_PREFIX_RELATIVE"var/cache/apk"; -static const char * const apk_world_file = "etc/apk/world"; -static const char * const apk_world_file_tmp = "etc/apk/world.new"; -static const char * const apk_arch_file = "etc/apk/arch"; +static const char * const apk_world_file = TERMUX_PREFIX_RELATIVE"etc/apk/world"; +static const char * const apk_world_file_tmp = TERMUX_PREFIX_RELATIVE"etc/apk/world.new"; +static const char * const apk_arch_file = TERMUX_PREFIX_RELATIVE"etc/apk/arch"; -static const char * const apk_lock_file = "lib/apk/db/lock"; +static const char * const apk_lock_file = TERMUX_PREFIX_RELATIVE"lib/apk/db/lock"; -static const char * const apk_scripts_file = "lib/apk/db/scripts.tar"; -static const char * const apk_scripts_file_tmp = "lib/apk/db/scripts.tar.new"; +static const char * const apk_scripts_file = TERMUX_PREFIX_RELATIVE"lib/apk/db/scripts.tar"; +static const char * const apk_scripts_file_tmp = TERMUX_PREFIX_RELATIVE"lib/apk/db/scripts.tar.new"; -static const char * const apk_triggers_file = "lib/apk/db/triggers"; -static const char * const apk_triggers_file_tmp = "lib/apk/db/triggers.new"; +static const char * const apk_triggers_file = TERMUX_PREFIX_RELATIVE"lib/apk/db/triggers"; +static const char * const apk_triggers_file_tmp = TERMUX_PREFIX_RELATIVE"lib/apk/db/triggers.new"; -const char * const apk_installed_file = "lib/apk/db/installed"; -static const char * const apk_installed_file_tmp = "lib/apk/db/installed.new"; +const char * const apk_installed_file = TERMUX_PREFIX_RELATIVE"lib/apk/db/installed"; +static const char * const apk_installed_file_tmp = TERMUX_PREFIX_RELATIVE"lib/apk/db/installed.new"; static struct apk_db_acl *apk_default_acl_dir, *apk_default_acl_file; @@ -1332,19 +1334,20 @@ static int apk_db_create(struct apk_database *db) { int fd; - - mkdirat(db->root_fd, "tmp", 01777); + mkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE"tmp", 01777); mkdirat(db->root_fd, "dev", 0755); +#ifndef __ANDROID__ mknodat(db->root_fd, "dev/null", S_IFCHR | 0666, makedev(1, 3)); - mkdirat(db->root_fd, "etc", 0755); - mkdirat(db->root_fd, "etc/apk", 0755); - mkdirat(db->root_fd, "lib", 0755); - mkdirat(db->root_fd, "lib/apk", 0755); - mkdirat(db->root_fd, "lib/apk/db", 0755); - mkdirat(db->root_fd, "var", 0755); - mkdirat(db->root_fd, "var/cache", 0755); - mkdirat(db->root_fd, "var/cache/apk", 0755); - mkdirat(db->root_fd, "var/cache/misc", 0755); +#endif + mkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE"etc", 0755); + mkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE"etc/apk", 0755); + mkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE"lib", 0755); + mkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE"lib/apk", 0755); + mkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE"lib/apk/db", 0755); + mkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE"var", 0755); + mkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE"var/cache", 0755); + mkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE"var/cache/apk", 0755); + mkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE"var/cache/misc", 0755); fd = openat(db->root_fd, apk_world_file, O_CREAT|O_RDWR|O_TRUNC|O_CLOEXEC, 0644); if (fd < 0) @@ -1533,7 +1536,7 @@ !(dbopts->open_flags & APK_OPENF_NO_AUTOUPDATE) && !(apk_flags & APK_NO_NETWORK)) db->autoupdate = 1; - if (!dbopts->cache_dir) dbopts->cache_dir = "etc/apk/cache"; + if (!dbopts->cache_dir) dbopts->cache_dir = TERMUX_PREFIX_RELATIVE"etc/apk/cache"; apk_db_setup_repositories(db, dbopts->cache_dir); @@ -1625,7 +1628,7 @@ blob = APK_BLOB_STR("+etc\n" "@etc/init.d\n" "!etc/apk\n"); apk_blob_for_each_segment(blob, "\n", add_protected_path, db); - apk_dir_foreach_file(openat(db->root_fd, "etc/apk/protected_paths.d", O_RDONLY | O_CLOEXEC), + apk_dir_foreach_file(openat(db->root_fd, TERMUX_PREFIX_RELATIVE"etc/apk/protected_paths.d", O_RDONLY | O_CLOEXEC), add_protected_paths_from_file, db); /* figure out where to have the cache */ @@ -1655,7 +1658,7 @@ } db->keys_fd = openat(db->root_fd, - dbopts->keys_dir ?: "etc/apk/keys", + dbopts->keys_dir ?: TERMUX_PREFIX_RELATIVE"etc/apk/keys", O_RDONLY | O_CLOEXEC); if (apk_flags & APK_OVERLAY_FROM_STDIN) { @@ -1693,8 +1696,8 @@ apk_db_add_repository(db, APK_BLOB_STR(repo->url)); if (dbopts->repositories_file == NULL) { - add_repos_from_file(db, db->root_fd, "etc/apk/repositories"); - apk_dir_foreach_file(openat(db->root_fd, "etc/apk/repositories.d", O_RDONLY | O_CLOEXEC), + add_repos_from_file(db, db->root_fd, TERMUX_PREFIX_RELATIVE"etc/apk/repositories"); + apk_dir_foreach_file(openat(db->root_fd, TERMUX_PREFIX_RELATIVE"etc/apk/repositories.d", O_RDONLY | O_CLOEXEC), add_repos_from_file, db); } else { add_repos_from_file(db, db->root_fd, dbopts->repositories_file); @@ -1931,7 +1934,7 @@ int status; pid_t pid; static char * const environment[] = { - "PATH=/usr/sbin:/usr/bin:/sbin:/bin", + "PATH=@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets", NULL }; @@ -1968,9 +1971,10 @@ r = fstatat(db->root_fd, dir->name, &st, AT_SYMLINK_NOFOLLOW); if (r < 0 || (st.st_mode & 07777) != (dir->mode & 07777)) fchmodat(db->root_fd, dir->name, dir->mode, 0); +#ifndef __ANDROID__ if (r < 0 || st.st_uid != dir->uid || st.st_gid != dir->gid) fchownat(db->root_fd, dir->name, dir->uid, dir->gid, 0); - +#endif return 0; } ================================================ FILE: disabled-packages/apk-tools/src-io.c.patch ================================================ diff -uNr apk-tools-2.10.3/src/io.c apk-tools-2.10.3.mod/src/io.c --- apk-tools-2.10.3/src/io.c 2018-11-15 15:09:07.000000000 +0200 +++ apk-tools-2.10.3.mod/src/io.c 2018-11-19 17:36:03.842567276 +0200 @@ -1012,6 +1012,7 @@ .delete_item = (apk_hash_delete_f) free, }; +#ifndef __ANDROID__ static struct cache_item *resolve_cache_item(struct apk_hash *hash, apk_blob_t name) { struct cache_item *ci; @@ -1032,6 +1033,7 @@ return ci; } +#endif void apk_id_cache_init(struct apk_id_cache *idc, int root_fd) { @@ -1056,6 +1058,9 @@ uid_t apk_resolve_uid(struct apk_id_cache *idc, const char *username, uid_t default_uid) { +#ifdef __ANDROID__ + return getuid(); +#else #ifdef HAVE_FGETPWENT_R char buf[1024]; struct passwd pwent; @@ -1095,10 +1100,14 @@ return ci->uid; return default_uid; +#endif } uid_t apk_resolve_gid(struct apk_id_cache *idc, const char *groupname, uid_t default_gid) { +#ifdef __ANDROID__ + return getgid(); +#else #ifdef HAVE_FGETGRENT_R char buf[1024]; struct group grent; @@ -1138,4 +1147,5 @@ return ci->gid; return default_gid; +#endif } ================================================ FILE: disabled-packages/apk-tools/src-package.c.patch ================================================ diff -uNr apk-tools-2.10.3/src/package.c apk-tools-2.10.3.mod/src/package.c --- apk-tools-2.10.3/src/package.c 2018-11-15 15:09:07.000000000 +0200 +++ apk-tools-2.10.3.mod/src/package.c 2018-11-19 17:44:51.566313390 +0200 @@ -30,6 +30,8 @@ #include "apk_database.h" #include "apk_print.h" +#include "termux_prefix.h" + static const apk_spn_match_def apk_spn_dependency_comparer = { [7] = (1<<4) /*<*/ | (1<<5) /*=*/ | (1<<6) /*<*/, [15] = (1<<6) /*~*/ @@ -1008,7 +1010,7 @@ argv[0] = (char *) apk_script_types[type]; /* Avoid /tmp as it can be mounted noexec */ - snprintf(fn, sizeof(fn), "var/cache/misc/" PKG_VER_FMT ".%s", + snprintf(fn, sizeof(fn), TERMUX_PREFIX_RELATIVE"var/cache/misc/" PKG_VER_FMT ".%s", PKG_VER_PRINTF(pkg), apk_script_types[type]); @@ -1018,7 +1020,7 @@ apk_message("Executing %s", &fn[15]); fd = openat(root_fd, fn, O_CREAT|O_RDWR|O_TRUNC|O_CLOEXEC, 0755); if (fd < 0) { - mkdirat(root_fd, "var/cache/misc", 0755); + mkdirat(root_fd, TERMUX_PREFIX_RELATIVE"var/cache/misc", 0755); fd = openat(root_fd, fn, O_CREAT|O_RDWR|O_TRUNC|O_CLOEXEC, 0755); if (fd < 0) goto err_log; } ================================================ FILE: disabled-packages/apk-tools/src-termux_prefix.h.patch ================================================ diff -uNr apk-tools-2.10.3/src/termux_prefix.h apk-tools-2.10.3.mod/src/termux_prefix.h --- apk-tools-2.10.3/src/termux_prefix.h 1970-01-01 03:00:00.000000000 +0300 +++ apk-tools-2.10.3.mod/src/termux_prefix.h 2018-11-19 17:42:52.188760273 +0200 @@ -0,0 +1,6 @@ +#ifndef __TERMUX_PREFIX_H +#define __TERMUX_PREFIX_H + +#define TERMUX_PREFIX_RELATIVE "data/data/com.termux/files/usr/" + +#endif ================================================ FILE: disabled-packages/apt-updated/CMakeLists.txt.patch ================================================ diff -u -r ../apt-1.6~alpha3/CMakeLists.txt ./CMakeLists.txt --- ../apt-1.6~alpha3/CMakeLists.txt 2017-10-28 17:57:05.000000000 +0200 +++ ./CMakeLists.txt 2017-11-02 17:42:28.162838378 +0100 @@ -33,7 +33,6 @@ include(GNUInstallDirs) include(TestBigEndian) find_package(Threads REQUIRED) -find_package(LFS REQUIRED) find_package(Iconv REQUIRED) find_package(Perl REQUIRED) @@ -44,11 +43,6 @@ include_directories(${Intl_INCLUDE_DIRS}) endif() -# Add large file support -add_compile_options(${LFS_COMPILE_OPTIONS}) -add_definitions(${LFS_DEFINITIONS}) -link_libraries(${LFS_LIBRARIES}) - # Set compiler flags set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -69,12 +63,6 @@ add_optional_compile_options(Wsign-promo) add_optional_compile_options(Wundef) -# apt-ftparchive dependencies -find_package(BerkeleyDB REQUIRED) -if (BERKELEY_DB_FOUND) - set(HAVE_BDB 1) -endif() - find_package(GnuTLS REQUIRED) if (GNUTLS_FOUND) set(HAVE_GNUTLS 1) @@ -87,22 +75,12 @@ endif() -find_package(BZip2 REQUIRED) -if (BZIP2_FOUND) - set(HAVE_BZ2 1) -endif() - find_package(LZMA REQUIRED) if (LZMA_FOUND) set(HAVE_LZMA 1) endif() -find_package(LZ4 REQUIRED) -if (LZ4_FOUND) - set(HAVE_LZ4 1) -endif() - find_package(Udev) if (UDEV_FOUND) set(HAVE_UDEV 1) @@ -184,10 +162,10 @@ message(STATUS "Found dpkg data dir: ${DPKG_DATADIR_CMD}") set(DPKG_DATADIR "${DPKG_DATADIR_CMD}" CACHE PATH "dpkg data directory") endif() -if (NOT DEFINED COMMON_ARCH) - execute_process(COMMAND dpkg-architecture -qDEB_HOST_ARCH - OUTPUT_VARIABLE COMMON_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) -endif() +# if (NOT DEFINED COMMON_ARCH) +# execute_process(COMMAND dpkg-architecture -qDEB_HOST_ARCH + #OUTPUT_VARIABLE COMMON_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) +# endif() if (NOT DEFINED ROOT_GROUP) execute_process(COMMAND id -gn root OUTPUT_VARIABLE ROOT_GROUP OUTPUT_STRIP_TRAILING_WHITESPACE) @@ -215,11 +193,8 @@ add_subdirectory(apt-inst) add_subdirectory(cmdline) add_subdirectory(completions) -add_subdirectory(doc) add_subdirectory(dselect) -add_subdirectory(ftparchive) add_subdirectory(methods) -add_subdirectory(test) if (USE_NLS) add_subdirectory(po) ================================================ FILE: disabled-packages/apt-updated/apt-pkg-contrib-fileutl.patch ================================================ diff -u -r ../apt-1.6~alpha3/apt-pkg/contrib/fileutl.cc ./apt-pkg/contrib/fileutl.cc --- ../apt-1.6~alpha3/apt-pkg/contrib/fileutl.cc 2017-10-28 17:57:05.000000000 +0200 +++ ./apt-pkg/contrib/fileutl.cc 2017-11-02 17:38:43.633482989 +0100 @@ -37,7 +37,9 @@ #include #include #include +#ifndef __ANDROID__ #include +#endif #include #include #include @@ -2790,6 +2792,7 @@ } /*}}}*/ +#ifndef __ANDROID__ // Glob - wrapper around "glob()" /*{{{*/ std::vector Glob(std::string const &pattern, int flags) { @@ -2815,6 +2818,7 @@ globfree(&globbuf); return result; } +#endif /*}}}*/ static std::string APT_NONNULL(1) GetTempDirEnv(char const * const env) /*{{{*/ { diff -u -r ../apt-1.6~alpha3/apt-pkg/contrib/fileutl.h ./apt-pkg/contrib/fileutl.h --- ../apt-1.6~alpha3/apt-pkg/contrib/fileutl.h 2017-10-28 17:57:05.000000000 +0200 +++ ./apt-pkg/contrib/fileutl.h 2017-11-02 17:37:38.518249720 +0100 @@ -262,7 +262,9 @@ APT_HIDDEN std::string flNormalize(std::string file); // simple c++ glob +#ifndef __ANDROID__ std::vector Glob(std::string const &pattern, int flags=0); +#endif /** \brief Popen() implementation that execv() instead of using a shell * ================================================ FILE: disabled-packages/apt-updated/apt-pkg-contrib-srvrec.cc.patch ================================================ diff -u -r ../apt-1.1.3/apt-pkg/contrib/srvrec.cc ./apt-pkg/contrib/srvrec.cc --- ../apt-1.1.3/apt-pkg/contrib/srvrec.cc 2015-11-30 03:08:24.000000000 -0500 +++ ./apt-pkg/contrib/srvrec.cc 2015-12-03 16:21:54.397715576 -0500 @@ -40,14 +40,24 @@ struct servent *s_ent = nullptr; std::vector buf(1024); +#ifdef __ANDROID__ + s_ent = getservbyport(htons(port), "tcp"); + if (s_ent == nullptr) return false; +#else res = getservbyport_r(htons(port), "tcp", &s_ent_buf, buf.data(), buf.size(), &s_ent); if (res != 0 || s_ent == nullptr) return false; +#endif strprintf(target, "_%s._tcp.%s", s_ent->s_name, host.c_str()); return GetSrvRecords(target, Result); } +#ifdef __ANDROID__ +extern "C" int __dn_skipname(const unsigned char* comp_dn, const unsigned char* eom); +static inline int dn_skipname(const unsigned char* a, const unsigned char* b) { return __dn_skipname(a,b); } +#endif + bool GetSrvRecords(std::string name, std::vector &Result) { unsigned char answer[PACKETSZ]; ================================================ FILE: disabled-packages/apt-updated/apt-pkg-contrib-strutl.cc.patch ================================================ diff -u -r ../apt-1.4.7/apt-pkg/contrib/strutl.cc ./apt-pkg/contrib/strutl.cc --- ../apt-1.4.7/apt-pkg/contrib/strutl.cc 2017-07-13 23:45:39.000000000 +0200 +++ ./apt-pkg/contrib/strutl.cc 2017-07-23 22:58:23.103247428 +0200 @@ -100,6 +100,7 @@ } } /*}}}*/ +#ifndef __ANDROID__ // UTF8ToCodeset - Convert some UTF-8 string for some codeset /*{{{*/ // --------------------------------------------------------------------- /* This is handy to use before display some information for enduser */ @@ -169,6 +170,7 @@ return true; } +#endif /*}}}*/ // strstrip - Remove white space from the front and back of a string /*{{{*/ // --------------------------------------------------------------------- ================================================ FILE: disabled-packages/apt-updated/apt-pkg-deb-debrecords.cc.patch ================================================ diff -u -r ../apt-1.6~alpha3/apt-pkg/deb/debrecords.cc ./apt-pkg/deb/debrecords.cc --- ../apt-1.6~alpha3/apt-pkg/deb/debrecords.cc 2017-10-28 17:57:05.000000000 +0200 +++ ./apt-pkg/deb/debrecords.cc 2017-11-02 17:40:35.816161798 +0100 @@ -23,7 +23,9 @@ #include #include #include +#ifndef __ANDROID__ #include +#endif #include #include @@ -151,12 +153,14 @@ orig = Section.FindS("Description"); } +#ifndef __ANDROID__ char const * const codeset = nl_langinfo(CODESET); if (strcmp(codeset,"UTF-8") != 0) { string dest; UTF8ToCodeset(codeset, orig, &dest); return dest; } +#endif return orig; } ================================================ FILE: disabled-packages/apt-updated/apt-pkg-init-dir.patch ================================================ --- ../cache/apt-1.4.7/apt-pkg/init.cc 2017-07-14 07:45:39.000000000 +1000 +++ ./apt-pkg/init.cc 2017-07-19 17:03:07.949752843 +1000 @@ -51,7 +51,7 @@ return vec; } - +#ifndef __ANDROID__ // pkgInitArchTupleMap - Initialize the architecture tuple map /*{{{*/ // --------------------------------------------------------------------- /* This initializes */ @@ -116,7 +116,7 @@ return true; } - /*}}}*/ +#endif /*}}}*/ // pkgInitConfig - Initialize the configuration class /*{{{*/ @@ -133,6 +133,7 @@ Cnf.CndSet("APT::Install-Recommends", true); Cnf.CndSet("APT::Install-Suggests", false); Cnf.CndSet("Dir","/"); + Cnf.CndSet("Acquire::Languages", "none"); // State Cnf.CndSet("Dir::State", STATE_DIR + 1); @@ -158,9 +159,9 @@ Cnf.CndSet("Dir::Etc::trusted", "trusted.gpg"); Cnf.CndSet("Dir::Etc::trustedparts","trusted.gpg.d"); Cnf.CndSet("Dir::Bin::methods", LIBEXEC_DIR "/methods"); - Cnf.CndSet("Dir::Bin::solvers::",LIBEXEC_DIR "/solvers"); - Cnf.CndSet("Dir::Bin::planners::",LIBEXEC_DIR "/planners"); - Cnf.CndSet("Dir::Media::MountPath","/media/apt"); + Cnf.CndSet("Dir::Bin::solvers::",LIBEXEC_DIR "/solvers"); + Cnf.CndSet("Dir::Bin::planners::", LIBEXEC_DIR "/planners"); + Cnf.CndSet("Dir::Media::MountPath","media/apt"); // State Cnf.CndSet("Dir::Log", LOG_DIR + 1); @@ -283,8 +284,6 @@ return _error->Error(_("Unable to determine a suitable packaging system type")); } - if (pkgInitArchTupleMap() == false) - return false; return Sys->Initialize(Cnf); } ================================================ FILE: disabled-packages/apt-updated/apt-private-private-download.cc.patch ================================================ diff -u -r ../apt-1.2.12/apt-private/private-download.cc ./apt-private/private-download.cc --- ../apt-1.2.12/apt-private/private-download.cc 2016-05-11 10:57:51.000000000 +0200 +++ ./apt-private/private-download.cc 2017-07-01 00:31:32.131776100 +0200 @@ -121,7 +121,6 @@ /*}}}*/ bool CheckFreeSpaceBeforeDownload(std::string const &Dir, unsigned long long FetchBytes)/*{{{*/ { - uint32_t const RAMFS_MAGIC = 0x858458f6; /* Check for enough free space, but only if we are actually going to download */ if (_config->FindB("APT::Get::Print-URIs", false) == true || ================================================ FILE: disabled-packages/apt-updated/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://packages.debian.org/apt TERMUX_PKG_DESCRIPTION="Front-end for the dpkg package manager" TERMUX_PKG_DEPENDS="libutil, libcurl, liblzma, dpkg, gpgv, libc++" TERMUX_PKG_VERSION=1.6~alpha3 TERMUX_PKG_SHA256=2acd561ff04fc3efa4c590139ca60cfdbc93787ea80334f7448ecf466faab119 TERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/a/apt/apt_${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DPERL_EXECUTABLE=$(which perl) -DCMAKE_INSTALL_FULL_LOCALSTATEDIR=$TERMUX_PREFIX -DCOMMON_ARCH=$TERMUX_ARCH -DDPKG_DATADIR=$TERMUX_PREFIX/share/dpkg -DUSE_NLS=OFF -DWITH_DOC=OFF " TERMUX_PKG_ESSENTIAL=true TERMUX_PKG_CONFFILES="etc/apt/sources.list" TERMUX_PKG_CONFLICTS=apt-transport-https TERMUX_PKG_REPLACES=apt-transport-https TERMUX_PKG_RM_AFTER_INSTALL=" bin/apt-cdrom bin/apt-extracttemplates bin/apt-sortpkgs etc/apt/apt.conf.d lib/apt/apt-helper lib/apt/methods/bzip2 lib/apt/methods/cdrom lib/apt/methods/mirror lib/apt/methods/rred lib/apt/planners/ lib/apt/solvers/ lib/dpkg/ lib/libapt-inst.so " termux_step_post_make_install() { printf "# The main termux repository:\ndeb [arch=all,${TERMUX_ARCH}] https://termux.net stable main\n" > $TERMUX_PREFIX/etc/apt/sources.list cp $TERMUX_PKG_BUILDER_DIR/trusted.gpg $TERMUX_PREFIX/etc/apt/ rm /data/data/com.termux/files/usr/include/apt-pkg -r } ================================================ FILE: disabled-packages/apt-updated/cmdline-apt-key.in.patch ================================================ diff -u -r ../apt-1.4.7/cmdline/apt-key.in ./cmdline/apt-key.in --- ../apt-1.4.7/cmdline/apt-key.in 2017-07-13 23:45:39.000000000 +0200 +++ ./cmdline/apt-key.in 2017-07-26 12:18:17.424086422 +0200 @@ -16,10 +16,7 @@ aptkey_echo() { echo "$@"; } requires_root() { - if [ "$(id -u)" -ne 0 ]; then - apt_error "This command can only be used by root." - exit 1 - fi +continue } command_available() { @@ -260,7 +257,7 @@ if accessible_file_exists "$TRUSTEDFILE"; then $ACTION "$TRUSTEDFILE" "$@" fi - local TRUSTEDPARTS="/etc/apt/trusted.gpg.d" + local TRUSTEDPARTS="@TERMUX_PREFIX@/etc/apt/trusted.gpg.d" eval "$(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)" if [ -d "$TRUSTEDPARTS" ]; then TRUSTEDPARTS="$(readlink -f "$TRUSTEDPARTS")" @@ -542,7 +539,7 @@ done if [ -z "$TRUSTEDFILE" ]; then - TRUSTEDFILE="/etc/apt/trusted.gpg" + TRUSTEDFILE="@TERMUX_PREFIX@/etc/apt/trusted.gpg" eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring) eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f) fi @@ -612,7 +609,8 @@ unset TMPDIR fi fi - GPGHOMEDIR="$(mktemp --directory --tmpdir 'apt-key-gpghome.XXXXXXXXXX')" + # Use short options as busybox mktemp does not support long ones: + GPGHOMEDIR="$(mktemp -d -t 'apt-key-gpghome.XXXXXXXXXX')" CURRENTTRAP="${CURRENTTRAP} cleanup_gpg_home;" trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM if [ -z "$GPGHOMEDIR" ]; then ================================================ FILE: disabled-packages/apt-updated/cmndline-no-strchrnul.patch ================================================ diff -u -r ../apt-0.9.16.1/apt-pkg/contrib/cmndline.cc ./apt-pkg/contrib/cmndline.cc --- ../apt-0.9.16.1/apt-pkg/contrib/cmndline.cc 2014-03-15 17:23:45.000000000 +0100 +++ ./apt-pkg/contrib/cmndline.cc 2014-03-25 01:10:30.764711007 +0100 @@ -27,6 +27,14 @@ /*}}}*/ using namespace std; +#if defined(__ANDROID__) +static char* strchrnul(char const* s, int c) +{ + char const* result = strchr(s, c); + return const_cast((result == NULL) ? (s + strlen(s)) : result); +} +#endif + // CommandLine::CommandLine - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ ================================================ FILE: disabled-packages/apt-updated/debsrcrecords.patch ================================================ diff -u -r ../apt-0.9.16.1/apt-pkg/deb/debsrcrecords.cc ./apt-pkg/deb/debsrcrecords.cc --- ../apt-0.9.16.1/apt-pkg/deb/debsrcrecords.cc 2014-03-15 17:23:45.000000000 +0100 +++ ./apt-pkg/deb/debsrcrecords.cc 2014-03-25 01:23:30.652689687 +0100 @@ -26,6 +26,14 @@ #include #include /*}}}*/ +#if defined(__ANDROID__) +static char* strchrnul(char const* s, int c) +{ + char const* result = strchr(s, c); + return const_cast((result == NULL) ? (s + strlen(s)) : result); +} +#endif + using std::max; using std::string; ================================================ FILE: disabled-packages/apt-updated/methods-cmakelist.patch ================================================ diff -u -r ../apt-1.6~alpha3/methods/CMakeLists.txt ./methods/CMakeLists.txt --- ../apt-1.6~alpha3/methods/CMakeLists.txt 2017-10-28 17:57:05.000000000 +0200 +++ ./methods/CMakeLists.txt 2017-11-02 17:45:55.436395981 +0100 @@ -9,11 +9,8 @@ add_executable(copy copy.cc) add_executable(store store.cc) add_executable(gpgv gpgv.cc) -add_executable(cdrom cdrom.cc) add_executable(http http_main.cc $ $) add_executable(mirror mirror.cc $ $) -add_executable(ftp ftp.cc $) -add_executable(rred rred.cc) add_executable(rsh rsh.cc) target_compile_definitions(connectlib PRIVATE ${GNUTLS_DEFINITIONS}) @@ -22,10 +19,9 @@ # Additional libraries to link against for networked stuff target_link_libraries(http ${GNUTLS_LIBRARIES}) target_link_libraries(mirror ${RESOLV_LIBRARIES} ${GNUTLS_LIBRARIES}) -target_link_libraries(ftp ${GNUTLS_LIBRARIES}) # Install the library -install(TARGETS file copy store gpgv cdrom http ftp rred rsh mirror +install(TARGETS file copy store gpgv http rsh mirror RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/apt/methods) add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods store) ================================================ FILE: disabled-packages/apt-updated/methods-connect.cc.patch ================================================ diff -u -r ../apt-1.6~alpha3/methods/connect.cc ./methods/connect.cc --- ../apt-1.6~alpha3/methods/connect.cc 2017-10-28 17:57:05.000000000 +0200 +++ ./methods/connect.cc 2017-11-02 17:47:18.803413361 +0100 @@ -164,7 +164,7 @@ // Check the socket for an error condition unsigned int Err; - unsigned int Len = sizeof(Err); + socklen_t Len = sizeof(Err); if (getsockopt(Fd->Fd(), SOL_SOCKET, SO_ERROR, &Err, &Len) != 0) return _error->Errno("getsockopt",_("Failed")); @@ -335,7 +335,10 @@ if(LastHost != Host || LastPort != Port) { SrvRecords.clear(); - if (_config->FindB("Acquire::EnableSrvRecords", true) == true) + /* Disable by default in Termux due to it breaking on (some) HTC + devices (https://github.com/termux/termux-packages/issues/99). */ + + if (_config->FindB("Acquire::EnableSrvRecords", false) == true) { GetSrvRecords(Host, DefPort, SrvRecords); // RFC2782 defines that a lonely '.' target is an abort reason ================================================ FILE: disabled-packages/apt-updated/private-output-no-langinfo.patch ================================================ diff -u -r ../upstream.git/apt-private/private-output.cc ./apt-private/private-output.cc --- ../upstream.git/apt-private/private-output.cc 2014-06-10 15:24:50.000000000 +0200 +++ ./apt-private/private-output.cc 2014-06-15 02:40:10.539223656 +0200 @@ -20,7 +20,11 @@ #include #include #include -#include +#ifdef __ANDROID__ +# include +# else +# include +#endif #include #include #include @@ -764,7 +768,7 @@ regex_t Pattern; int Res; - Res = regcomp(&Pattern, nl_langinfo(YESEXPR), + Res = regcomp(&Pattern, "^[yY]", REG_EXTENDED|REG_ICASE|REG_NOSUB); if (Res != 0) { ================================================ FILE: disabled-packages/apt-updated/vendor.patch ================================================ diff -u -r ../upstream.git/vendor/ubuntu/apt-vendor.ent ./vendor/ubuntu/apt-vendor.ent --- ../upstream.git/vendor/ubuntu/apt-vendor.ent 2014-04-25 13:39:00.000000000 +0200 +++ ./vendor/ubuntu/apt-vendor.ent 2014-06-03 11:53:11.535752314 +0200 @@ -1,7 +1,7 @@ - -ubuntu-keyring"> -/usr/share/keyrings/ubuntu-archive-keyring.gpg"> -/usr/share/keyrings/ubuntu-archive-removed-keys.gpg"> - + +termux-keyring"> +@TERMUX_PREFIX@/share/keyrings/termux-archive-keyring.gpg"> +@TERMUX_PREFIX@/share/keyrings/termux-archive-removed-keys.gpg"> + ================================================ FILE: disabled-packages/cadaver/build.sh ================================================ # Status: Does not work with openssl 1.1 or later. TERMUX_PKG_HOMEPAGE=http://www.webdav.org/cadaver/ TERMUX_PKG_DESCRIPTION="cadaver is a command-line WebDAV client for Unix" TERMUX_PKG_VERSION=0.23.3 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://fossies.org/linux/www/old/cadaver-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=123772d7d33f06a76742dba874b1c444423b52ad3a7bbb87559616ec78b9ae5e TERMUX_PKG_DEPENDS="openssl, libxml2, ncurses, readline" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --with-libxml2 --without-gssapi --with-ssl=openssl " termux_step_pre_configure() { export ac_cv_func_setlocale=no } ================================================ FILE: disabled-packages/checkinstall/Makefile.patch ================================================ diff -u -r ../checkinstall-1.6.2/Makefile ./Makefile --- ../checkinstall-1.6.2/Makefile 2008-11-11 21:43:53.000000000 -0500 +++ ./Makefile 2016-10-28 16:14:22.403691119 -0400 @@ -1,7 +1,7 @@ # $Id: Makefile,v 1.6.2.1 2008/11/09 07:48:18 izto Exp $ # Where to install. -PREFIX=/usr/local +PREFIX?=/usr/local BINDIR=$(PREFIX)/sbin LCDIR=$(PREFIX)/lib/checkinstall/locale CONFDIR=$(PREFIX)/lib/checkinstall ================================================ FILE: disabled-packages/checkinstall/build.sh ================================================ # NOTE: Currently segfaults when running. TERMUX_PKG_HOMEPAGE=http://checkinstall.izto.org/ TERMUX_PKG_DESCRIPTION="Installation tracker creating a package from a local install" TERMUX_PKG_VERSION=1.6.2 TERMUX_PKG_SRCURL=http://checkinstall.izto.org/files/source/checkinstall-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_DEPENDS="file, make" TERMUX_PKG_RM_AFTER_INSTALL="lib/checkinstall/locale/" termux_step_pre_configure() { CFLAGS+=" -D__off64_t=off64_t" CFLAGS+=" -D_STAT_VER=3" CFLAGS+=" -D_MKNOD_VER=1" CFLAGS+=" -DS_IREAD=S_IRUSR" } termux_step_post_make_install() { mv $TERMUX_PREFIX/lib/checkinstall/checkinstallrc-dist \ $TERMUX_PREFIX/lib/checkinstall/checkinstallrc } ================================================ FILE: disabled-packages/checkinstall/checkinstall.patch ================================================ diff -u -r ../checkinstall-1.6.2/checkinstall ./checkinstall --- ../checkinstall-1.6.2/checkinstall 2009-12-26 14:17:24.000000000 -0500 +++ ./checkinstall 2016-10-28 16:32:12.759574819 -0400 @@ -492,7 +492,7 @@ ckversion echo -CHECKINSTALLRC=${CHECKINSTALLRC:-${INSTALLDIR}/checkinstallrc} +CHECKINSTALLRC=${CHECKINSTALLRC:-${INSTALLDIR}/lib/checkinstall/checkinstallrc} if ! [ -f $CHECKINSTALLRC ]; then echog "The checkinstallrc file was not found at:\n$CHECKINSTALLRC" echo @@ -974,7 +974,7 @@ ! [ "$INSTALL" ] && INSTALL=0 # The place where we will be storing the temp files -! [ "$BASE_TMP_DIR" ] && BASE_TMP_DIR=/var/tmp +! [ "$BASE_TMP_DIR" ] && BASE_TMP_DIR=/data/data/com.termux/files/usr/tmp # Default RPM FLAGS ! [ "$RPM_FLAGS" ] && RPM_FLAGS=" --force --nodeps --replacepkgs " @@ -1249,7 +1249,7 @@ # Fix the PowerPC & Amd64 architecture description if we're on Debian if [ "$CK_DEBIAN" = "1" ] ; then - ARCHITECTURE=`dpkg-architecture -qDEB_HOST_ARCH` + ARCHITECTURE=`dpkg --print-architecture` fi fi @@ -1508,7 +1508,7 @@ TMP_SCRIPT=${TMP_DIR}/installscript.sh cat << EOF > $TMP_SCRIPT -#!/bin/sh +#!@TERMUX_PREFIX@/bin/sh cd "$DIRECTORIO_FUENTE" EOF @@ -1538,7 +1538,7 @@ # installwatch excludes itself some directories, but we put them all here, # to be explicit. # -IEXCLUDE="${DIRECTORIO_FUENTE},/dev,/proc,/tmp,/var/tmp" +IEXCLUDE="${DIRECTORIO_FUENTE},/dev,/proc,/tmp,/var/tmp,/data/data/com.termux/files/usr/tmp" # Run the install command, showing the results interactively if we were asked ================================================ FILE: disabled-packages/checkinstall/checkinstallrc-dist.patch ================================================ diff -u -r ../checkinstall-1.6.2/checkinstallrc-dist ./checkinstallrc-dist --- ../checkinstall-1.6.2/checkinstallrc-dist 2008-11-11 14:10:34.000000000 -0500 +++ ./checkinstallrc-dist 2016-10-28 16:28:56.558529656 -0400 @@ -16,14 +16,14 @@ DEBUG=0 # Location of the "installwatch" program -INSTALLWATCH_PREFIX="/usr/local" +INSTALLWATCH_PREFIX="/data/data/com.termux/files/usr" INSTALLWATCH=${INSTALLWATCH_PREFIX}/bin/installwatch # Location of the makepkg program. "makepak" is the default, and is # included with checkinstall. If you want to use Slackware's native "makepkg" # then set this to "makepkg" -MAKEPKG=/sbin/makepkg +MAKEPKG=/data/data/com.termux/files/usr/bin/makepkg # makepkg optional flags. These are recommended if running a newer Slackware # version: "-l y -c n" @@ -36,7 +36,7 @@ SHOW_MAKEPKG=0 # Where will we keep our temp files? -BASE_TMP_DIR=/var/tmp ## Don't set this to /tmp or / !! +BASE_TMP_DIR=@TERMUX_PREFIX@/tmp ## Don't set this to /tmp or / !! # Where to place the installed document files DOC_DIR="" ================================================ FILE: disabled-packages/checkinstall/installwatch-Makefile.patch ================================================ diff -u -r ../checkinstall-1.6.2/installwatch/Makefile ./installwatch/Makefile --- ../checkinstall-1.6.2/installwatch/Makefile 2008-11-16 11:20:53.000000000 -0500 +++ ./installwatch/Makefile 2016-10-28 16:34:12.825762120 -0400 @@ -4,7 +4,7 @@ # Well, the only configurable part is the following variable. # Make sure the directory you specify exists. -PREFIX=/usr/local +PREFIX?=/usr/local # End of configurable part @@ -16,10 +16,10 @@ all: installwatch.so installwatch.so: installwatch.o - ld -shared -o installwatch.so installwatch.o -ldl -lc + $(CC) $(LDFLAGS) -shared -o installwatch.so installwatch.o -ldl -lc -llog installwatch.o: installwatch.c localdecls.h - gcc -Wall -c -D_GNU_SOURCE -DPIC -fPIC -D_REENTRANT -DVERSION=\"$(VERSION)\" installwatch.c + $(CC) $(CFLAGS) -Wall -c -D_GNU_SOURCE -DPIC -fPIC -D_REENTRANT -DVERSION=\"$(VERSION)\" installwatch.c localdecls.h: create-localdecls ./create-localdecls ================================================ FILE: disabled-packages/checkinstall/installwatch.c.patch ================================================ diff -u -r ../checkinstall-1.6.2/installwatch/installwatch.c ./installwatch/installwatch.c --- ../checkinstall-1.6.2/installwatch/installwatch.c 2008-11-16 11:20:53.000000000 -0500 +++ ./installwatch/installwatch.c 2016-10-28 16:12:42.017221485 -0400 @@ -2938,13 +2938,8 @@ return result; } -#if (GLIBC_MINOR <= 4) -int readlink(const char *path,char *buf,size_t bufsiz) { - int result; -#else ssize_t readlink(const char *path,char *buf,size_t bufsiz) { ssize_t result; -#endif instw_t instw; int status; @@ -3079,7 +3074,7 @@ int scandir( const char *dir,struct dirent ***namelist, int (*select)(const struct dirent *), - int (*compar)(const void *,const void *) ) { + int (*compar)(const struct dirent**,const struct dirent**) ) { int result; if (!libc_handle) @@ -3691,7 +3686,7 @@ int scandir64( const char *dir,struct dirent64 ***namelist, int (*select)(const struct dirent64 *), - int (*compar)(const void *,const void *) ) { + int (*compar)(const struct dirent64**,const struct dirent64**) ) { int result; if (!libc_handle) ================================================ FILE: disabled-packages/clisp/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.clisp.org/ TERMUX_PKG_DESCRIPTION="GNU CLISP - an ANSI Common Lisp Implementation" TERMUX_PKG_VERSION=2.49 TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/clisp/clisp/${TERMUX_PKG_VERSION}/clisp-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_DEPENDS="readline, libandroid-support" TERMUX_MAKE_PROCESSES=1 termux_step_configure() { cd $TERMUX_PKG_BUILDDIR export XCPPFLAGS="$CPPFLAGS" export XCFLAGS="$CFLAGS" export XLDFLAGS="$LDFLAGS" unset CC unset CPPFLAGS unset CFLAGS unset LDFLAGS $TERMUX_PKG_SRCDIR/configure \ --host=$TERMUX_HOST_PLATFORM \ --prefix=$TERMUX_PREFIX \ --enable-shared \ --disable-static \ --srcdir=$TERMUX_PKG_SRCDIR \ --ignore-absence-of-libsigsegv \ ac_cv_func_select=yes } ================================================ FILE: disabled-packages/clisp/src-gllib-stdint.in.h.patch ================================================ diff -u -r ../clisp-2.49/src/gllib/stdint.in.h ./src/gllib/stdint.in.h --- ../clisp-2.49/src/gllib/stdint.in.h 2010-05-18 14:38:04.000000000 -0400 +++ ./src/gllib/stdint.in.h 2016-02-17 15:35:07.664544781 -0500 @@ -1,568 +1 @@ -/* Copyright (C) 2001-2002, 2004-2010 Free Software Foundation, Inc. - Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. - This file is part of gnulib. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* - * ISO C 99 for platforms that lack it. - * - */ - -#ifndef _gl_GL_STDINT_H - -#if __GNUC__ >= 3 -@PRAGMA_SYSTEM_HEADER@ -#endif - -/* When including a system file that in turn includes , - use the system , not our substitute. This avoids - problems with (for example) VMS, whose includes - . */ -#define _gl_GL_JUST_INCLUDE_SYSTEM_INTTYPES_H - -/* Get those types that are already defined in other system include - files, so that we can "#define int8_t signed char" below without - worrying about a later system include file containing a "typedef - signed char int8_t;" that will get messed up by our macro. Our - macros should all be consistent with the system versions, except - for the "fast" types and macros, which we recommend against using - in public interfaces due to compiler differences. */ - -#if @HAVE_STDINT_H@ -# if defined __sgi && ! defined __c99 - /* Bypass IRIX's if in C89 mode, since it merely annoys users - with "This header file is to be used only for c99 mode compilations" - diagnostics. */ -# define __STDINT_H__ -# endif - /* Other systems may have an incomplete or buggy . - Include it before , since any "#include " - in would reinclude us, skipping our contents because - _gl_GL_STDINT_H is defined. - The include_next requires a split double-inclusion guard. */ -# @INCLUDE_NEXT@ @NEXT_STDINT_H@ -#endif - -#if ! defined _gl_GL_STDINT_H && ! defined _gl_GL_JUST_INCLUDE_SYSTEM_STDINT_H -#define _gl_GL_STDINT_H - -/* defines some of the stdint.h types as well, on glibc, - IRIX 6.5, and OpenBSD 3.8 (via ). - AIX 5.2 isn't needed and causes troubles. - MacOS X 10.4.6 includes (which is us), but - relies on the system definitions, so include - after @NEXT_STDINT_H@. */ -#if @HAVE_SYS_TYPES_H@ && ! defined _AIX -# include -#endif - -/* Get LONG_MIN, LONG_MAX, ULONG_MAX. */ -#include - -#if @HAVE_INTTYPES_H@ - /* In OpenBSD 3.8, includes , which defines - int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. - also defines intptr_t and uintptr_t. */ -# include -#elif @HAVE_SYS_INTTYPES_H@ - /* Solaris 7 has the types except the *_fast*_t types, and - the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */ -# include -#endif - -#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ - /* Linux libc4 >= 4.6.7 and libc5 have a that defines - int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is - included by . */ -# include -#endif - -#undef _gl_GL_JUST_INCLUDE_SYSTEM_INTTYPES_H - -/* Minimum and maximum values for a integer type under the usual assumption. - Return an unspecified value if BITS == 0, adding a check to pacify - picky compilers. */ - -#define _STDINT_MIN(signed, bits, zero) \ - ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero)) - -#define _STDINT_MAX(signed, bits, zero) \ - ((signed) \ - ? ~ _STDINT_MIN (signed, bits, zero) \ - : /* The expression for the unsigned case. The subtraction of (signed) \ - is a nop in the unsigned case and avoids "signed integer overflow" \ - warnings in the signed case. */ \ - ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) - -/* 7.18.1.1. Exact-width integer types */ - -/* Here we assume a standard architecture where the hardware integer - types have 8, 16, 32, optionally 64 bits. */ - -#undef int8_t -#undef uint8_t -typedef signed char gl_int8_t; -typedef unsigned char gl_uint8_t; -#define int8_t gl_int8_t -#define uint8_t gl_uint8_t - -#undef int16_t -#undef uint16_t -typedef short int gl_int16_t; -typedef unsigned short int gl_uint16_t; -#define int16_t gl_int16_t -#define uint16_t gl_uint16_t - -#undef int32_t -#undef uint32_t -typedef int gl_int32_t; -typedef unsigned int gl_uint32_t; -#define int32_t gl_int32_t -#define uint32_t gl_uint32_t - -/* Do not undefine int64_t if gnulib is not being used with 64-bit - types, since otherwise it breaks platforms like Tandem/NSK. */ -#if LONG_MAX >> 31 >> 31 == 1 -# undef int64_t -typedef long int gl_int64_t; -# define int64_t gl_int64_t -# define GL_INT64_T -#elif defined _MSC_VER -# undef int64_t -typedef __int64 gl_int64_t; -# define int64_t gl_int64_t -# define GL_INT64_T -#elif @HAVE_LONG_LONG_INT@ -# undef int64_t -typedef long long int gl_int64_t; -# define int64_t gl_int64_t -# define GL_INT64_T -#endif - -#if ULONG_MAX >> 31 >> 31 >> 1 == 1 -# undef uint64_t -typedef unsigned long int gl_uint64_t; -# define uint64_t gl_uint64_t -# define GL_UINT64_T -#elif defined _MSC_VER -# undef uint64_t -typedef unsigned __int64 gl_uint64_t; -# define uint64_t gl_uint64_t -# define GL_UINT64_T -#elif @HAVE_UNSIGNED_LONG_LONG_INT@ -# undef uint64_t -typedef unsigned long long int gl_uint64_t; -# define uint64_t gl_uint64_t -# define GL_UINT64_T -#endif - -/* Avoid collision with Solaris 2.5.1 etc. */ -#define _UINT8_T -#define _UINT32_T -#define _UINT64_T - - -/* 7.18.1.2. Minimum-width integer types */ - -/* Here we assume a standard architecture where the hardware integer - types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types - are the same as the corresponding N_t types. */ - -#undef int_least8_t -#undef uint_least8_t -#undef int_least16_t -#undef uint_least16_t -#undef int_least32_t -#undef uint_least32_t -#undef int_least64_t -#undef uint_least64_t -#define int_least8_t int8_t -#define uint_least8_t uint8_t -#define int_least16_t int16_t -#define uint_least16_t uint16_t -#define int_least32_t int32_t -#define uint_least32_t uint32_t -#ifdef GL_INT64_T -# define int_least64_t int64_t -#endif -#ifdef GL_UINT64_T -# define uint_least64_t uint64_t -#endif - -/* 7.18.1.3. Fastest minimum-width integer types */ - -/* Note: Other substitutes may define these types differently. - It is not recommended to use these types in public header files. */ - -/* Here we assume a standard architecture where the hardware integer - types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types - are taken from the same list of types. Assume that 'long int' - is fast enough for all narrower integers. */ - -#undef int_fast8_t -#undef uint_fast8_t -#undef int_fast16_t -#undef uint_fast16_t -#undef int_fast32_t -#undef uint_fast32_t -#undef int_fast64_t -#undef uint_fast64_t -typedef long int gl_int_fast8_t; -typedef unsigned long int gl_uint_fast8_t; -typedef long int gl_int_fast16_t; -typedef unsigned long int gl_uint_fast16_t; -typedef long int gl_int_fast32_t; -typedef unsigned long int gl_uint_fast32_t; -#define int_fast8_t gl_int_fast8_t -#define uint_fast8_t gl_uint_fast8_t -#define int_fast16_t gl_int_fast16_t -#define uint_fast16_t gl_uint_fast16_t -#define int_fast32_t gl_int_fast32_t -#define uint_fast32_t gl_uint_fast32_t -#ifdef GL_INT64_T -# define int_fast64_t int64_t -#endif -#ifdef GL_UINT64_T -# define uint_fast64_t uint64_t -#endif - -/* 7.18.1.4. Integer types capable of holding object pointers */ - -#undef intptr_t -#undef uintptr_t -typedef long int gl_intptr_t; -typedef unsigned long int gl_uintptr_t; -#define intptr_t gl_intptr_t -#define uintptr_t gl_uintptr_t - -/* 7.18.1.5. Greatest-width integer types */ - -/* Note: These types are compiler dependent. It may be unwise to use them in - public header files. */ - -#undef intmax_t -#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -typedef long long int gl_intmax_t; -# define intmax_t gl_intmax_t -#elif defined GL_INT64_T -# define intmax_t int64_t -#else -typedef long int gl_intmax_t; -# define intmax_t gl_intmax_t -#endif - -#undef uintmax_t -#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 -typedef unsigned long long int gl_uintmax_t; -# define uintmax_t gl_uintmax_t -#elif defined GL_UINT64_T -# define uintmax_t uint64_t -#else -typedef unsigned long int gl_uintmax_t; -# define uintmax_t gl_uintmax_t -#endif - -/* Verify that intmax_t and uintmax_t have the same size. Too much code - breaks if this is not the case. If this check fails, the reason is likely - to be found in the autoconf macros. */ -typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) - 1]; - -/* 7.18.2. Limits of specified-width integer types */ - -#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS - -/* 7.18.2.1. Limits of exact-width integer types */ - -/* Here we assume a standard architecture where the hardware integer - types have 8, 16, 32, optionally 64 bits. */ - -#undef INT8_MIN -#undef INT8_MAX -#undef UINT8_MAX -#define INT8_MIN (~ INT8_MAX) -#define INT8_MAX 127 -#define UINT8_MAX 255 - -#undef INT16_MIN -#undef INT16_MAX -#undef UINT16_MAX -#define INT16_MIN (~ INT16_MAX) -#define INT16_MAX 32767 -#define UINT16_MAX 65535 - -#undef INT32_MIN -#undef INT32_MAX -#undef UINT32_MAX -#define INT32_MIN (~ INT32_MAX) -#define INT32_MAX 2147483647 -#define UINT32_MAX 4294967295U - -#undef INT64_MIN -#undef INT64_MAX -#ifdef GL_INT64_T -/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0 - evaluates the latter incorrectly in preprocessor expressions. */ -# define INT64_MIN (- INTMAX_C (1) << 63) -# define INT64_MAX INTMAX_C (9223372036854775807) -#endif - -#undef UINT64_MAX -#ifdef GL_UINT64_T -# define UINT64_MAX UINTMAX_C (18446744073709551615) -#endif - -/* 7.18.2.2. Limits of minimum-width integer types */ - -/* Here we assume a standard architecture where the hardware integer - types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types - are the same as the corresponding N_t types. */ - -#undef INT_LEAST8_MIN -#undef INT_LEAST8_MAX -#undef UINT_LEAST8_MAX -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST8_MAX INT8_MAX -#define UINT_LEAST8_MAX UINT8_MAX - -#undef INT_LEAST16_MIN -#undef INT_LEAST16_MAX -#undef UINT_LEAST16_MAX -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST16_MAX INT16_MAX -#define UINT_LEAST16_MAX UINT16_MAX - -#undef INT_LEAST32_MIN -#undef INT_LEAST32_MAX -#undef UINT_LEAST32_MAX -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST32_MAX INT32_MAX -#define UINT_LEAST32_MAX UINT32_MAX - -#undef INT_LEAST64_MIN -#undef INT_LEAST64_MAX -#ifdef GL_INT64_T -# define INT_LEAST64_MIN INT64_MIN -# define INT_LEAST64_MAX INT64_MAX -#endif - -#undef UINT_LEAST64_MAX -#ifdef GL_UINT64_T -# define UINT_LEAST64_MAX UINT64_MAX -#endif - -/* 7.18.2.3. Limits of fastest minimum-width integer types */ - -/* Here we assume a standard architecture where the hardware integer - types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types - are taken from the same list of types. */ - -#undef INT_FAST8_MIN -#undef INT_FAST8_MAX -#undef UINT_FAST8_MAX -#define INT_FAST8_MIN LONG_MIN -#define INT_FAST8_MAX LONG_MAX -#define UINT_FAST8_MAX ULONG_MAX - -#undef INT_FAST16_MIN -#undef INT_FAST16_MAX -#undef UINT_FAST16_MAX -#define INT_FAST16_MIN LONG_MIN -#define INT_FAST16_MAX LONG_MAX -#define UINT_FAST16_MAX ULONG_MAX - -#undef INT_FAST32_MIN -#undef INT_FAST32_MAX -#undef UINT_FAST32_MAX -#define INT_FAST32_MIN LONG_MIN -#define INT_FAST32_MAX LONG_MAX -#define UINT_FAST32_MAX ULONG_MAX - -#undef INT_FAST64_MIN -#undef INT_FAST64_MAX -#ifdef GL_INT64_T -# define INT_FAST64_MIN INT64_MIN -# define INT_FAST64_MAX INT64_MAX -#endif - -#undef UINT_FAST64_MAX -#ifdef GL_UINT64_T -# define UINT_FAST64_MAX UINT64_MAX -#endif - -/* 7.18.2.4. Limits of integer types capable of holding object pointers */ - -#undef INTPTR_MIN -#undef INTPTR_MAX -#undef UINTPTR_MAX -#define INTPTR_MIN LONG_MIN -#define INTPTR_MAX LONG_MAX -#define UINTPTR_MAX ULONG_MAX - -/* 7.18.2.5. Limits of greatest-width integer types */ - -#undef INTMAX_MIN -#undef INTMAX_MAX -#ifdef INT64_MAX -# define INTMAX_MIN INT64_MIN -# define INTMAX_MAX INT64_MAX -#else -# define INTMAX_MIN INT32_MIN -# define INTMAX_MAX INT32_MAX -#endif - -#undef UINTMAX_MAX -#ifdef UINT64_MAX -# define UINTMAX_MAX UINT64_MAX -#else -# define UINTMAX_MAX UINT32_MAX -#endif - -/* 7.18.3. Limits of other integer types */ - -/* ptrdiff_t limits */ -#undef PTRDIFF_MIN -#undef PTRDIFF_MAX -#if @APPLE_UNIVERSAL_BUILD@ -# ifdef _LP64 -# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l) -# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l) -# else -# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0) -# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0) -# endif -#else -# define PTRDIFF_MIN \ - _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) -# define PTRDIFF_MAX \ - _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) -#endif - -/* sig_atomic_t limits */ -#undef SIG_ATOMIC_MIN -#undef SIG_ATOMIC_MAX -#define SIG_ATOMIC_MIN \ - _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ - 0@SIG_ATOMIC_T_SUFFIX@) -#define SIG_ATOMIC_MAX \ - _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ - 0@SIG_ATOMIC_T_SUFFIX@) - - -/* size_t limit */ -#undef SIZE_MAX -#if @APPLE_UNIVERSAL_BUILD@ -# ifdef _LP64 -# define SIZE_MAX _STDINT_MAX (0, 64, 0ul) -# else -# define SIZE_MAX _STDINT_MAX (0, 32, 0ul) -# endif -#else -# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) -#endif - -/* wchar_t limits */ -/* Get WCHAR_MIN, WCHAR_MAX. - This include is not on the top, above, because on OSF/1 4.0 we have a sequence of nested - includes -> -> -> , and the latter includes - and assumes its types are already defined. */ -#if ! (defined WCHAR_MIN && defined WCHAR_MAX) -# define _gl_GL_JUST_INCLUDE_SYSTEM_WCHAR_H -# include -# undef _gl_GL_JUST_INCLUDE_SYSTEM_WCHAR_H -#endif -#undef WCHAR_MIN -#undef WCHAR_MAX -#define WCHAR_MIN \ - _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) -#define WCHAR_MAX \ - _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) - -/* wint_t limits */ -#undef WINT_MIN -#undef WINT_MAX -#define WINT_MIN \ - _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) -#define WINT_MAX \ - _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) - -#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */ - -/* 7.18.4. Macros for integer constants */ - -#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS - -/* 7.18.4.1. Macros for minimum-width integer constants */ -/* According to ISO C 99 Technical Corrigendum 1 */ - -/* Here we assume a standard architecture where the hardware integer - types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */ - -#undef INT8_C -#undef UINT8_C -#define INT8_C(x) x -#define UINT8_C(x) x - -#undef INT16_C -#undef UINT16_C -#define INT16_C(x) x -#define UINT16_C(x) x - -#undef INT32_C -#undef UINT32_C -#define INT32_C(x) x -#define UINT32_C(x) x ## U - -#undef INT64_C -#undef UINT64_C -#if LONG_MAX >> 31 >> 31 == 1 -# define INT64_C(x) x##L -#elif defined _MSC_VER -# define INT64_C(x) x##i64 -#elif @HAVE_LONG_LONG_INT@ -# define INT64_C(x) x##LL -#endif -#if ULONG_MAX >> 31 >> 31 >> 1 == 1 -# define UINT64_C(x) x##UL -#elif defined _MSC_VER -# define UINT64_C(x) x##ui64 -#elif @HAVE_UNSIGNED_LONG_LONG_INT@ -# define UINT64_C(x) x##ULL -#endif - -/* 7.18.4.2. Macros for greatest-width integer constants */ - -#undef INTMAX_C -#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -# define INTMAX_C(x) x##LL -#elif defined GL_INT64_T -# define INTMAX_C(x) INT64_C(x) -#else -# define INTMAX_C(x) x##L -#endif - -#undef UINTMAX_C -#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 -# define UINTMAX_C(x) x##ULL -#elif defined GL_UINT64_T -# define UINTMAX_C(x) UINT64_C(x) -#else -# define UINTMAX_C(x) x##UL -#endif - -#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */ - -#endif /* _gl_GL_STDINT_H */ -#endif /* !defined _gl_GL_STDINT_H && !defined _gl_GL_JUST_INCLUDE_SYSTEM_STDINT_H */ +#include_next ================================================ FILE: disabled-packages/clisp/src-makefile.in.patch ================================================ diff -u -r ../clisp-2.49/src/makemake.in ./src/makemake.in --- ../clisp-2.49/src/makemake.in 2010-07-07 11:15:35.000000000 -0400 +++ ./src/makemake.in 2016-02-17 15:27:00.420198622 -0500 @@ -651,9 +651,6 @@ # We can cross-compile only with GCC XCC=${COMPILER} # ${TSYS}-gcc XCPP="${XCC} -E" - XCPPFLAGS='' - XCFLAGS='' - XLDFLAGS='' XCC_GCC=true XCC_NEED_DEEMA=false else ================================================ FILE: disabled-packages/crawl/build.sh ================================================ # Currently fails at: # Makefile:101: recipe for target 'tiledef-dngn.h' failed # make[1]: *** [tiledef-dngn.h] Segmentation fault (core dumped) TERMUX_PKG_HOMEPAGE=https://crawl.develz.org/ TERMUX_PKG_DESCRIPTION="Roguelike adventure through dungeons filled with dangerous monsters" TERMUX_PKG_VERSION=0.17.1 TERMUX_PKG_SRCURL=https://crawl.develz.org/release/stone_soup-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_EXTRA_MAKE_ARGS="V=1" TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { export CROSSHOST=$TERMUX_HOST_PLATFORM TERMUX_PKG_BUILDDIR=$TERMUX_PKG_SRCDIR/source } ================================================ FILE: disabled-packages/cups/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.cups.org TERMUX_PKG_VERSION=2.2.4 TERMUX_PKG_DEPENDS=krb5 TERMUX_PKG_SRCURL=https://github.com/apple/cups/releases/download/v$TERMUX_PKG_VERSION/cups-$TERMUX_PKG_VERSION-source.tar.gz TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas" TERMUX_PKG_SHA256=596d4db72651c335469ae5f37b0da72ac9f97d73e30838d787065f559dea98cc TERMUX_PKG_DEPENDS="libandroid-support, libcrypt" TERMUX_PKG_FOLDERNAME=cups-$TERMUX_PKG_VERSION TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-option-checking --disable-gssapi --with-components=core " termux_step_pre_configure() { LDFLAGS="$LDFLAGS -llog -lcrypt" } termux_step_post_make_install() { mv "$TERMUX_PREFIX"/lib64/libcups.so* "$TERMUX_PREFIX"/lib/ } ================================================ FILE: disabled-packages/cups/cups-thread.c.patch ================================================ --- ./cups/thread.c 2017-06-30 21:14:38.000000000 +0530 +++ ../thread.c 2017-09-24 10:12:11.169628258 +0530 @@ -18,6 +18,7 @@ #include "cups-private.h" #include "thread-private.h" +#include #if defined(HAVE_PTHREAD_H) @@ -150,7 +151,7 @@ void _cupsThreadCancel(_cups_thread_t thread)/* I - Thread ID */ { - pthread_cancel(thread); + pthread_kill(thread, SIGTERM); } ================================================ FILE: disabled-packages/cups/file.c.patch ================================================ --- ./cups/file.c 2016-10-04 01:25:40.000000000 +0530 +++ ../file.c 2016-12-11 09:51:21.994431659 +0530 @@ -39,6 +39,9 @@ static ssize_t cups_read(cups_file_t *fp, char *buf, size_t bytes); static ssize_t cups_write(cups_file_t *fp, const char *buf, size_t bytes); +#ifdef __ANDROID__ +#include "lockf.cpp" +#endif #ifndef WIN32 /* ================================================ FILE: disabled-packages/cups/lockf.cpp.patch ================================================ --- /dev/null 2016-12-11 08:33:21.825618476 +0530 +++ ./cups/lockf.cpp 2016-12-11 09:44:20.050966252 +0530 @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include +#include +#include +#include + +#ifndef _BITS_LOCKF_H_ +#define _BITS_LOCKF_H_ + +#include + +#define F_ULOCK 0 +#define F_LOCK 1 +#define F_TLOCK 2 +#define F_TEST 3 + +__BEGIN_DECLS + +#if defined(__USE_FILE_OFFSET64) +int lockf(int, int, off_t) __RENAME(lockf64); +#else +int lockf(int, int, off_t); +#endif +int lockf64(int, int, off64_t); + +__END_DECLS + +#endif + + +int lockf64(int fd, int cmd, off64_t length) { + // Translate POSIX lockf into fcntl. + struct flock fl; + memset(&fl, 0, sizeof(fl)); + fl.l_whence = SEEK_CUR; + fl.l_start = 0; + fl.l_len = length; + if (cmd == F_ULOCK) { + fl.l_type = F_UNLCK; + cmd = F_SETLK64; + return fcntl(fd, F_SETLK64, &fl); + } + if (cmd == F_LOCK) { + fl.l_type = F_WRLCK; + return fcntl(fd, F_SETLKW64, &fl); + } + if (cmd == F_TLOCK) { + fl.l_type = F_WRLCK; + return fcntl(fd, F_SETLK64, &fl); + } + if (cmd == F_TEST) { + fl.l_type = F_RDLCK; + if (fcntl(fd, F_GETLK64, &fl) == -1) return -1; + if (fl.l_type == F_UNLCK || fl.l_pid == getpid()) return 0; + errno = EACCES; + return -1; + } + errno = EINVAL; + return -1; +} +int lockf(int fd, int cmd, off_t length) { + return lockf64(fd, cmd, length); +} ================================================ FILE: disabled-packages/d8/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://r8.googlesource.com/r8 TERMUX_PKG_DESCRIPTION="Dexer that converts java byte code to dex code" TERMUX_PKG_VERSION=$TERMUX_ANDROID_BUILD_TOOLS_VERSION TERMUX_PKG_PLATFORM_INDEPENDENT=true termux_step_make_install() { # Rewrite packages to avoid using com.android.* classes which may clash with # classes in the Android runtime on devices (see #1801): local JARJAR=$TERMUX_PKG_CACHEDIR/jarjar.jar local RULEFILE=$TERMUX_PKG_TMPDIR/jarjar-rule.txt local REWRITTEN_DX=$TERMUX_PKG_TMPDIR/d8-rewritten.jar termux_download \ http://repo.bodar.com/com/googlecode/jarjar/jarjar/1.4.1/jarjar-1.4.1.jar \ $JARJAR \ c16b1cee296526baae432c382f83d540d4b648dc21923428a66a69ba43b7df9e echo 'rule com.android.** d8.@1' > $RULEFILE java -jar $JARJAR process $RULEFILE \ $ANDROID_HOME/build-tools/${TERMUX_PKG_VERSION}/lib/d8.jar \ $REWRITTEN_DX # Dex the rewritten jar file: mkdir -p $TERMUX_PREFIX/share/dex $TERMUX_D8 \ --classpath $ANDROID_HOME/platforms/android-$TERMUX_PKG_API_LEVEL/android.jar \ --release \ --min-api 21 \ --output $TERMUX_PREFIX/share/dex/d8.jar \ $REWRITTEN_DX install $TERMUX_PKG_BUILDER_DIR/d8 $TERMUX_PREFIX/bin/d8 perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/d8 } ================================================ FILE: disabled-packages/d8/d8 ================================================ #!/bin/sh exec dalvikvm \ -Xmx256m \ -cp @TERMUX_PREFIX@/share/dex/d8.jar \ d8.tools.r8.D8 \ --classpath $PREFIX/share/java/android.jar \ $@ ================================================ FILE: disabled-packages/deborphan/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://packages.debian.org/source/sid/deborphan TERMUX_PKG_DESCRIPTION="Program that can find unused packages" TERMUX_PKG_VERSION=1.7.28.8-0.3 TERMUX_PKG_SRCURL=http://http.debian.net/debian/pool/main/d/deborphan/deborphan_$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_MAINTAINER="Pierre Rudloff @Rudloff" ================================================ FILE: disabled-packages/deborphan/configure.patch ================================================ diff -u -r ../deborphan/configure ./configure --- ../deborphan/configure 2016-02-21 09:05:27.000000000 -0500 +++ ./configure 2016-08-11 05:52:10.144221407 -0400 @@ -2957,7 +2957,7 @@ -$as_echo "#define STATUS_FILE \"/var/lib/dpkg/status\"" >>confdefs.h +$as_echo "#define STATUS_FILE \"@TERMUX_PREFIX@/var/lib/dpkg/status\"" >>confdefs.h $as_echo "#define REG_FLAGS REG_ICASE" >>confdefs.h ================================================ FILE: disabled-packages/deborphan/errno.patch ================================================ diff --git a/src/exit.c b/src/exit.c index e76a75e..99cfbdd 100644 --- a/src/exit.c +++ b/src/exit.c @@ -21,7 +21,6 @@ #ifdef HAVE_ERRNO_H # include -extern int errno; #endif #ifdef ENABLE_NLS diff --git a/src/xalloc.c b/src/xalloc.c index 8c830e7..43cfb64 100644 --- a/src/xalloc.c +++ b/src/xalloc.c @@ -22,7 +22,6 @@ #ifdef HAVE_ERRNO_H # include -extern int errno; #endif #ifdef STDC_HEADERS ================================================ FILE: disabled-packages/deborphan/src-Makefile.in.patch ================================================ diff -u -r ../deborphan/src/Makefile.in ./src/Makefile.in --- ../deborphan/src/Makefile.in 2016-02-21 09:05:27.000000000 -0500 +++ ./src/Makefile.in 2016-08-11 06:13:53.452865872 -0400 @@ -213,7 +213,7 @@ target_alias = @target_alias@ deborphan_SOURCES = deborphan.c exit.c libdeps.c pkginfo.c xalloc.c string.c keep.c file.c set.c KEEPNAME = keep -STATEDIR = /var/lib/deborphan +STATEDIR = @TERMUX_PREFIX@/var/lib/deborphan KEEPFILE = $(STATEDIR)/$(KEEPNAME) INCLUDES = -I../include all: all-am ================================================ FILE: disabled-packages/deborphan/src-deborphan.c.patch ================================================ diff -u -r ../deborphan/src/deborphan.c ./src/deborphan.c --- ../deborphan/src/deborphan.c 2016-02-21 09:05:27.000000000 -0500 +++ ./src/deborphan.c 2016-08-11 06:20:43.718666170 -0400 @@ -562,8 +562,6 @@ if (this->install) check_lib_deps(package, this, print_arch_suffixes); - free_pkg_regex(); - fflush(stdout); for (i = 0; options[SEARCH] && search_for[i].name; i++) { ================================================ FILE: disabled-packages/deborphan/src-pkginfo.c.patch ================================================ diff -u -r ../deborphan/src/pkginfo.c ./src/pkginfo.c --- ../deborphan/src/pkginfo.c 2016-02-21 09:05:27.000000000 -0500 +++ ./src/pkginfo.c 2016-08-11 06:10:28.211955162 -0400 @@ -106,10 +106,16 @@ regfree(&re_statushold); regfree(&re_statusconfig); regfree(&re_status); - regfree(&re_namedev); - regfree(&re_gnugrepv); - regfree(&re_descdummy); - regfree(&re_desctransit); + if (options[GUESS]) { + if (!guess_unique(GUESS_SECTION)) + regfree(&re_namedev); + if (guess_chk(GUESS_SECTION)) + regfree(&re_gnugrepv); + if (guess_chk(GUESS_DUMMY)) { + regfree(&re_descdummy); + regfree(&re_desctransit); + } + } } /* A similar "hack" was created by Paul Martin a while ago. It was not ================================================ FILE: disabled-packages/dovecot/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.dovecot.org TERMUX_PKG_DESCRIPTION="Secure IMAP and POP3 email server" TERMUX_PKG_VERSION=2.2.31 TERMUX_PKG_SRCURL=https://www.dovecot.org/releases/2.2/dovecot-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=034be40907748128d65088a4f59789b2f99ae7b33a88974eae0b6a68ece376a1 TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas" TERMUX_PKG_DEPENDS="openssl, libcrypt" # turning on icu gives undefined reference to __cxa_call_unexpected TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --with-zlib --with-ssl=openssl --with-ssldir=$TERMUX_PREFIX/etc/tls --without-icu --without-shadow i_cv_epoll_works=yes i_cv_posix_fallocate_works=yes i_cv_signed_size_t=no i_cv_gmtime_max_time_t=40 i_cv_signed_time_t=yes i_cv_mmap_plays_with_write=yes i_cv_fd_passing=yes i_cv_c99_vsnprintf=yes lib_cv_va_copy=yes lib_cv___va_copy=yes " termux_step_pre_configure() { LDFLAGS="$LDFLAGS -llog" for i in $(find $TERMUX_PKG_SRCDIR/src/director -type f); do sed 's|\bstruct user\b|struct usertest|g' -i $i; done if [ "$TERMUX_ARCH" == "aarch64" ]; then TERMUX_PKG_EXTRA_CONFIGURE_ARGS+="lib_cv_va_val_copy=yes" else TERMUX_PKG_EXTRA_CONFIGURE_ARGS+="lib_cv_va_val_copy=no" fi } termux_step_post_make_install() { for binary in doveadm doveconf; do mv $TERMUX_PREFIX/bin/$binary $TERMUX_PREFIX/libexec/dovecot/$binary cat > $TERMUX_PREFIX/bin/$binary <>confdefs.h - - have_rquota=yes -fi if test "$have_rquota" = "yes"; then HAVE_RQUOTA_TRUE= HAVE_RQUOTA_FALSE='#' ================================================ FILE: disabled-packages/dovecot/src-lib-connection.h.patch ================================================ --- ./src/lib/connection.h 2016-12-03 22:43:21.000000000 +0530 +++ ../connection.h 2017-06-09 22:47:48.138342901 +0530 @@ -2,6 +2,7 @@ #define CONNECTION_H #include "net.h" +#include struct connection; ================================================ FILE: disabled-packages/easy-rsa/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://openvpn.net/easyrsa.html TERMUX_PKG_VERSION=3.0.1 TERMUX_PKG_DEPENDS="openssl-tool" TERMUX_PKG_SRCURL=https://github.com/OpenVPN/easy-rsa/releases/download/$TERMUX_PKG_VERSION/EasyRSA-$TERMUX_PKG_VERSION.tgz TERMUX_PKG_SHA256=dbdaf5b9444b99e0c5221fd4bcf15384c62380c1b63cea23d42239414d7b2d4e TERMUX_PKG_CONFFILES="etc/easy-rsa/openssl-1.0.cnf, etc/easy-rsa/vars" TERMUX_PKG_MAINTAINER='Vishal Biswas @vishalbiswas' TERMUX_PKG_BUILD_IN_SRC=true termux_step_make_install() { install -D -m0755 easyrsa "${TERMUX_PREFIX}"/bin/easyrsa install -D -m0644 openssl-1.0.cnf "${TERMUX_PREFIX}"/etc/easy-rsa/openssl-1.0.cnf install -D -m0644 vars.example "${TERMUX_PREFIX}"/etc/easy-rsa/vars install -d -m0755 "${TERMUX_PREFIX}"/etc/easy-rsa/x509-types/ install -m0644 x509-types/* "${TERMUX_PREFIX}"/etc/easy-rsa/x509-types/ } ================================================ FILE: disabled-packages/ghc/bitcast.patch ================================================ From https://github.com/erikd/ghc-llvm-next/blob/llvm-3.8/patches/01-bitcast.patch diff -u -r ../ghc-8.0.1/compiler/llvmGen/Llvm/PpLlvm.hs ./compiler/llvmGen/Llvm/PpLlvm.hs --- ../ghc-8.0.1/compiler/llvmGen/Llvm/PpLlvm.hs 2016-05-16 13:08:53.000000000 -0400 +++ ./compiler/llvmGen/Llvm/PpLlvm.hs 2016-06-23 16:59:36.113778783 -0400 @@ -73,7 +73,7 @@ Nothing -> empty rhs = case dat of - Just stat -> ppr stat + Just stat -> pprSpecialStatic stat Nothing -> ppr (pLower $ getVarType var) -- Position of linkage is different for aliases. diff -u -r ../ghc-8.0.1/compiler/llvmGen/Llvm/Types.hs ./compiler/llvmGen/Llvm/Types.hs --- ../ghc-8.0.1/compiler/llvmGen/Llvm/Types.hs 2016-05-16 13:08:53.000000000 -0400 +++ ./compiler/llvmGen/Llvm/Types.hs 2016-06-23 17:00:14.569166114 -0400 @@ -175,6 +175,11 @@ ppr (LMSub s1 s2) = pprStaticArith s1 s2 (sLit "sub") (sLit "fsub") "LMSub" +pprSpecialStatic :: LlvmStatic -> SDoc +pprSpecialStatic (LMBitc v t) = + ppr (pLower t) <> text ", bitcast (" <> ppr v <> text " to " <> ppr t <> char ')' +pprSpecialStatic stat = ppr stat + pprStaticArith :: LlvmStatic -> LlvmStatic -> LitString -> LitString -> String -> SDoc pprStaticArith s1 s2 int_op float_op op_name = let ty1 = getStatType s1 ================================================ FILE: disabled-packages/ghc/build.sh ================================================ # See https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling # https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Linux # and # https://github.com/neurocyte/ghc-android TERMUX_PKG_HOMEPAGE=https://www.haskell.org/ghc/ TERMUX_PKG_DESCRIPTION="The Glasgow Haskell Compilation system" TERMUX_PKG_VERSION=8.0.1 TERMUX_PKG_SRCURL=http://downloads.haskell.org/~ghc/${TERMUX_PKG_VERSION}/ghc-${TERMUX_PKG_VERSION}-src.tar.xz TERMUX_PKG_BUILD_IN_SRC=true # Depend on clang for now until llvm is split into separate package: TERMUX_PKG_DEPENDS="clang, ncurses" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-iconv-includes=$TERMUX_PREFIX/include -with-iconv-libraries=$TERMUX_PREFIX/lib" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-curses-includes=$TERMUX_PREFIX/include/ncursesw -with-curses-libraries=$TERMUX_PREFIX/lib" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --host=x86_64-unknown-linux --build=x86_64-unknown-linux" termux_step_post_extract_package() { ORIG_CFLAGS="$CFLAGS" ORIG_CPPFLAGS="$CPPFLAGS" ORIG_LDFLAGS="$LDFLAGS" unset AR unset AS unset CC export CFLAGS="" unset CPP export CPPFLAGS="" unset CXXFLAGS unset CXX export LDFLAGS="" unset LD unset PKG_CONFIG unset RANLIB TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --target=${TERMUX_HOST_PLATFORM}" } termux_step_pre_configure() { echo "INTEGER_LIBRARY = integer-simple" > mk/build.mk #echo "GhcStage2HcOpts = $ORIG_CFLAGS $ORIG_CPPFLAGS $ORIG_LDFLAGS" >> mk/build.mk # Avoid "Can't use -fPIC or -dynamic on this platform": echo "DYNAMIC_GHC_PROGRAMS = NO" >> mk/build.mk echo "GhcLibWays = v" >> mk/build.mk # "Can not build haddock docs when CrossCompiling or Stage1Only". echo "HADDOCK_DOCS=NO" >> mk/build.mk } ================================================ FILE: disabled-packages/ghc/compiler-llvmGen-LlvmCodeGen-Ppr.hs.patch ================================================ diff -u -r ../ghc-8.0.1/compiler/llvmGen/LlvmCodeGen/Ppr.hs ./compiler/llvmGen/LlvmCodeGen/Ppr.hs --- ../ghc-8.0.1/compiler/llvmGen/LlvmCodeGen/Ppr.hs 2016-05-16 13:08:53.000000000 -0400 +++ ./compiler/llvmGen/LlvmCodeGen/Ppr.hs 2016-06-23 17:54:27.073877144 -0400 @@ -44,12 +44,18 @@ Platform { platformArch = ArchX86, platformOS = OSLinux } -> text "target datalayout = \"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32\"" $+$ text "target triple = \"i386-pc-linux-gnu\"" + Platform { platformArch = ArchX86, platformOS = OSAndroid } -> + text "target datalayout = \"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32\"" + $+$ text "target triple = \"i386-pc-linux-android\"" Platform { platformArch = ArchX86_64, platformOS = OSDarwin } -> text "target datalayout = \"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64\"" $+$ text "target triple = \"x86_64-apple-darwin10.0.0\"" Platform { platformArch = ArchX86_64, platformOS = OSLinux } -> text "target datalayout = \"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64\"" $+$ text "target triple = \"x86_64-linux-gnu\"" + Platform { platformArch = ArchX86_64, platformOS = OSAndroid } -> + text "target datalayout = \"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64\"" + $+$ text "target triple = \"x86_64-linux-android\"" Platform { platformArch = ArchARM {}, platformOS = OSLinux } -> text "target datalayout = \"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32\"" $+$ text "target triple = \"armv6-unknown-linux-gnueabihf\"" @@ -71,6 +77,9 @@ Platform { platformArch = ArchARM64, platformOS = OSLinux } -> text "target datalayout = \"e-m:e-i64:64-i128:128-n32:64-S128\"" $+$ text "target triple = \"aarch64-unknown-linux-gnu\"" + Platform { platformArch = ArchARM64, platformOS = OSAndroid } -> + text "target datalayout = \"e-m:e-i64:64-i128:128-n32:64-S128\"" + $+$ text "target triple = \"aarch64-unknown-linux-android\"" _ -> if platformIsCrossCompiling platform then panic "LlvmCodeGen.Ppr: Cross compiling without valid target info." ================================================ FILE: disabled-packages/ghc/compiler-main-DriverPipeline.hs.patch ================================================ diff -u -r ../ghc-8.0.1/compiler/main/DriverPipeline.hs ./compiler/main/DriverPipeline.hs --- ../ghc-8.0.1/compiler/main/DriverPipeline.hs 2016-05-16 13:08:53.000000000 -0400 +++ ./compiler/main/DriverPipeline.hs 2016-09-07 03:37:48.321941122 -0400 @@ -1831,10 +1831,7 @@ | WayThreaded `elem` ways dflags = let os = platformOS (targetPlatform dflags) in if os == OSOsf3 then ["-lpthread", "-lexc"] - else if os `elem` [OSMinGW32, OSFreeBSD, OSOpenBSD, - OSNetBSD, OSHaiku, OSQNXNTO, OSiOS, OSDarwin] - then [] - else ["-lpthread"] + else [] | otherwise = [] rc_objs <- maybeCreateManifest dflags output_fn ================================================ FILE: disabled-packages/ghc/configure.patch ================================================ diff -u -r ../ghc-8.0.1/configure ./configure --- ../ghc-8.0.1/configure 2016-05-17 12:36:51.000000000 -0400 +++ ./configure 2016-06-23 16:46:28.690875698 -0400 @@ -7126,7 +7126,7 @@ # tools we are looking for. In the past, GHC supported a number of # versions of LLVM simultaneously, but that stopped working around # 3.5/3.6 release of LLVM. -LlvmVersion=3.7 +LlvmVersion=3.9 sUPPORTED_LLVM_VERSION=$(echo \($LlvmVersion\) | sed 's/\./,/') ================================================ FILE: disabled-packages/groff/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.gnu.org/software/groff/ TERMUX_PKG_DESCRIPTION="GNU troff text-formatting program" TERMUX_PKG_VERSION=1.22.3 TERMUX_PKG_SRCURL=http://ftp.gnu.org/gnu/groff/groff-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-doc=no --without-gs --without-x" ================================================ FILE: disabled-packages/gst-libav/build.sh ================================================ # NOTE: Disabled due to not being ffmpeg 4 compatible. TERMUX_PKG_HOMEPAGE=https://gstreamer.freedesktop.org/ TERMUX_PKG_DESCRIPTION="GStreamer libav/ffmpeg wrapper" TERMUX_PKG_VERSION=1.14.1 TERMUX_PKG_SHA256=eff80a02d2f2fb9f34b67e9a26e9954d3218c7aa18e863f2a47805fa7066029d TERMUX_PKG_SRCURL=https://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_DEPENDS="gst-plugins-base,ffmpeg" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-android_media --disable-examples --disable-tests --with-system-libav " ================================================ FILE: disabled-packages/gst123/build.sh ================================================ # Broken - requires gtk TERMUX_PKG_HOMEPAGE=http://space.twc.de/~stefan/gst123.php TERMUX_PKG_DESCRIPTION="GStreamer based command line media player" TERMUX_PKG_VERSION=0.3.4 TERMUX_PKG_SRCURL=http://space.twc.de/~stefan/gst123/gst123-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_DEPENDS="gst-plugins-bad, ncurses" ================================================ FILE: disabled-packages/guile/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.gnu.org/software/guile/ TERMUX_PKG_DESCRIPTION="GNU extension language and Scheme interpreter" TERMUX_PKG_VERSION=2.0.11 TERMUX_PKG_SRCURL=ftp://ftp.gnu.org/gnu/guile/guile-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="libgmp, libunistring, libffi, libgc" ================================================ FILE: disabled-packages/javac/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://docs.oracle.com/javase/8/docs/technotes/tools/windows/javac.html TERMUX_PKG_DESCRIPTION="Java programming language compiler from (openjdk)" TERMUX_PKG_VERSION=8u45 TERMUX_PKG_PLATFORM_INDEPENDENT=true termux_step_extract_package() { mkdir $TERMUX_PKG_SRCDIR } termux_step_make() { RAW_JAR=/usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar mkdir -p $TERMUX_PREFIX/share/dex $TERMUX_DX \ --dex \ --output=$TERMUX_PREFIX/share/dex/tools.jar \ $RAW_JAR install $TERMUX_PKG_BUILDER_DIR/javac $TERMUX_PREFIX/bin/javac perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/javac } ================================================ FILE: disabled-packages/javac/javac ================================================ #!/system/bin/sh # There needs to be a folder at $ANDROID_DATA/dalvik-cache export ANDROID_DATA=@TERMUX_PREFIX@/var/android/ mkdir -p $ANDROID_DATA/dalvik-cache jarpath=@TERMUX_PREFIX@/share/dex/tools.jar # -proc:none to disable annotation processing/compiling # -7 for java 1.7 compatibility dalvikvm -Xmx256m -cp $jarpath com.sun.tools.javac.Main -proc:none -7 -cp @TERMUX_PREFIX@/share/java/android.jar $@ ================================================ FILE: disabled-packages/libfakechroot/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/dex4er/fakechroot/wiki TERMUX_PKG_DESCRIPTION="Library for creating fake chroots" TERMUX_PKG_VERSION=2.17.2 TERMUX_PKG_SRCURL=https://github.com/dex4er/fakechroot/archive/${TERMUX_PKG_VERSION}.tar.gz ================================================ FILE: disabled-packages/libffi-updated/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://sourceware.org/libffi/ TERMUX_PKG_DESCRIPTION="Library providing a portable, high level programming interface to various calling conventions" local _COMMIT=716bfd83177689e2244c4707bd513003cff92c68 local _DATE=20171105 TERMUX_PKG_VERSION=3.2.1.$_DATE TERMUX_PKG_SHA256=454577ab2d046dbdf5697f71598247fb8d8bf2d378817d5d5b8bc5dceaf822ac TERMUX_PKG_SRCURL=https://github.com/libffi/libffi/archive/${_COMMIT}.zip TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-multi-os-directory --enable-symvers=no" TERMUX_PKG_RM_AFTER_INSTALL="lib/libffi-${TERMUX_PKG_VERSION}/include" termux_step_pre_configure() { cd $TERMUX_PKG_SRCDIR ./autogen.sh } ================================================ FILE: disabled-packages/libjemalloc/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.canonware.com/jemalloc/ TERMUX_PKG_DESCRIPTION="General-purpose scalable concurrent malloc(3) implementation" TERMUX_PKG_VERSION=4.0.0 TERMUX_PKG_SRCURL=https://github.com/jemalloc/jemalloc/releases/download/${TERMUX_PKG_VERSION}/jemalloc-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_BUILD_IN_SRC=true CPPFLAGS+=" -D__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4=1" ================================================ FILE: disabled-packages/libressl/build.sh ================================================ # Status: Termux currently uses openssl. Transitioning to libressl # is tempting, but on hold for now to see how widespread # the adoption of libressl in Linux distributions is. TERMUX_PKG_HOMEPAGE=http://www.libressl.org/ TERMUX_PKG_DESCRIPTION="Library implementing the TLS protocol as well as general purpose cryptography functions" TERMUX_PKG_DEPENDS="ca-certificates" TERMUX_PKG_VERSION=2.5.5 TERMUX_PKG_SHA256=e57f5e3d5842a81fe9351b6e817fcaf0a749ca4ef35a91465edba9e071dce7c4 TERMUX_PKG_SRCURL=http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-openssldir=$TERMUX_PREFIX/etc/tls" TERMUX_PKG_CONFLICTS="openssl" # etc/tls/cert.pem is provided by ca-certificates: TERMUX_PKG_RM_AFTER_INSTALL="etc/tls/cert.pem" termux_step_pre_configure() { CPPFLAGS+=" -DNO_SYSLOG" } ================================================ FILE: disabled-packages/lrzsz/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://ohse.de/uwe/software/lrzsz.html TERMUX_PKG_DESCRIPTION="Tools for zmodem/xmodem/ymodem file transfer" TERMUX_PKG_VERSION=0.12.20 TERMUX_PKG_SRCURL=https://ohse.de/uwe/releases/lrzsz-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=c28b36b14bddb014d9e9c97c52459852f97bd405f89113f30bee45ed92728ff1 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-syslog --mandir=$TERMUX_PREFIX/share/man" ================================================ FILE: disabled-packages/lrzsz/src-Makefile.in.patch ================================================ Hard links are not supported on Android 6.0+ diff -u -r ../lrzsz-0.12.20/src/Makefile.in ./src/Makefile.in --- ../lrzsz-0.12.20/src/Makefile.in 1998-12-30 17:31:46.000000000 +0100 +++ ./src/Makefile.in 2017-01-25 01:17:46.135033894 +0100 @@ -370,16 +370,16 @@ install-exec-local: rm -f $(DESTDIR)/$(bindir)/`echo lsb | sed -e '$(transform)'` - ln $(DESTDIR)/$(bindir)/`echo lsz |sed -e '$(transform)'` \ + ln -s $(DESTDIR)/$(bindir)/`echo lsz |sed -e '$(transform)'` \ $(DESTDIR)/$(bindir)/`echo lsb |sed -e '$(transform)'` rm -f $(bindir)/`echo lsx | sed -e '$(transform)'` - ln $(DESTDIR)/$(bindir)/`echo lsz |sed -e '$(transform)'` \ + ln -s $(DESTDIR)/$(bindir)/`echo lsz |sed -e '$(transform)'` \ $(DESTDIR)/$(bindir)/`echo lsx |sed -e '$(transform)'` rm -f $(bindir)/`echo lrb | sed -e '$(transform)'` - ln $(DESTDIR)/$(bindir)/`echo lrz |sed -e '$(transform)'` \ + ln -s $(DESTDIR)/$(bindir)/`echo lrz |sed -e '$(transform)'` \ $(DESTDIR)/$(bindir)/`echo lrb |sed -e '$(transform)'` rm -f $(bindir)/`echo lrx | sed -e '$(transform)'` - ln $(DESTDIR)/$(bindir)/`echo lrz |sed -e '$(transform)'` \ + ln -s $(DESTDIR)/$(bindir)/`echo lrz |sed -e '$(transform)'` \ $(DESTDIR)/$(bindir)/`echo lrx |sed -e '$(transform)'` # rm -f $(bindir)/`echo lrzszbug | sed -e '$(transform)'` # ln $(bindir)/`echo lrzszbug |sed -e '$(transform)'` \ ================================================ FILE: disabled-packages/man-db/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.nongnu.org/man-db/ TERMUX_PKG_DESCRIPTION="Utilities for examining on-line help files (manual pages)" TERMUX_PKG_VERSION=2.7.5 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=http://mirror.csclub.uwaterloo.ca/nongnu/man-db/man-db-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-db=gdbm --with-pager=less --with-config-file=/data/data/com.termux/files/usr/etc/man_db.conf --disable-setuid --with-browser=lynx --with-gzip=gzip --with-systemdtmpfilesdir=/data/data/com.termux/files/usr/lib/tmpfiles.d" TERMUX_PKG_DEPENDS="flex, gdbm, groff, less, libandroid-support, libpipeline, lynx" export GROFF_TMAC_PATH="/data/data/com.termux/files/usr/lib/groff/site-tmac:/data/data/com.termux/files/usr/share/groff/site-tmac:/data/data/com.termux/files/usr/share/groff/current/tmac" ================================================ FILE: disabled-packages/mono/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.mono-project.com/ TERMUX_PKG_MAINTAINER='Vishal Biswas @vishalbiswas' _MONO_VERSION=5.0.0 _MONO_PATCH=100 TERMUX_PKG_VERSION=$_MONO_VERSION.$_MONO_PATCH # official package is missing support/libm/math_private.h #TERMUX_PKG_SRCURL=https://github.com/mono/mono/archive/mono-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SRCURL=https://download.mono-project.com/sources/mono/mono-$TERMUX_PKG_VERSION.tar.bz2 TERMUX_PKG_SHA256=368da3ff9f42592920cd8cf6fa15c6c16558e967144c4d3df873352e5d2bb6df TERMUX_PKG_FOLDERNAME=mono-$_MONO_VERSION #TERMUX_PKG_EXTRA_CONFIGURE_ARGS='--disable-mcs-build --disable-boehm --with-sigaltstack=no' TERMUX_PKG_EXTRA_CONFIGURE_ARGS+="--disable-btls --disable-dynamic-btls" #--with-btls-android-ndk=$ANDROID_NDK" TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { # export CFLAGS="$CFLAGS -mthumb" cd "$TERMUX_PKG_SRCDIR" # NOCONFIGURE=1 ./autogen.sh # cp $TERMUX_PKG_BUILDER_DIR/{complex,math_private}.h $TERMUX_PKG_SRCDIR/support/libm/ export ANDROID_STANDALONE_TOOLCHAIN=$TERMUX_STANDALONE_TOOLCHAIN } ================================================ FILE: disabled-packages/mono/complex.h ================================================ /*- * Copyright (c) 2001-2011 The FreeBSD Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef _COMPLEX_H #define _COMPLEX_H #include #ifdef __GNUC__ #if __STDC_VERSION__ < 199901 #define _Complex __complex__ #endif #define _Complex_I ((float _Complex)1.0i) #endif #ifdef __generic _Static_assert(__generic(_Complex_I, float _Complex, 1, 0), "_Complex_I must be of type float _Complex"); #endif #define complex _Complex #define I _Complex_I #if __ISO_C_VISIBLE >= 2011 #ifdef __clang__ #define CMPLX(x, y) ((double complex){ x, y }) #define CMPLXF(x, y) ((float complex){ x, y }) #define CMPLXL(x, y) ((long double complex){ x, y }) #elif __GNUC_PREREQ__(4, 7) #define CMPLX(x, y) __builtin_complex((double)(x), (double)(y)) #define CMPLXF(x, y) __builtin_complex((float)(x), (float)(y)) #define CMPLXL(x, y) __builtin_complex((long double)(x), (long double)(y)) #endif #endif /* __ISO_C_VISIBLE >= 2011 */ __BEGIN_DECLS #pragma GCC visibility push(default) double cabs(double complex); float cabsf(float complex); long double cabsl(long double complex); double complex cacos(double complex); float complex cacosf(float complex); double complex cacosh(double complex); float complex cacoshf(float complex); double carg(double complex); float cargf(float complex); long double cargl(long double complex); double complex casin(double complex); float complex casinf(float complex); double complex casinh(double complex); float complex casinhf(float complex); double complex catan(double complex); float complex catanf(float complex); double complex catanh(double complex); float complex catanhf(float complex); double complex ccos(double complex); float complex ccosf(float complex); double complex ccosh(double complex); float complex ccoshf(float complex); double complex cexp(double complex); float complex cexpf(float complex); double cimag(double complex) __pure2; float cimagf(float complex) __pure2; long double cimagl(long double complex) __pure2; double complex conj(double complex) __pure2; float complex conjf(float complex) __pure2; long double complex conjl(long double complex) __pure2; float complex cprojf(float complex) __pure2; double complex cproj(double complex) __pure2; long double complex cprojl(long double complex) __pure2; double creal(double complex) __pure2; float crealf(float complex) __pure2; long double creall(long double complex) __pure2; double complex csin(double complex); float complex csinf(float complex); double complex csinh(double complex); float complex csinhf(float complex); double complex csqrt(double complex); float complex csqrtf(float complex); long double complex csqrtl(long double complex); double complex ctan(double complex); float complex ctanf(float complex); double complex ctanh(double complex); float complex ctanhf(float complex); #pragma GCC visibility pop __END_DECLS #endif /* _COMPLEX_H */ ================================================ FILE: disabled-packages/mono/math_private.h ================================================ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this * software is freely granted, provided that this notice * is preserved. * ==================================================== */ /* * from: @(#)fdlibm.h 5.1 93/09/24 * $FreeBSD$ */ #ifndef _MATH_PRIVATE_H_ #define _MATH_PRIVATE_H_ #include #include /* * The original fdlibm code used statements like: * n0 = ((*(int*)&one)>>29)^1; * index of high word * * ix0 = *(n0+(int*)&x); * high word of x * * ix1 = *((1-n0)+(int*)&x); * low word of x * * to dig two 32 bit words out of the 64 bit IEEE floating point * value. That is non-ANSI, and, moreover, the gcc instruction * scheduler gets it wrong. We instead use the following macros. * Unlike the original code, we determine the endianness at compile * time, not at run time; I don't see much benefit to selecting * endianness at run time. */ /* * A union which permits us to convert between a double and two 32 bit * ints. */ #ifdef __arm__ #if defined(__VFP_FP__) || defined(__ARM_EABI__) #define IEEE_WORD_ORDER BYTE_ORDER #else #define IEEE_WORD_ORDER BIG_ENDIAN #endif #else /* __arm__ */ #define IEEE_WORD_ORDER BYTE_ORDER #endif #if IEEE_WORD_ORDER == BIG_ENDIAN typedef union { double value; struct { u_int32_t msw; u_int32_t lsw; } parts; struct { u_int64_t w; } xparts; } ieee_double_shape_type; #endif #if IEEE_WORD_ORDER == LITTLE_ENDIAN typedef union { double value; struct { u_int32_t lsw; u_int32_t msw; } parts; struct { u_int64_t w; } xparts; } ieee_double_shape_type; #endif /* Get two 32 bit ints from a double. */ #define EXTRACT_WORDS(ix0,ix1,d) \ do { \ ieee_double_shape_type ew_u; \ ew_u.value = (d); \ (ix0) = ew_u.parts.msw; \ (ix1) = ew_u.parts.lsw; \ } while (0) /* Get a 64-bit int from a double. */ #define EXTRACT_WORD64(ix,d) \ do { \ ieee_double_shape_type ew_u; \ ew_u.value = (d); \ (ix) = ew_u.xparts.w; \ } while (0) /* Get the more significant 32 bit int from a double. */ #define GET_HIGH_WORD(i,d) \ do { \ ieee_double_shape_type gh_u; \ gh_u.value = (d); \ (i) = gh_u.parts.msw; \ } while (0) /* Get the less significant 32 bit int from a double. */ #define GET_LOW_WORD(i,d) \ do { \ ieee_double_shape_type gl_u; \ gl_u.value = (d); \ (i) = gl_u.parts.lsw; \ } while (0) /* Set a double from two 32 bit ints. */ #define INSERT_WORDS(d,ix0,ix1) \ do { \ ieee_double_shape_type iw_u; \ iw_u.parts.msw = (ix0); \ iw_u.parts.lsw = (ix1); \ (d) = iw_u.value; \ } while (0) /* Set a double from a 64-bit int. */ #define INSERT_WORD64(d,ix) \ do { \ ieee_double_shape_type iw_u; \ iw_u.xparts.w = (ix); \ (d) = iw_u.value; \ } while (0) /* Set the more significant 32 bits of a double from an int. */ #define SET_HIGH_WORD(d,v) \ do { \ ieee_double_shape_type sh_u; \ sh_u.value = (d); \ sh_u.parts.msw = (v); \ (d) = sh_u.value; \ } while (0) /* Set the less significant 32 bits of a double from an int. */ #define SET_LOW_WORD(d,v) \ do { \ ieee_double_shape_type sl_u; \ sl_u.value = (d); \ sl_u.parts.lsw = (v); \ (d) = sl_u.value; \ } while (0) /* * A union which permits us to convert between a float and a 32 bit * int. */ typedef union { float value; /* FIXME: Assumes 32 bit int. */ unsigned int word; } ieee_float_shape_type; /* Get a 32 bit int from a float. */ #define GET_FLOAT_WORD(i,d) \ do { \ ieee_float_shape_type gf_u; \ gf_u.value = (d); \ (i) = gf_u.word; \ } while (0) /* Set a float from a 32 bit int. */ #define SET_FLOAT_WORD(d,i) \ do { \ ieee_float_shape_type sf_u; \ sf_u.word = (i); \ (d) = sf_u.value; \ } while (0) /* * Get expsign and mantissa as 16 bit and 64 bit ints from an 80 bit long * double. */ #define EXTRACT_LDBL80_WORDS(ix0,ix1,d) \ do { \ union IEEEl2bits ew_u; \ ew_u.e = (d); \ (ix0) = ew_u.xbits.expsign; \ (ix1) = ew_u.xbits.man; \ } while (0) /* * Get expsign and mantissa as one 16 bit and two 64 bit ints from a 128 bit * long double. */ #define EXTRACT_LDBL128_WORDS(ix0,ix1,ix2,d) \ do { \ union IEEEl2bits ew_u; \ ew_u.e = (d); \ (ix0) = ew_u.xbits.expsign; \ (ix1) = ew_u.xbits.manh; \ (ix2) = ew_u.xbits.manl; \ } while (0) /* Get expsign as a 16 bit int from a long double. */ #define GET_LDBL_EXPSIGN(i,d) \ do { \ union IEEEl2bits ge_u; \ ge_u.e = (d); \ (i) = ge_u.xbits.expsign; \ } while (0) /* * Set an 80 bit long double from a 16 bit int expsign and a 64 bit int * mantissa. */ #define INSERT_LDBL80_WORDS(d,ix0,ix1) \ do { \ union IEEEl2bits iw_u; \ iw_u.xbits.expsign = (ix0); \ iw_u.xbits.man = (ix1); \ (d) = iw_u.e; \ } while (0) /* * Set a 128 bit long double from a 16 bit int expsign and two 64 bit ints * comprising the mantissa. */ #define INSERT_LDBL128_WORDS(d,ix0,ix1,ix2) \ do { \ union IEEEl2bits iw_u; \ iw_u.xbits.expsign = (ix0); \ iw_u.xbits.manh = (ix1); \ iw_u.xbits.manl = (ix2); \ (d) = iw_u.e; \ } while (0) /* Set expsign of a long double from a 16 bit int. */ #define SET_LDBL_EXPSIGN(d,v) \ do { \ union IEEEl2bits se_u; \ se_u.e = (d); \ se_u.xbits.expsign = (v); \ (d) = se_u.e; \ } while (0) #ifdef __i386__ /* Long double constants are broken on i386. */ #define LD80C(m, ex, v) { \ .xbits.man = __CONCAT(m, ULL), \ .xbits.expsign = (0x3fff + (ex)) | ((v) < 0 ? 0x8000 : 0), \ } #else /* The above works on non-i386 too, but we use this to check v. */ #define LD80C(m, ex, v) { .e = (v), } #endif #ifdef FLT_EVAL_METHOD /* * Attempt to get strict C99 semantics for assignment with non-C99 compilers. */ #if FLT_EVAL_METHOD == 0 || __GNUC__ == 0 #define STRICT_ASSIGN(type, lval, rval) ((lval) = (rval)) #else #define STRICT_ASSIGN(type, lval, rval) do { \ volatile type __lval; \ \ if (sizeof(type) >= sizeof(long double)) \ (lval) = (rval); \ else { \ __lval = (rval); \ (lval) = __lval; \ } \ } while (0) #endif #endif /* FLT_EVAL_METHOD */ /* Support switching the mode to FP_PE if necessary. */ #if defined(__i386__) && !defined(NO_FPSETPREC) #define ENTERI() \ long double __retval; \ fp_prec_t __oprec; \ \ if ((__oprec = fpgetprec()) != FP_PE) \ fpsetprec(FP_PE) #define RETURNI(x) do { \ __retval = (x); \ if (__oprec != FP_PE) \ fpsetprec(__oprec); \ RETURNF(__retval); \ } while (0) #else #define ENTERI(x) #define RETURNI(x) RETURNF(x) #endif /* Default return statement if hack*_t() is not used. */ #define RETURNF(v) return (v) /* * 2sum gives the same result as 2sumF without requiring |a| >= |b| or * a == 0, but is slower. */ #define _2sum(a, b) do { \ __typeof(a) __s, __w; \ \ __w = (a) + (b); \ __s = __w - (a); \ (b) = ((a) - (__w - __s)) + ((b) - __s); \ (a) = __w; \ } while (0) /* * 2sumF algorithm. * * "Normalize" the terms in the infinite-precision expression a + b for * the sum of 2 floating point values so that b is as small as possible * relative to 'a'. (The resulting 'a' is the value of the expression in * the same precision as 'a' and the resulting b is the rounding error.) * |a| must be >= |b| or 0, b's type must be no larger than 'a's type, and * exponent overflow or underflow must not occur. This uses a Theorem of * Dekker (1971). See Knuth (1981) 4.2.2 Theorem C. The name "TwoSum" * is apparently due to Skewchuk (1997). * * For this to always work, assignment of a + b to 'a' must not retain any * extra precision in a + b. This is required by C standards but broken * in many compilers. The brokenness cannot be worked around using * STRICT_ASSIGN() like we do elsewhere, since the efficiency of this * algorithm would be destroyed by non-null strict assignments. (The * compilers are correct to be broken -- the efficiency of all floating * point code calculations would be destroyed similarly if they forced the * conversions.) * * Fortunately, a case that works well can usually be arranged by building * any extra precision into the type of 'a' -- 'a' should have type float_t, * double_t or long double. b's type should be no larger than 'a's type. * Callers should use these types with scopes as large as possible, to * reduce their own extra-precision and efficiciency problems. In * particular, they shouldn't convert back and forth just to call here. */ #ifdef DEBUG #define _2sumF(a, b) do { \ __typeof(a) __w; \ volatile __typeof(a) __ia, __ib, __r, __vw; \ \ __ia = (a); \ __ib = (b); \ assert(__ia == 0 || fabsl(__ia) >= fabsl(__ib)); \ \ __w = (a) + (b); \ (b) = ((a) - __w) + (b); \ (a) = __w; \ \ /* The next 2 assertions are weak if (a) is already long double. */ \ assert((long double)__ia + __ib == (long double)(a) + (b)); \ __vw = __ia + __ib; \ __r = __ia - __vw; \ __r += __ib; \ assert(__vw == (a) && __r == (b)); \ } while (0) #else /* !DEBUG */ #define _2sumF(a, b) do { \ __typeof(a) __w; \ \ __w = (a) + (b); \ (b) = ((a) - __w) + (b); \ (a) = __w; \ } while (0) #endif /* DEBUG */ /* * Set x += c, where x is represented in extra precision as a + b. * x must be sufficiently normalized and sufficiently larger than c, * and the result is then sufficiently normalized. * * The details of ordering are that |a| must be >= |c| (so that (a, c) * can be normalized without extra work to swap 'a' with c). The details of * the normalization are that b must be small relative to the normalized 'a'. * Normalization of (a, c) makes the normalized c tiny relative to the * normalized a, so b remains small relative to 'a' in the result. However, * b need not ever be tiny relative to 'a'. For example, b might be about * 2**20 times smaller than 'a' to give about 20 extra bits of precision. * That is usually enough, and adding c (which by normalization is about * 2**53 times smaller than a) cannot change b significantly. However, * cancellation of 'a' with c in normalization of (a, c) may reduce 'a' * significantly relative to b. The caller must ensure that significant * cancellation doesn't occur, either by having c of the same sign as 'a', * or by having |c| a few percent smaller than |a|. Pre-normalization of * (a, b) may help. * * This is is a variant of an algorithm of Kahan (see Knuth (1981) 4.2.2 * exercise 19). We gain considerable efficiency by requiring the terms to * be sufficiently normalized and sufficiently increasing. */ #define _3sumF(a, b, c) do { \ __typeof(a) __tmp; \ \ __tmp = (c); \ _2sumF(__tmp, (a)); \ (b) += (a); \ (a) = __tmp; \ } while (0) /* * Common routine to process the arguments to nan(), nanf(), and nanl(). */ void _scan_nan(uint32_t *__words, int __num_words, const char *__s); #ifdef _COMPLEX_H /* * C99 specifies that complex numbers have the same representation as * an array of two elements, where the first element is the real part * and the second element is the imaginary part. */ typedef union { float complex f; float a[2]; } float_complex; typedef union { double complex f; double a[2]; } double_complex; typedef union { long double complex f; long double a[2]; } long_double_complex; #define REALPART(z) ((z).a[0]) #define IMAGPART(z) ((z).a[1]) /* * Inline functions that can be used to construct complex values. * * The C99 standard intends x+I*y to be used for this, but x+I*y is * currently unusable in general since gcc introduces many overflow, * underflow, sign and efficiency bugs by rewriting I*y as * (0.0+I)*(y+0.0*I) and laboriously computing the full complex product. * In particular, I*Inf is corrupted to NaN+I*Inf, and I*-0 is corrupted * to -0.0+I*0.0. */ static __inline float complex cpackf(float x, float y) { float_complex z; REALPART(z) = x; IMAGPART(z) = y; return (z.f); } static __inline double complex cpack(double x, double y) { double_complex z; REALPART(z) = x; IMAGPART(z) = y; return (z.f); } static __inline long double complex cpackl(long double x, long double y) { long_double_complex z; REALPART(z) = x; IMAGPART(z) = y; return (z.f); } #endif /* _COMPLEX_H */ #ifdef __GNUCLIKE_ASM /* Asm versions of some functions. */ #ifdef __amd64__ static __inline int irint(double x) { int n; asm("cvtsd2si %1,%0" : "=r" (n) : "x" (x)); return (n); } #define HAVE_EFFICIENT_IRINT #endif #ifdef __i386__ static __inline int irint(double x) { int n; asm("fistl %0" : "=m" (n) : "t" (x)); return (n); } #define HAVE_EFFICIENT_IRINT #endif #if defined(__amd64__) || defined(__i386__) static __inline int irintl(long double x) { int n; asm("fistl %0" : "=m" (n) : "t" (x)); return (n); } #define HAVE_EFFICIENT_IRINTL #endif #endif /* __GNUCLIKE_ASM */ #ifdef DEBUG #if defined(__amd64__) || defined(__i386__) #define breakpoint() asm("int $3") #else #include #define breakpoint() raise(SIGTRAP) #endif #endif /* Write a pari script to test things externally. */ #ifdef DOPRINT #include #ifndef DOPRINT_SWIZZLE #define DOPRINT_SWIZZLE 0 #endif #ifdef DOPRINT_LD80 #define DOPRINT_START(xp) do { \ uint64_t __lx; \ uint16_t __hx; \ \ /* Hack to give more-problematic args. */ \ EXTRACT_LDBL80_WORDS(__hx, __lx, *xp); \ __lx ^= DOPRINT_SWIZZLE; \ INSERT_LDBL80_WORDS(*xp, __hx, __lx); \ printf("x = %.21Lg; ", (long double)*xp); \ } while (0) #define DOPRINT_END1(v) \ printf("y = %.21Lg; z = 0; show(x, y, z);\n", (long double)(v)) #define DOPRINT_END2(hi, lo) \ printf("y = %.21Lg; z = %.21Lg; show(x, y, z);\n", \ (long double)(hi), (long double)(lo)) #elif defined(DOPRINT_D64) #define DOPRINT_START(xp) do { \ uint32_t __hx, __lx; \ \ EXTRACT_WORDS(__hx, __lx, *xp); \ __lx ^= DOPRINT_SWIZZLE; \ INSERT_WORDS(*xp, __hx, __lx); \ printf("x = %.21Lg; ", (long double)*xp); \ } while (0) #define DOPRINT_END1(v) \ printf("y = %.21Lg; z = 0; show(x, y, z);\n", (long double)(v)) #define DOPRINT_END2(hi, lo) \ printf("y = %.21Lg; z = %.21Lg; show(x, y, z);\n", \ (long double)(hi), (long double)(lo)) #elif defined(DOPRINT_F32) #define DOPRINT_START(xp) do { \ uint32_t __hx; \ \ GET_FLOAT_WORD(__hx, *xp); \ __hx ^= DOPRINT_SWIZZLE; \ SET_FLOAT_WORD(*xp, __hx); \ printf("x = %.21Lg; ", (long double)*xp); \ } while (0) #define DOPRINT_END1(v) \ printf("y = %.21Lg; z = 0; show(x, y, z);\n", (long double)(v)) #define DOPRINT_END2(hi, lo) \ printf("y = %.21Lg; z = %.21Lg; show(x, y, z);\n", \ (long double)(hi), (long double)(lo)) #else /* !DOPRINT_LD80 && !DOPRINT_D64 (LD128 only) */ #ifndef DOPRINT_SWIZZLE_HIGH #define DOPRINT_SWIZZLE_HIGH 0 #endif #define DOPRINT_START(xp) do { \ uint64_t __lx, __llx; \ uint16_t __hx; \ \ EXTRACT_LDBL128_WORDS(__hx, __lx, __llx, *xp); \ __llx ^= DOPRINT_SWIZZLE; \ __lx ^= DOPRINT_SWIZZLE_HIGH; \ INSERT_LDBL128_WORDS(*xp, __hx, __lx, __llx); \ printf("x = %.36Lg; ", (long double)*xp); \ } while (0) #define DOPRINT_END1(v) \ printf("y = %.36Lg; z = 0; show(x, y, z);\n", (long double)(v)) #define DOPRINT_END2(hi, lo) \ printf("y = %.36Lg; z = %.36Lg; show(x, y, z);\n", \ (long double)(hi), (long double)(lo)) #endif /* DOPRINT_LD80 */ #else /* !DOPRINT */ #define DOPRINT_START(xp) #define DOPRINT_END1(v) #define DOPRINT_END2(hi, lo) #endif /* DOPRINT */ #define RETURNP(x) do { \ DOPRINT_END1(x); \ RETURNF(x); \ } while (0) #define RETURNPI(x) do { \ DOPRINT_END1(x); \ RETURNI(x); \ } while (0) #define RETURN2P(x, y) do { \ DOPRINT_END2((x), (y)); \ RETURNF((x) + (y)); \ } while (0) #define RETURN2PI(x, y) do { \ DOPRINT_END2((x), (y)); \ RETURNI((x) + (y)); \ } while (0) #ifdef STRUCT_RETURN #define RETURNSP(rp) do { \ if (!(rp)->lo_set) \ RETURNP((rp)->hi); \ RETURN2P((rp)->hi, (rp)->lo); \ } while (0) #define RETURNSPI(rp) do { \ if (!(rp)->lo_set) \ RETURNPI((rp)->hi); \ RETURN2PI((rp)->hi, (rp)->lo); \ } while (0) #endif #define SUM2P(x, y) ({ \ const __typeof (x) __x = (x); \ const __typeof (y) __y = (y); \ \ DOPRINT_END2(__x, __y); \ __x + __y; \ }) /* * ieee style elementary functions * * We rename functions here to improve other sources' diffability * against fdlibm. */ #define __ieee754_sqrt sqrt #define __ieee754_acos acos #define __ieee754_acosh acosh #define __ieee754_log log #define __ieee754_log2 log2 #define __ieee754_atanh atanh #define __ieee754_asin asin #define __ieee754_atan2 atan2 #define __ieee754_exp exp #define __ieee754_cosh cosh #define __ieee754_fmod fmod #define __ieee754_pow pow #define __ieee754_lgamma lgamma #define __ieee754_gamma gamma #define __ieee754_lgamma_r lgamma_r #define __ieee754_gamma_r gamma_r #define __ieee754_log10 log10 #define __ieee754_sinh sinh #define __ieee754_hypot hypot #define __ieee754_j0 j0 #define __ieee754_j1 j1 #define __ieee754_y0 y0 #define __ieee754_y1 y1 #define __ieee754_jn jn #define __ieee754_yn yn #define __ieee754_remainder remainder #define __ieee754_scalb scalb #define __ieee754_sqrtf sqrtf #define __ieee754_acosf acosf #define __ieee754_acoshf acoshf #define __ieee754_logf logf #define __ieee754_atanhf atanhf #define __ieee754_asinf asinf #define __ieee754_atan2f atan2f #define __ieee754_expf expf #define __ieee754_coshf coshf #define __ieee754_fmodf fmodf #define __ieee754_powf powf #define __ieee754_lgammaf lgammaf #define __ieee754_gammaf gammaf #define __ieee754_lgammaf_r lgammaf_r #define __ieee754_gammaf_r gammaf_r #define __ieee754_log10f log10f #define __ieee754_log2f log2f #define __ieee754_sinhf sinhf #define __ieee754_hypotf hypotf #define __ieee754_j0f j0f #define __ieee754_j1f j1f #define __ieee754_y0f y0f #define __ieee754_y1f y1f #define __ieee754_jnf jnf #define __ieee754_ynf ynf #define __ieee754_remainderf remainderf #define __ieee754_scalbf scalbf /* fdlibm kernel function */ int __kernel_rem_pio2(double*,double*,int,int,int); /* double precision kernel functions */ #ifndef INLINE_REM_PIO2 int __ieee754_rem_pio2(double,double*); #endif double __kernel_sin(double,double,int); double __kernel_cos(double,double); double __kernel_tan(double,double,int); double __ldexp_exp(double,int); #ifdef _COMPLEX_H double complex __ldexp_cexp(double complex,int); #endif /* float precision kernel functions */ #ifndef INLINE_REM_PIO2F int __ieee754_rem_pio2f(float,double*); #endif #ifndef INLINE_KERNEL_SINDF float __kernel_sindf(double); #endif #ifndef INLINE_KERNEL_COSDF float __kernel_cosdf(double); #endif #ifndef INLINE_KERNEL_TANDF float __kernel_tandf(double,int); #endif float __ldexp_expf(float,int); #ifdef _COMPLEX_H float complex __ldexp_cexpf(float complex,int); #endif /* long double precision kernel functions */ long double __kernel_sinl(long double, long double, int); long double __kernel_cosl(long double, long double); long double __kernel_tanl(long double, long double, int); #endif /* !_MATH_PRIVATE_H_ */ ================================================ FILE: disabled-packages/mono/tkill.patch ================================================ --- ./libgc/pthread_stop_world.c 2017-01-03 15:49:34.000000000 +0530 +++ ../pthread_stop_world.c 2017-01-05 18:54:28.314868754 +0530 @@ -379,11 +379,7 @@ GC_printf1("Sending suspend signal to 0x%lx\n", p -> id); #endif -#ifndef PLATFORM_ANDROID result = pthread_kill(p -> id, SIG_SUSPEND); -#else - result = android_thread_kill(p -> kernel_id, SIG_SUSPEND); -#endif switch(result) { case ESRCH: /* Not really there anymore. Possible? */ --- ./mono/utils/mono-threads-posix.c 2017-01-03 15:49:38.000000000 +0530 +++ ../mono-threads-posix.c 2017-01-05 18:57:48.313245586 +0530 @@ -21,10 +21,6 @@ #include -#if defined(PLATFORM_ANDROID) && !defined(TARGET_ARM64) && !defined(TARGET_AMD64) -#define USE_TKILL_ON_ANDROID 1 -#endif - #ifdef USE_TKILL_ON_ANDROID extern int tkill (pid_t tid, int signal); #endif ================================================ FILE: disabled-packages/ocaml/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://ocaml.org TERMUX_PKG_DESCRIPTION="Programming language supporting functional, imperative and object-oriented styles" TERMUX_PKG_VERSION=4.02.3 TERMUX_PKG_SRCURL=http://caml.inria.fr/pub/distrib/ocaml-4.02/ocaml-4.02.3.tar.xz TERMUX_PKG_DEPENDS="pcre, openssl, libuuid" TERMUX_PKG_BUILD_IN_SRC=true termux_step_configure() { ./configure -prefix $TERMUX_PREFIX -mandir $TERMUX_PREFIX/share/man/man1 -cc "$CC $CFLAGS $CPPFLAGS $LDFLAGS" \ -host $TERMUX_HOST_PLATFORM } ================================================ FILE: disabled-packages/openjdk-9-jre-headless/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://openjdk.java.net TERMUX_PKG_DESCRIPTION="OpenJDK 9 Java Runtime Environment (prerelease)" _jbuild=181 _hg_tag="jdk-9+${_jbuild}" _jvm_dir="lib/jvm/openjdk-9" TERMUX_PKG_VERSION="9.2017.8.20" TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas" TERMUX_PKG_HOMEPAGE=http://openjdk.java.net/projects/jdk9 TERMUX_PKG_DEPENDS="freetype, libpng, ca-certificates-java" TERMUX_PKG_CONFFILES="$_jvm_dir/lib/jvm.cfg" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-aot --disable-hotspot-gtest --disable-option-checking --disable-warnings-as-errors --enable-headless-only --with-freetype=$TERMUX_PREFIX --with-libpng=system --with-zlib=system --with-jdk-variant=normal --with-jvm-variants=server " TERMUX_PKG_RM_AFTER_INSTALL="$_jvm_dir/demo $_jvm_dir/sample" _cups_ver=2.2.4 changesets=('e5455438db96' '5666eba44ac6' '8076a7391ba0' '17bb8a98d5e3' 'a1d64f45f9d5' '364631d8ff2e' '65bfdabaab9c' '17cc754c8936') sha256sums=('c759faa5bff4b3d7bcf87dce57e9d1a39600ef67ec68f96d6d12d07b1bf773ce' '34518bf8b27aa893f834f8f81293ac0e04a210ee4f2e11bb2c89331f87912d96' '3b649e34e2a1c8758c6311931d201a38432088ccb86a720afb1cb99fe193537f' 'bb330b8b516178304dc11c755994db20eccc696ae5c2a16b04a4a67b20b33b79' 'a213ebc4bf896c55855761891932a19f42ad5276d3fd155cfb604b27f4866d9d' '0bc1953e9f23d59dafc415a7a37ff2da23cf8782e0532e253a6d7d63aa0ea954' '739a5d275db4a2a81cf3c3ca17a78212b8c47092e5c10888b79e9599dd9dcc2d' 'fbc9b49a7f0fa1723e369d91068d51a11de40e931f281a3ed9650484b437cc7f' '596d4db72651c335469ae5f37b0da72ac9f97d73e30838d787065f559dea98cc') reponames=(dev corba hotspot jdk jaxws jaxp langtools nashorn cups) _url_src=http://hg.openjdk.java.net/mobile/dev TERMUX_PKG_SRCURL=$_url_src/archive/${changesets[0]}.tar.bz2 TERMUX_PKG_SHA256=${sha256sums[0]} termux_step_post_extract_package() { cd "$TERMUX_PKG_TMPDIR" # download and extract repo archives for index in {1..7}; do local sum=${sha256sums[index]} local repo=${reponames[index]} local change=${changesets[index]} local file=$TERMUX_PKG_CACHEDIR/$repo-$change.tar.bz2 local url=${_url_src}/$repo/archive/$change.tar.bz2 termux_download $url $file $sum tar xf $file -C $TERMUX_PKG_SRCDIR mv $TERMUX_PKG_SRCDIR/$repo-$change $TERMUX_PKG_SRCDIR/$repo done # setup cups source dir file=$TERMUX_PKG_CACHEDIR/cups-$_cups_ver-source.tar.gz url="https://github.com/apple/cups/releases/download/v$_cups_ver/$(basename $file)" termux_download $url $file ${sha256sums[8]} tar xf $file -C $TERMUX_PKG_SRCDIR } # override this step to since openjdk provides its own customized guess scripts termux_step_replace_guess_scripts() { return } termux_step_pre_configure() { TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-cups-include=$TERMUX_PKG_SRCDIR/cups-$_cups_ver" ln -sf $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/libc.so $TERMUX_PKG_TMPDIR/libpthread.so cat > "$TERMUX_STANDALONE_TOOLCHAIN/devkit.info" < $TERMUX_PREFIX/bin/$binary echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$JAVA_HOME/lib:\$JAVA_HOME/lib/jli" >> $TERMUX_PREFIX/bin/$binary echo "exec \$JAVA_HOME/bin/$binary \"\$@\"" >> $TERMUX_PREFIX/bin/$binary chmod u+x $TERMUX_PREFIX/bin/$binary done # use cacerts provided by ca-certificates-java ln -sf "$TERMUX_PREFIX/$_jvm_dir/lib/security/jssecacerts" "$TERMUX_PREFIX/$_jvm_dir/lib/security/cacerts" } ================================================ FILE: disabled-packages/openjdk-9-jre-headless/build_ldflags.patch ================================================ --- ./common/autoconf/generated-configure.sh 2017-05-14 10:01:38.475911076 +0530 +++ ../generated-configure.sh 2017-05-14 10:08:25.204273780 +0530 @@ -47809,8 +47809,8 @@ # Assume the C compiler is the assembler BUILD_AS="$BUILD_CC -c" # Just like for the target compiler, use the compiler as linker - BUILD_LD="$BUILD_CC" - BUILD_LDCXX="$BUILD_CXX" + BUILD_LD="$BUILD_CC -ldl -lpthread" + BUILD_LDCXX="$BUILD_CXX -ldl -lpthread" PATH="$OLDPATH" --- ./common/autoconf/generated-configure.sh 2017-05-14 10:50:10.292197720 +0530 +++ ../generated-configure.sh 2017-05-14 10:53:21.857704488 +0530 @@ -37441,8 +37441,8 @@ LDCXX="$LD" else # All other toolchains use the compiler to link. - LD="$CC" - LDCXX="$CXX" + LD="$CC -llog" + LDCXX="$CXX -llog" fi # FIXME: it should be CXXLD, according to standard (cf CXXCPP) ================================================ FILE: disabled-packages/openjdk-9-jre-headless/elfFile.hpp.patch ================================================ --- ./hotspot/src/share/vm/utilities/elfFile.hpp 2017-05-12 23:47:58.000000000 +0530 +++ ../elfFile.hpp 2017-05-14 12:27:21.069572447 +0530 @@ -50,7 +50,7 @@ typedef Elf64_Phdr Elf_Phdr; typedef Elf64_Sym Elf_Sym; -#if !defined(_ALLBSD_SOURCE) || defined(__APPLE__) +#if (!defined(_ALLBSD_SOURCE) || defined(__APPLE__)) && !defined(__ANDROID__) #define ELF_ST_TYPE ELF64_ST_TYPE #endif ================================================ FILE: disabled-packages/openjdk-9-jre-headless/generated-configure.sh.patch ================================================ --- ./common/autoconf/generated-configure.sh 2017-04-01 23:19:09.508381398 +0530 +++ ../generated-configure.sh 2017-04-02 17:35:37.210373866 +0530 @@ -53412,14 +53412,7 @@ # Check if X11 is needed - if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xios || test "x$OPENJDK_TARGET_OS" = xandroid; then - # No X11 support on windows or macosx NEEDS_LIB_X11=false - else - # All other instances need X11, even if building headless only, libawt still - # needs X11 headers. - NEEDS_LIB_X11=true - fi # Check if cups is needed if test "x$OPENJDK_TARGET_OS" = xwindows; then @@ -53435,11 +53428,7 @@ fi # Check if alsa is needed - if test "x$OPENJDK_TARGET_OS" = xlinux; then - NEEDS_LIB_ALSA=true - else NEEDS_LIB_ALSA=false - fi # Check if ffi is needed if [[ " $JVM_VARIANTS " =~ " zero " ]] || [[ " $JVM_VARIANTS " =~ " zeroshark " ]] ; then ================================================ FILE: disabled-packages/openjdk-9-jre-headless/getgr_r.patch ================================================ --- ./jdk/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c 2017-03-02 21:55:47.000000000 +0530 +++ ../UnixNativeDispatcher.c 2017-03-03 21:37:02.370375158 +0530 @@ -168,40 +168,6 @@ #endif static fdopendir_func* my_fdopendir_func = NULL; -#ifdef __ANDROID__ -/* - * TODO: Android lacks support for the methods listed below. In it's place are - * alternatives that use existing Android functionality, but lack reentrant - * support. Determine if the following are the most suitable alternatives. - * - */ -int getgrgid_r(gid_t gid, struct group* grp, char* buf, size_t buflen, struct group** result) -{ - *result = NULL; - errno = 0; - grp = getgrgid(gid); - if (grp == NULL) { - return errno; - } - // buf not used by caller (see below) - *result = grp; - return 0; -} - -int getgrnam_r(const char *name, struct group* grp, char* buf, size_t buflen, struct group** result) -{ - *result = NULL; - errno = 0; - grp = getgrnam(name); - if (grp == NULL) { - return errno; - } - // buf not used by caller (see below) - *result = grp; - return 0; -} -#endif - /** * fstatat missing from glibc on Linux. Temporary workaround * for x86/x64. ================================================ FILE: disabled-packages/openjdk-9-jre-headless/hotspot-jvm_home.patch ================================================ shoutout to @its-pointless (live_the_dream) --- ./hotspot/src/share/vm/runtime/os.cpp 2017-03-30 20:45:45.000000000 +0530 +++ ../os.cpp 2017-03-31 11:04:17.097618021 +0530 @@ -74,7 +74,7 @@ int os::_processor_count = 0; int os::_initial_active_processor_count = 0; size_t os::_page_sizes[os::page_sizes_max]; -const char * os::_java_home = NULL; +const char * os::_java_home = "@TERMUX_PREFIX@/lib/jvm/openjdk-9"; #ifndef PRODUCT julong os::num_mallocs = 0; // # of calls to malloc/realloc ================================================ FILE: disabled-packages/openjdk-9-jre-headless/jdk-java_home.patch ================================================ --- ./jdk/src/java.base/unix/native/libjli/java_md_solinux.c 2017-03-30 20:45:48.000000000 +0530 +++ ../java_md_solinux.c 2017-03-31 09:15:07.979651293 +0530 @@ -163,7 +163,7 @@ */ #ifdef __ANDROID__ -static char * __java_home = NULL; +static char * __java_home = "@TERMUX_PREFIX@/lib/jvm/openjdk-9"; #endif void SetJavaHome(char *arg) { ================================================ FILE: disabled-packages/openjdk-9-jre-headless/libpthread.patch ================================================ --- ./jdk/make/lib/Awt2dLibraries.gmk 2017-03-30 20:45:48.000000000 +0530 +++ ../Awt2dLibraries.gmk 2017-04-02 18:36:12.582240305 +0530 @@ -145,7 +145,7 @@ LIBAWT_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/utility endif -ifneq ($(filter $(OPENJDK_TARGET_OS), solaris linux macosx aix), ) +ifneq ($(filter $(OPENJDK_TARGET_OS), solaris macosx aix), ) LIBAWT_EXFILES += awt_Font.c CUPSfuncs.c fontpath.c X11Color.c endif @@ -212,7 +212,7 @@ LIBAWT_VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/java.desktop/windows/native/libawt/windows/awt.rc endif -ifeq ($(OPENJDK_TARGET_OS), android) +ifeq ($(OPENJDK_TARGET_OS), linux) LIBAWT_EXFILES += \ java2d/loops/TransformHelper.c \ java2d/loops/ScaledBlit.c \ @@ -347,10 +347,10 @@ endif endif - LIBAWT_XAWT_LIBS := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm -lc + LIBAWT_XAWT_LIBS := $(LIBM) $(LIBDL) -ljava -ljvm -lc ifeq ($(OPENJDK_TARGET_OS), linux) - LIBAWT_XAWT_LIBS += -lpthread + LIBAWT_XAWT_LIBS += -lc endif ifeq ($(TOOLCHAIN_TYPE), gcc) @@ -669,7 +669,7 @@ X11TextRenderer.c \ fontpath.c \ lcdglyph.c -else ifeq ($(OPENJDK_TARGET_OS), android) +else ifeq ($(OPENJDK_TARGET_OS), linux) LIBFONTMANAGER_EXCLUDE_FILES += X11TextRenderer.c else LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \ @@ -939,7 +939,7 @@ LIBSPLASHSCREEN_LDFLAGS := -delayload:user32.dll LIBSPLASHSCREEN_LIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib $(WIN_JAVA_LIB) jvm.lib else - LIBSPLASHSCREEN_LIBS += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread -ldl + LIBSPLASHSCREEN_LIBS += $(LIBM) -lc -ldl endif $(eval $(call SetupNativeCompilation,BUILD_LIBSPLASHSCREEN, \ --- ./jdk/make/lib/Lib-java.desktop.gmk 2017-03-30 20:45:48.000000000 +0530 +++ ../Lib-java.desktop.gmk 2017-04-02 19:01:58.000696690 +0530 @@ -31,7 +31,7 @@ include LibosxLibraries.gmk include PlatformLibraries.gmk -ifeq (,$(filter $(OPENJDK_TARGET_OS), android ios)) +ifeq (,$(filter $(OPENJDK_TARGET_OS), android ios linux)) include Awt2dLibraries.gmk endif include SoundLibraries.gmk --- ./jdk/make/lib/SoundLibraries.gmk 2017-03-30 20:45:48.000000000 +0530 +++ ../SoundLibraries.gmk 2017-04-02 19:14:25.382032835 +0530 @@ -69,16 +69,11 @@ LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES) endif # OPENJDK_TARGET_OS windows -ifeq ($(OPENJDK_TARGET_OS), linux) - EXTRA_SOUND_JNI_LIBS += jsoundalsa - LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX -endif # OPENJDK_TARGET_OS linux - ifeq ($(OPENJDK_TARGET_OS), aix) LIBJSOUND_CFLAGS += -DX_PLATFORM=X_AIX endif # OPENJDK_TARGET_OS aix -ifeq ($(OPENJDK_TARGET_OS), android) +ifeq ($(OPENJDK_TARGET_OS), linux) LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX endif ================================================ FILE: disabled-packages/openjdk-9-jre-headless/openjdk-9-jdk-headless.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="$_jvm_dir/bin/idlj bin/idlj $_jvm_dir/bin/jar bin/jar $_jvm_dir/bin/jarsigner bin/jarsigner $_jvm_dir/bin/javac bin/javac $_jvm_dir/bin/javadoc bin/javadoc $_jvm_dir/bin/javah bin/javah $_jvm_dir/bin/javap bin/javap $_jvm_dir/bin/jcmd bin/jcmd $_jvm_dir/bin/jdb bin/jdb $_jvm_dir/bin/jdeprscan bin/jdeprscan $_jvm_dir/bin/jdeps bin/jdeps $_jvm_dir/bin/jhsdb bin/jhsdb $_jvm_dir/bin/jimage bin/jimage $_jvm_dir/bin/jinfo bin/jinfo $_jvm_dir/bin/jlink bin/jlink $_jvm_dir/bin/jmap bin/jmap $_jvm_dir/bin/jmod bin/jmod $_jvm_dir/bin/jps bin/jps $_jvm_dir/bin/jrunscript bin/jrunscript $_jvm_dir/bin/jshell bin/jshell $_jvm_dir/bin/jstack bin/jstack $_jvm_dir/bin/jstat bin/jstat $_jvm_dir/bin/jstatd bin/jstatd $_jvm_dir/bin/policytool bin/policytool $_jvm_dir/bin/rmic bin/rmic $_jvm_dir/bin/schemagen bin/schemagen $_jvm_dir/bin/serialver bin/serialver $_jvm_dir/bin/wsgen bin/wsgen $_jvm_dir/bin/wsimport bin/wsimport $_jvm_dir/bin/xjc bin/xjc $_jvm_dir/include" TERMUX_SUBPKG_DEPENDS="openjdk-9-jre-headless" TERMUX_SUBPKG_DESCRIPTION="OpenJDK Development Kit (JDK) (headless)" ================================================ FILE: disabled-packages/openjdk-9-jre-headless/openjdk-9-source.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="$_jvm_dir/src.zip" TERMUX_SUBPKG_DEPENDS="openjdk-9-jre-headless" TERMUX_SUBPKG_DESCRIPTION="OpenJDK Development Kit (JDK) source files" TERMUX_SUBPKG_PLATFORM_INDEPENDENT=true ================================================ FILE: disabled-packages/openjdk-9-jre-headless/osName.patch ================================================ thanks @fornwall for finding this --- ./jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java 2017-03-30 20:45:48.000000000 +0530 +++ ../ProcessImpl.java 2017-04-01 23:04:39.565293249 +0530 @@ -157,7 +157,7 @@ static Platform get() { String osName = GetPropertyAction.privilegedGetProperty("os.name"); - if (osName.equals("Linux")) { return LINUX; } + if (osName.equals("Linux") || osName.equals("Android")) { return LINUX; } if (osName.contains("OS X")) { return BSD; } if (osName.equals("SunOS")) { return SOLARIS; } if (osName.equals("AIX")) { return AIX; } ================================================ FILE: disabled-packages/openjdk-9-jre-headless/os_linux_aarch64.cpp.patch ================================================ --- ./hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp 2017-05-12 23:47:58.000000000 +0530 +++ ../os_linux_aarch64.cpp 2017-05-14 21:36:49.672414253 +0530 @@ -77,7 +77,9 @@ # include # include # include +# ifndef __ANDROID__ # include +# endif #ifdef BUILTIN_SIM #define REG_SP REG_RSP ================================================ FILE: disabled-packages/openjdk-9-jre-headless/sendfile64.patch ================================================ --- ./jdk/src/java.base/unix/native/libnio/ch/FileChannelImpl.c 2017-05-12 23:48:01.000000000 +0530 +++ ../FileChannelImpl.c 2017-05-14 22:51:02.292589382 +0530 @@ -41,8 +41,6 @@ #include #ifdef __ANDROID__ #define mmap64 mmap -#include -#define sendfile64(a,b,c,d) syscall(__NR_sendfile64, a, b, c, d); #endif #elif defined(_AIX) #include ================================================ FILE: disabled-packages/openvpn/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://openvpn.net TERMUX_PKG_DESCRIPTION="An easy-to-use, robust, and highly configurable VPN (Virtual Private Network)" TERMUX_PKG_VERSION=2.4.2 TERMUX_PKG_DEPENDS="openssl, liblzo, net-tools" TERMUX_PKG_SRCURL=https://swupdate.openvpn.net/community/releases/openvpn-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=df5c4f384b7df6b08a2f6fa8a84b9fd382baf59c2cef1836f82e2a7f62f1bff9 TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-plugin-auth-pam --disable-systemd --disable-debug --enable-iproute2 --enable-small --enable-x509-alt-username ac_cv_func_getpwnam=yes ac_cv_func_getpass=yes IFCONFIG=$TERMUX_PREFIX/bin/ifconfig ROUTE=$TERMUX_PREFIX/bin/route IPROUTE=$TERMUX_PREFIX/bin/ip NETSTAT=$TERMUX_PREFIX/bin/netstat" TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas" termux_step_pre_configure() { # need to provide getpass, else you "can't get console input" cp "$TERMUX_PKG_BUILDER_DIR/netbsd_getpass.c" "$TERMUX_PKG_SRCDIR/src/openvpn/" # CFLAGS="$CFLAGS -DTARGET_ANDROID" LDFLAGS="$LDFLAGS -llog " } termux_step_post_make_install() { # helper script install -m700 "$TERMUX_PKG_BUILDER_DIR/termux-openvpn" "$TERMUX_PREFIX/bin/" # Install examples install -d -m755 "$TERMUX_PREFIX/share/openvpn/examples" cp "$TERMUX_PKG_SRCDIR"/sample/sample-config-files/* "$TERMUX_PREFIX/share/openvpn/examples" } ================================================ FILE: disabled-packages/openvpn/configure.ac.patch.old ================================================ --- ./configure.ac 2016-12-26 11:51:00.000000000 +0000 +++ ../configure.ac 2016-12-28 04:59:50.936948102 +0000 @@ -311,6 +311,10 @@ AC_DEFINE_UNQUOTED([TARGET_ALIAS], ["${host}"], [A string representing our host]) case "$host" in + *-*-android*) + AC_DEFINE([TARGET_ANDROID], [1], [Are we running on Android?]) + AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["G"], [Target prefix]) + ;; *-*-linux*) AC_DEFINE([TARGET_LINUX], [1], [Are we running on Linux?]) AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["L"], [Target prefix]) ================================================ FILE: disabled-packages/openvpn/netbsd_getpass.c ================================================ /* $NetBSD: getpass.c,v 1.15 2003/08/07 16:42:50 agc Exp $ */ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if 0 #include #if defined(LIBC_SCCS) && !defined(lint) #if 0 static char sccsid[] = "@(#)getpass.c 8.1 (Berkeley) 6/4/93"; #else __RCSID("$NetBSD: getpass.c,v 1.15 2003/08/07 16:42:50 agc Exp $"); #endif #endif /* LIBC_SCCS and not lint */ #include "namespace.h" #endif #include #include #include #include #include #include #include #if 0 #ifdef __weak_alias __weak_alias(getpass,_getpass) #endif #endif char * getpass(prompt) const char *prompt; { struct termios term; int ch; char *p; FILE *fp, *outfp; int echo; static char buf[_PASSWORD_LEN + 1]; sigset_t oset, nset; #if 0 _DIAGASSERT(prompt != NULL); #endif /* * read and write to /dev/tty if possible; else read from * stdin and write to stderr. */ if ((outfp = fp = fopen(_PATH_TTY, "w+")) == NULL) { outfp = stderr; fp = stdin; } /* * note - blocking signals isn't necessarily the * right thing, but we leave it for now. */ sigemptyset(&nset); sigaddset(&nset, SIGINT); sigaddset(&nset, SIGTSTP); (void)sigprocmask(SIG_BLOCK, &nset, &oset); (void)tcgetattr(fileno(fp), &term); if ((echo = (term.c_lflag & ECHO)) != 0) { term.c_lflag &= ~ECHO; (void)tcsetattr(fileno(fp), TCSAFLUSH /*|TCSASOFT*/, &term); } if (prompt != NULL) (void)fputs(prompt, outfp); rewind(outfp); /* implied flush */ for (p = buf; (ch = getc(fp)) != EOF && ch != '\n';) if (p < buf + _PASSWORD_LEN) *p++ = ch; *p = '\0'; (void)write(fileno(outfp), "\n", 1); if (echo) { term.c_lflag |= ECHO; (void)tcsetattr(fileno(fp), TCSAFLUSH/*|TCSASOFT*/, &term); } (void)sigprocmask(SIG_SETMASK, &oset, NULL); if (fp != stdin) (void)fclose(fp); return(buf); } ================================================ FILE: disabled-packages/openvpn/src-openvpn-console_builtin.c.patch ================================================ --- ./src/openvpn/console_builtin.c 2016-12-26 11:51:00.000000000 +0000 +++ ../console_builtin.c 2016-12-28 04:05:41.310830107 +0000 @@ -140,6 +140,7 @@ #ifdef HAVE_GETPASS +#include "netbsd_getpass.c" /** * Open the current console TTY for read/write operations ================================================ FILE: disabled-packages/openvpn/src-openvpn-tun.c.patch ================================================ --- ./src/openvpn/tun.c 2016-12-26 11:51:00.000000000 +0000 +++ ../tun.c 2016-12-28 04:11:52.786734486 +0000 @@ -1939,7 +1939,7 @@ const char *node = dev_node; if (!node) { - node = "/dev/net/tun"; + node = "/dev/tun"; } /* ================================================ FILE: disabled-packages/openvpn/termux-openvpn ================================================ #!/data/data/com.termux/files/usr/bin/sh su -c "export LD_LIBRARY_PATH=$PREFIX/lib; export TMPDIR=$PREFIX/tmp; $PREFIX/bin/openvpn $@" ================================================ FILE: disabled-packages/pacman/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.archlinux.org/pacman/ TERMUX_PKG_DESCRIPTION="A library-based package manager with dependency support" TERMUX_PKG_MAINTAINER="Francisco Demartino @franciscod" # HEAVILY adapted from archlinux PKGBUILD pkgname=pacman pkgver=4.2.1 TERMUX_PKG_VERSION=$pkgver #FIXME: asciidoc, fakechroot/fakeroot TERMUX_PKG_DEPENDS="bash, glib, libarchive, curl, gpgme, python2, libandroid-glob, libandroid-support" TERMUX_PKG_SRCURL="https://sources.archlinux.org/other/pacman/$pkgname-$pkgver.tar.gz" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--prefix=$TERMUX_PREFIX --sysconfdir=$TERMUX_PREFIX/etc" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --localstatedir=$TERMUX_PREFIX/var --enable-doc " TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-scriptlet-shell=/usr/bin/bash" termux_step_pre_configure() { LDFLAGS+="$LDFLAGS -llog -landroid-glob" } termux_step_make() { make make -C contrib # make -C "$pkgname-$pkgver" check } termux_step_make_install() { make install make -C contrib install # install Arch specific stuff install -dm755 "$TERMUX_PREFIX/etc" install -m644 "$TERMUX_PKG_BUILDER_DIR/pacman.conf" "$TERMUX_PREFIX/etc/pacman.conf" case $TERMUX_ARCH in i686) mycarch="i686" mychost="i686-pc-linux-gnu" myflags="-march=i686" ;; arm) mycarch="arm" mychost="arm-unknown-linux-gnu" myflags="-march=arm" ;; esac # set things correctly in the default conf file install -m644 "$TERMUX_PKG_BUILDER_DIR/makepkg.conf" "$TERMUX_PREFIX/etc" sed -i "$TERMUX_PREFIX/etc/makepkg.conf" \ -e "s|@CARCH[@]|$mycarch|g" \ -e "s|@CHOST[@]|$mychost|g" \ -e "s|@CARCHFLAGS[@]|$myflags|g" # FIXME bash_completion # # put bash_completion in the right location # install -dm755 "$TERMUX_PREFIX/share/bash-completion/completions" # mv "$TERMUX_PREFIX/etc/bash_completion.d/pacman" "$TERMUX_PREFIX/share/bash-completion/completions" # rmdir "$TERMUX_PREFIX/etc/bash_completion.d" # for f in makepkg pacman-key; do # ln -s pacman "$TERMUX_PREFIX/share/bash-completion/completions/$f" # done install -Dm644 contrib/PKGBUILD.vim "$TERMUX_PREFIX/share/vim/vimfiles/syntax/PKGBUILD.vim" } ================================================ FILE: disabled-packages/pacman/ensure-matching-database-and-package-version.patch ================================================ From deac9731884a83ad91eab9f27b288f406f56c87b Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Sat, 18 Jul 2015 17:58:23 +0200 Subject: [PATCH] ensure matching database and package version While loading each package ensure that the internal version matches the expected database version to avoid the possibility to circumvent the version check. This issue can be used by an attacker to trick the software into installing an older version. The behavior can be exploited by a man-in-the-middle attack through specially crafted database tarball containing a higher version, yet actually delivering an older and vulnerable version, which was previously shipped. Signed-off-by: Levente Polyak Signed-off-by: Remi Gacogne Signed-off-by: Allan McRae --- lib/libalpm/sync.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 888ae15..e843b07 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -1212,6 +1212,7 @@ static int load_packages(alpm_handle_t *handle, alpm_list_t **data, EVENT(handle, &event); for(i = handle->trans->add; i; i = i->next, current++) { + int error = 0; alpm_pkg_t *spkg = i->data; char *filepath; int percent = (int)(((double)current_bytes / total_bytes) * 100); @@ -1232,6 +1233,23 @@ static int load_packages(alpm_handle_t *handle, alpm_list_t **data, spkg->name); alpm_pkg_t *pkgfile =_alpm_pkg_load_internal(handle, filepath, 1); if(!pkgfile) { + _alpm_log(handle, ALPM_LOG_DEBUG, "failed to load pkgfile internal\n"); + error = 1; + } else { + if(strcmp(spkg->name, pkgfile->name) != 0) { + _alpm_log(handle, ALPM_LOG_DEBUG, + "internal package name mismatch, expected: '%s', actual: '%s'\n", + spkg->name, pkgfile->name); + error = 1; + } + if(strcmp(spkg->version, pkgfile->version) != 0) { + _alpm_log(handle, ALPM_LOG_DEBUG, + "internal package version mismatch, expected: '%s', actual: '%s'\n", + spkg->version, pkgfile->version); + error = 1; + } + } + if(error != 0) { errors++; *data = alpm_list_add(*data, strdup(spkg->filename)); free(filepath); -- 2.4.6 ================================================ FILE: disabled-packages/pacman/makepkg.conf ================================================ # # /etc/makepkg.conf # ######################################################################### # SOURCE ACQUISITION ######################################################################### # #-- The download utilities that makepkg should use to acquire sources # Format: 'protocol::agent' DLAGENTS=('ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u' 'http::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u' 'https::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u' 'rsync::/usr/bin/rsync --no-motd -z %u %o' 'scp::/usr/bin/scp -C %u %o') # Other common tools: # /usr/bin/snarf # /usr/bin/lftpget -c # /usr/bin/wget #-- The package required by makepkg to download VCS sources # Format: 'protocol::package' VCSCLIENTS=('bzr::bzr' 'git::git' 'hg::mercurial' 'svn::subversion') ######################################################################### # ARCHITECTURE, COMPILE FLAGS ######################################################################### # CARCH="@CARCH@" CHOST="@CHOST@" #-- Compiler and Linker Flags # -march (or -mcpu) builds exclusively for an architecture # -mtune optimizes for an architecture, but builds for whole processor family CPPFLAGS="-D_FORTIFY_SOURCE=2" CFLAGS="@CARCHFLAGS@ -mtune=generic -O2 -pipe -fstack-protector-strong" CXXFLAGS="@CARCHFLAGS@ -mtune=generic -O2 -pipe -fstack-protector-strong" LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro" #-- Make Flags: change this for DistCC/SMP systems #MAKEFLAGS="-j2" #-- Debugging flags DEBUG_CFLAGS="-g -fvar-tracking-assignments" DEBUG_CXXFLAGS="-g -fvar-tracking-assignments" ######################################################################### # BUILD ENVIRONMENT ######################################################################### # # Defaults: BUILDENV=(!distcc color !ccache check !sign) # A negated environment option will do the opposite of the comments below. # #-- distcc: Use the Distributed C/C++/ObjC compiler #-- color: Colorize output messages #-- ccache: Use ccache to cache compilation #-- check: Run the check() function if present in the PKGBUILD #-- sign: Generate PGP signature file # BUILDENV=(!distcc color !ccache check !sign) # #-- If using DistCC, your MAKEFLAGS will also need modification. In addition, #-- specify a space-delimited list of hosts running in the DistCC cluster. #DISTCC_HOSTS="" # #-- Specify a directory for package building. #BUILDDIR=/tmp/makepkg ######################################################################### # GLOBAL PACKAGE OPTIONS # These are default values for the options=() settings ######################################################################### # # Default: OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !upx !debug) # A negated option will do the opposite of the comments below. # #-- strip: Strip symbols from binaries/libraries #-- docs: Save doc directories specified by DOC_DIRS #-- libtool: Leave libtool (.la) files in packages #-- staticlibs: Leave static library (.a) files in packages #-- emptydirs: Leave empty directories in packages #-- zipman: Compress manual (man and info) pages in MAN_DIRS with gzip #-- purge: Remove files specified by PURGE_TARGETS #-- upx: Compress binary executable files using UPX #-- debug: Add debugging flags as specified in DEBUG_* variables # OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !upx !debug) #-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512 INTEGRITY_CHECK=(md5) #-- Options to be used when stripping binaries. See `man strip' for details. STRIP_BINARIES="--strip-all" #-- Options to be used when stripping shared libraries. See `man strip' for details. STRIP_SHARED="--strip-unneeded" #-- Options to be used when stripping static libraries. See `man strip' for details. STRIP_STATIC="--strip-debug" #-- Manual (man and info) directories to compress (if zipman is specified) MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info}) #-- Doc directories to remove (if !docs is specified) DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc}) #-- Files to be removed from all packages (if purge is specified) PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod) ######################################################################### # PACKAGE OUTPUT ######################################################################### # # Default: put built package and cached source in build directory # #-- Destination: specify a fixed directory where all packages will be placed #PKGDEST=/home/packages #-- Source cache: specify a fixed directory where source files will be cached #SRCDEST=/home/sources #-- Source packages: specify a fixed directory where all src packages will be placed #SRCPKGDEST=/home/srcpackages #-- Log files: specify a fixed directory where all log files will be placed #LOGDEST=/home/makepkglogs #-- Packager: name/email of the person or organization building packages #PACKAGER="John Doe " #-- Specify a key to use for package signing #GPGKEY="" ######################################################################### # COMPRESSION DEFAULTS ######################################################################### # COMPRESSGZ=(gzip -c -f -n) COMPRESSBZ2=(bzip2 -c -f) COMPRESSXZ=(xz -c -z -) COMPRESSLRZ=(lrzip -q) COMPRESSLZO=(lzop -q) COMPRESSZ=(compress -c -f) ######################################################################### # EXTENSION DEFAULTS ######################################################################### # # WARNING: Do NOT modify these variables unless you know what you are # doing. # PKGEXT='.pkg.tar.xz' SRCEXT='.src.tar.gz' # vim: set ft=sh ts=2 sw=2 et: ================================================ FILE: disabled-packages/pacman/pacman.conf ================================================ # # /etc/pacman.conf # # See the pacman.conf(5) manpage for option and repository directives # # GENERAL OPTIONS # [options] # The following paths are commented out with their default values listed. # If you wish to use different paths, uncomment and update the paths. #RootDir = / #DBPath = /var/lib/pacman/ #CacheDir = /var/cache/pacman/pkg/ #LogFile = /var/log/pacman.log #GPGDir = /etc/pacman.d/gnupg/ HoldPkg = pacman glibc #XferCommand = /usr/bin/curl -C - -f %u > %o #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u #CleanMethod = KeepInstalled #UseDelta = 0.7 Architecture = auto # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup #IgnorePkg = #IgnoreGroup = #NoUpgrade = #NoExtract = # Misc options #UseSyslog #Color #TotalDownload CheckSpace #VerbosePkgLists # By default, pacman accepts packages signed by keys that its local keyring # trusts (see pacman-key and its man page), as well as unsigned packages. SigLevel = Required DatabaseOptional LocalFileSigLevel = Optional #RemoteFileSigLevel = Required # NOTE: You must run `pacman-key --init` before first using pacman; the local # keyring can then be populated with the keys of all official Arch Linux # packagers with `pacman-key --populate archlinux`. # # REPOSITORIES # - can be defined here or included from another file # - pacman will search repositories in the order defined here # - local/custom mirrors can be added here or in separate files # - repositories listed first will take precedence when packages # have identical names, regardless of version number # - URLs will have $repo replaced by the name of the current repo # - URLs will have $arch replaced by the name of the architecture # # Repository entries are of the format: # [repo-name] # Server = ServerName # Include = IncludePath # # The header [repo-name] is crucial - it must be present and # uncommented to enable the repo. # # The testing repositories are disabled by default. To enable, uncomment the # repo name header and Include lines. You can add preferred servers immediately # after the header, and they will be used before the default mirrors. #[testing] #Include = /etc/pacman.d/mirrorlist [core] Include = /etc/pacman.d/mirrorlist [extra] Include = /etc/pacman.d/mirrorlist #[community-testing] #Include = /etc/pacman.d/mirrorlist [community] Include = /etc/pacman.d/mirrorlist # An example of a custom package repository. See the pacman manpage for # tips on creating your own repositories. #[custom] #SigLevel = Optional TrustAll #Server = file:///home/custompkgs ================================================ FILE: disabled-packages/pacman/pacman.patch ================================================ --- ./src/pacman/pacman.c 2015-12-23 19:50:37.093132801 -0300 +++ ./src/pacman/pacman.c 2015-12-23 23:30:17.986469980 -0300 @@ -1128,7 +1128,8 @@ } while(c != EOF); free(line); - if(!freopen(ctermid(NULL), "r", stdin)) { + //if(!freopen(ctermid(NULL), "r", stdin)) { + if(!freopen("/dev/tty", "r", stdin)) { // HACK termux doesn't have ctermid() pm_printf(ALPM_LOG_ERROR, _("failed to reopen stdin for reading: (%s)\n"), strerror(errno)); } ================================================ FILE: disabled-packages/pkgconf/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://pkgconf.org TERMUX_PKG_DESCRIPTION="Program which helps to configure compiler and linker flags for development frameworks" TERMUX_PKG_VERSION=1.5.3 TERMUX_PKG_SHA256=45b76f5037379b1e24b788379c74f31fc4f060b272a08bdda9e558c120e9f3b6 TERMUX_PKG_SRCURL=https://github.com/pkgconf/pkgconf/archive/pkgconf-$TERMUX_PKG_VERSION.tar.gz termux_step_pre_configure() { ./autogen.sh } ================================================ FILE: disabled-packages/premake/build-gmake.unix-Premake4.make.patch ================================================ diff -u -r ../premake-4.4-beta5/build/gmake.unix/Premake4.make ./build/gmake.unix/Premake4.make --- ../premake-4.4-beta5/build/gmake.unix/Premake4.make 2013-11-26 10:41:34.000000000 -0500 +++ ./build/gmake.unix/Premake4.make 2015-11-03 09:39:25.024912553 -0500 @@ -7,10 +7,6 @@ SILENT = @ endif -CC = gcc -CXX = g++ -AR = ar - ifndef RESCOMP ifdef WINDRES RESCOMP = $(WINDRES) ================================================ FILE: disabled-packages/premake/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://premake.github.io/ TERMUX_PKG_DESCRIPTION="Build script generator" TERMUX_PKG_VERSION=4.4-beta5 TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/premake/Premake/4.4/premake-${TERMUX_PKG_VERSION}-src.zip # TERMUX_PKG_DEPENDS="pcre, openssl, libuuid" # TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-ssl=openssl" termux_step_pre_configure() { TERMUX_PKG_BUILDDIR=$TERMUX_PKG_SRCDIR/build/gmake.unix } ================================================ FILE: disabled-packages/sbcl/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.sbcl.org/ TERMUX_PKG_DESCRIPTION="Steel Bank Common Lisp" TERMUX_PKG_VERSION=1.3.9 TERMUX_PKG_SRCURL=http://prdownloads.sourceforge.net/sbcl/sbcl-${TERMUX_PKG_VERSION}-source.tar.bz2 termux_step_pre_configure() { local SBCL_HOST_TARFILE=$TERMUX_PKG_CACHEDIR/sbcl-host-${TERMUX_PKG_VERSION}.tar.bz2 if [ ! -f $SBCL_HOST_TARFILE ]; then curl -o $SBCL_HOST_TARFILE -L http://downloads.sourceforge.net/project/sbcl/sbcl/${TERMUX_PKG_VERSION}/sbcl-${TERMUX_PKG_VERSION}-x86-64-linux-binary.tar.bz2 cd $TERMUX_PKG_TMPDIR tar xf $SBCL_HOST_TARFILE cd sbcl-${TERMUX_PKG_VERSION}-x86-64-linux INSTALL_ROOT=$TERMUX_PKG_CACHEDIR/sbcl-host sh install.sh fi export PATH=$PATH:$TERMUX_PKG_CACHEDIR/sbcl-host/bin export SBCL_HOME=$TERMUX_PKG_CACHEDIR/sbcl-host/lib/sbcl } termux_step_make_install() { cd $TERMUX_PKG_SRCDIR sh make.sh --prefix=$TERMUX_PREFIX } ================================================ FILE: disabled-packages/sbcl/make-config.sh.patch ================================================ diff -u -r ../sbcl-1.3.4/make-config.sh ./make-config.sh --- ../sbcl-1.3.4/make-config.sh 2016-03-31 03:28:36.000000000 -0400 +++ ./make-config.sh 2016-04-10 16:43:40.651905145 -0400 @@ -754,8 +754,9 @@ # cross-compilers! # # FIXME: integrate to grovel-features, mayhaps -$GNUMAKE -C tools-for-build determine-endianness -I ../src/runtime -tools-for-build/determine-endianness >> $ltf +# $GNUMAKE -C tools-for-build determine-endianness -I ../src/runtime +# tools-for-build/determine-endianness >> $ltf +echo " :little-endian" >> $ltf # Termux patch. export sbcl_os sbcl_arch sh tools-for-build/grovel-features.sh >> $ltf ================================================ FILE: disabled-packages/sslscan/Makefile.patch ================================================ diff --git a/Makefile b/Makefile index 24e6a36..74c2647 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,5 @@ # set gcc as default if CC is not set -ifndef $(CC) - CC=gcc -endif +CC?=gcc GIT_VERSION = $(shell git describe --tags --always --dirty=-wip) @@ -14,7 +12,7 @@ endif OS := $(shell uname) SRCS = sslscan.c -PREFIX = /usr +PREFIX ?= /usr BINDIR = $(PREFIX)/bin MANDIR = $(PREFIX)/share/man MAN1DIR = $(MANDIR)/man1 ================================================ FILE: disabled-packages/sslscan/build.sh ================================================ # Status: Does not work with openssl 1.1 or later. TERMUX_PKG_HOMEPAGE=https://github.com/rbsec/sslscan TERMUX_PKG_DESCRIPTION="Fast SSL scanner" TERMUX_PKG_VERSION=1.11.11 TERMUX_PKG_SRCURL=https://github.com/rbsec/sslscan/archive/${TERMUX_PKG_VERSION}-rbsec.tar.gz TERMUX_PKG_SHA256=93fbe1570073dfb2898a546759836ea4df5054e3a8f6d2e3da468eddac8b1764 TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_DEPENDS="openssl" TERMUX_PKG_MAINTAINER="Pierre Rudloff @Rudloff" termux_step_pre_configure() { CPPFLAGS+=" -D__USE_GNU=1" } ================================================ FILE: disabled-packages/sslscan/sslscan.c.patch ================================================ diff -u -r ../sslscan-1.11.7-rbsec/sslscan.c ./sslscan.c --- ../sslscan-1.11.7-rbsec/sslscan.c 2016-06-13 08:42:11.000000000 -0400 +++ ./sslscan.c 2016-09-05 16:51:08.751161131 -0400 @@ -65,6 +65,7 @@ #endif #else #include + #include #include #include #endif @@ -794,11 +795,11 @@ } } else -#endif { printf("%sOpenSSL version does not support compression%s\n", COL_RED, RESET); printf("%sRebuild with zlib1g-dev package for zlib support%s\n\n", COL_RED, RESET); } +#endif // Disconnect SSL over socket SSL_shutdown(ssl); @@ -3762,10 +3763,6 @@ case mode_multiple: printf("Version: %s%s%s\n%s\n%s\n", COL_GREEN, VERSION, RESET, SSLeay_version(SSLEAY_VERSION), RESET); -#ifdef OPENSSL_NO_SSL2 - printf("%sOpenSSL version does not support SSLv2%s\n", COL_RED, RESET); - printf("%sSSLv2 ciphers will not be detected%s\n\n", COL_RED, RESET); -#endif #ifdef OPENSSL_NO_SSL3 printf("%sOpenSSL version does not support SSLv3%s\n", COL_RED, RESET); printf("%sSSLv3 ciphers will not be detected%s\n", COL_RED, RESET); ================================================ FILE: disabled-packages/tf/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://tinyfugue.sourceforge.net/ TERMUX_PKG_DESCRIPTION="Flexible, screen-oriented MUD client" TERMUX_PKG_VERSION=5.0~beta8 TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/tinyfugue/tinyfugue/5.0%20beta%208/tf-50b8.tar.gz TERMUX_PKG_BUILD_IN_SRC=true # TERMUX_PKG_DEPENDS="pcre, openssl, libuuid" # TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-ssl=openssl --disable-iri" ================================================ FILE: disabled-packages/toybox/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://landley.net/toybox/ TERMUX_PKG_DESCRIPTION="Common Linux command line utilities" TERMUX_PKG_VERSION=0.7.3 TERMUX_PKG_SRCURL=http://landley.net/toybox/downloads/toybox-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=e6469b508224e0d2e4564dda05c4bb47aef5c28bf29d6c983bcdc6e3a0cd29d6 TERMUX_PKG_BUILD_IN_SRC=true termux_step_configure() { make defconfig } ================================================ FILE: disabled-packages/unnethack/build.sh ================================================ # Crashes with "Dungeon description not valid" TERMUX_PKG_HOMEPAGE=http://sourceforge.net/apps/trac/unnethack TERMUX_PKG_DESCRIPTION="Dungeon crawling game, fork of NetHack" TERMUX_PKG_VERSION=5.1.0 TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/unnethack/unnethack/${TERMUX_PKG_VERSION}/unnethack-${TERMUX_PKG_VERSION}-20131208.tar.gz # --with-owner=$USER to avoid unnethack trying to use a "games" user, --with-groups to avoid "bin" group TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-owner=$USER --with-group=$(groups | cut -d ' ' -f 1)" TERMUX_PKG_DEPENDS="gsl, ncurses" # unnethack builds util/{makedefs,lev_comp,dgn_comp} binaries which are later used during the build. # we first build these host tools in $TERMUX_PKG_TMPDIR/host-build and copy them into the ordinary # cross compile tree after configure, bumping their modification time so that they do not get rebuilt. CFLAGS="$CFLAGS $CPPFLAGS $LDFLAGS" export LFLAGS="$LDFLAGS" LD="$CC" termux_step_pre_configure() { # Create a host build for the makedefs binary mkdir $TERMUX_PKG_TMPDIR/host-build cd $TERMUX_PKG_TMPDIR/host-build ORIG_CC=$CC; export CC=gcc ORIG_CFLAGS=$CFLAGS; export CFLAGS="" ORIG_CPPFLAGS=$CPPFLAGS; export CPPFLAGS="" ORIG_CXXFLAGS=$CXXFLAGS; export CXXFLAGS="" ORIG_LDFLAGS=$LDFLAGS; export LDFLAGS="" ORIG_LFLAGS=$LFLAGS; export LFLAGS="" $TERMUX_PKG_SRCDIR/configure --with-owner=$USER make make spec_levs make dungeon set +e make dlb set -e export CC=$ORIG_CC export CFLAGS=$ORIG_CFLAGS export CPPFLAGS=$ORIG_CPPFLAGS export CXXFLAGS=$ORIG_CXXFLAGS export LDFLAGS=$ORIG_LDFLAGS export LFLAGS=$ORIG_LFLAGS } termux_step_post_configure() { # Use the host built makedefs cp $TERMUX_PKG_TMPDIR/host-build/util/makedefs $TERMUX_PKG_BUILDDIR/util/makedefs cp $TERMUX_PKG_TMPDIR/host-build/util/lev_comp $TERMUX_PKG_BUILDDIR/util/lev_comp cp $TERMUX_PKG_TMPDIR/host-build/util/dgn_comp $TERMUX_PKG_BUILDDIR/util/dgn_comp cp $TERMUX_PKG_TMPDIR/host-build/util/dlb $TERMUX_PKG_BUILDDIR/util/dlb # Update timestamp so the binary does not get rebuilt touch -d "next hour" $TERMUX_PKG_BUILDDIR/util/makedefs $TERMUX_PKG_BUILDDIR/util/lev_comp $TERMUX_PKG_BUILDDIR/util/dgn_comp $TERMUX_PKG_BUILDDIR/util/dlb } termux_step_post_make_install() { # Add directory which must exist: mkdir -p $TERMUX_PREFIX/var/unnethack/level echo "This directory stores locks" > $TERMUX_PREFIX/var/unnethack/level/README } ================================================ FILE: disabled-packages/unnethack/dat_town_wildcard.patch ================================================ diff -u -r ../unnethack-5.1.0-20131208/sys/autoconf/Makefile.dat ./sys/autoconf/Makefile.dat --- ../unnethack-5.1.0-20131208/sys/autoconf/Makefile.dat 2013-12-08 16:00:26.000000000 +0100 +++ ./sys/autoconf/Makefile.dat 2014-02-14 16:29:56.000000000 +0100 @@ -293,7 +293,7 @@ advcal.des moria.des \ bigroom.des blkmar.des castle.des \ dragons.des \ - endgame.des gehennom.des heck.des knox.des town-?.des \ + endgame.des gehennom.des heck.des knox.des town-1.des town-2.des \ medusa.des \ mines.des nymph.des oracle.des \ sheol.des \ @@ -312,7 +312,8 @@ ../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/knox.des ../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/medusa.des ../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/nymph.des - ../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/town-?.des + ../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/town-1.des + ../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/town-2.des ../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/moria.des ../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/mines.des ../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/oracle.des ================================================ FILE: disabled-packages/unnethack/dont_delete_makedefs.patch ================================================ The build machine makedefs binary is built before cross compiling, and must not be removed afterwards. diff -u -r ../unnethack-5.1.0-20131208/sys/autoconf/Makefile.src ./sys/autoconf/Makefile.src --- ../unnethack-5.1.0-20131208/sys/autoconf/Makefile.src 2013-12-08 16:00:26.000000000 +0100 +++ ./sys/autoconf/Makefile.src 2014-02-14 16:22:56.000000000 +0100 @@ -358,11 +358,9 @@ # below in the 'make depend' output. monst.o: $(CC) $(CFLAGS) -c $(srcdir)/monst.c - @rm -f $(MAKEDEFS) objects.o: $(CC) $(CFLAGS) -c $(srcdir)/objects.c - @rm -f $(MAKEDEFS) # Qt windowport meta-object-compiler output qt_kde0.moc: ../include/qt_kde0.h ================================================ FILE: generate-bootstraps.sh ================================================ #!/bin/bash ## ## Script for generating bootstrap archives. ## set -e BOOTSTRAP_TMPDIR=$(mktemp -d "${TMPDIR:-/tmp}/bootstrap-tmp.XXXXXXXX") trap 'rm -rf $BOOTSTRAP_TMPDIR' EXIT # By default, bootstrap archives will be built for all architectures # supported by Termux application. # Override with option '--architectures'. TERMUX_ARCHITECTURES=("aarch64" "arm" "i686" "x86_64") # Can be changed by using '--repository' option. REPO_BASE_URL="https://dl.bintray.com/termux/termux-packages-24" # Can be changed by using '--prefix' option. TERMUX_PREFIX="/data/data/com.termux/files/usr" # A list of non-essential packages. By default it is empty, but can # be filled with option '--add'. declare -a ADDITIONAL_PACKAGES # Check for some important utilities that may not be available for # some reason. for cmd in ar awk curl grep gzip find sed tar xargs xz zip; do if [ -z "$(command -v $cmd)" ]; then echo "[!] Utility '$cmd' is not available in PATH." exit 1 fi done # Download package lists from remote repository. # Actually, there 2 lists are downloaded: one architecture-independent and one # for architecture specified as '$1' argument. read_package_list() { local architecture for architecture in all "$1"; do if [ ! -e "${BOOTSTRAP_TMPDIR}/packages.${architecture}" ]; then echo "[*] Downloading package list for architecture '${architecture}'..." curl \ --fail \ --location \ --output "${BOOTSTRAP_TMPDIR}/packages.${architecture}" \ "${REPO_BASE_URL}/dists/stable/main/binary-${architecture}/Packages" echo >> "${BOOTSTRAP_TMPDIR}/packages.${architecture}" fi echo "[*] Reading package list for '${architecture}'..." while read -r -d $'\xFF' package; do if [ -n "$package" ]; then local package_name package_name=$(echo "$package" | grep -i "^Package:" | awk '{ print $2 }') if [ -z "${PACKAGE_METADATA["$package_name"]}" ]; then PACKAGE_METADATA["$package_name"]="$package" else local prev_package_ver cur_package_ver cur_package_ver=$(echo "$package" | grep -i "^Version:" | awk '{ print $2 }') prev_package_ver=$(echo "${PACKAGE_METADATA["$package_name"]}" | grep -i "^Version:" | awk '{ print $2 }') # If package has multiple versions, make sure that our metadata # contains the latest one. if [ "$(echo -e "${prev_package_ver}\n${cur_package_ver}" | sort -rV | head -n1)" = "${cur_package_ver}" ]; then PACKAGE_METADATA["$package_name"]="$package" fi fi fi done < <(sed -e "s/^$/\xFF/g" "${BOOTSTRAP_TMPDIR}/packages.${architecture}") done } # Download specified package, its depenencies and then extract *.deb files to # the bootstrap root. pull_package() { local package_name=$1 local package_tmpdir="${BOOTSTRAP_PKGDIR}/${package_name}" mkdir -p "$package_tmpdir" local package_url package_url="$REPO_BASE_URL/$(echo "${PACKAGE_METADATA[${package_name}]}" | grep -i "^Filename:" | awk '{ print $2 }')" if [ "${package_url}" = "$REPO_BASE_URL" ] || [ "${package_url}" = "${REPO_BASE_URL}/" ]; then echo "[!] Failed to determine URL for package '$package_name'." exit 1 fi local package_dependencies package_dependencies=$( while read -r token; do echo "$token" | cut -d'|' -f1 | sed -E 's@\(.*\)@@' done < <(echo "${PACKAGE_METADATA[${package_name}]}" | grep -i "^Depends:" | sed -E 's@^[Dd]epends:@@' | tr ',' '\n') ) # Recursively handle dependencies. if [ -n "$package_dependencies" ]; then local dep for dep in $package_dependencies; do if [ ! -e "${BOOTSTRAP_PKGDIR}/${dep}" ]; then pull_package "$dep" fi done unset dep fi if [ ! -e "$package_tmpdir/package.deb" ]; then echo "[*] Downloading '$package_name'..." curl --fail --location --output "$package_tmpdir/package.deb" "$package_url" echo "[*] Extracting '$package_name'..." (cd "$package_tmpdir" ar x package.deb # data.tar may have extension different from .xz if [ -f "./data.tar.xz" ]; then data_archive="data.tar.xz" elif [ -f "./data.tar.gz" ]; then data_archive="data.tar.gz" else echo "No data.tar.* found in '$package_name'." exit 1 fi # Do same for control.tar. if [ -f "./control.tar.xz" ]; then control_archive="control.tar.xz" elif [ -f "./control.tar.gz" ]; then control_archive="control.tar.gz" else echo "No control.tar.* found in '$package_name'." exit 1 fi # Extract files. tar xf "$data_archive" -C "$BOOTSTRAP_ROOTFS" tar tf "$data_archive" > "${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/info/${package_name}.list" # Generate checksums (md5). tar xf "$data_archive" find data -type f -print0 | xargs -0 -r md5sum | sed 's@^\.$@@g' > "${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/info/${package_name}.md5sums" # Extract metadata. tar xf "$control_archive" { cat control echo "Status: install ok installed" echo } >> "${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/status" # Additional data: conffiles & scripts for file in conffiles postinst postrm preinst prerm; do if [ -f "${PWD}/${file}" ]; then cp "$file" "${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/info/${package_name}.${file}" fi done ) fi } # Final stage: generate bootstrap archive and place it to current # working directory. # Information about symlinks is stored in file SYMLINKS.txt. create_bootstrap_archive() { echo "[*] Creating 'bootstrap-${1}.zip'..." (cd "${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}" # Do not store symlinks in bootstrap archive. # Instead, put all information to SYMLINKS.txt while read -r -d '' link; do echo "$(readlink "$link")←${link}" >> SYMLINKS.txt rm -f "$link" done < <(find . -type l -print0) zip -r9 "${BOOTSTRAP_TMPDIR}/bootstrap-${1}.zip" ./* ) mv -f "${BOOTSTRAP_TMPDIR}/bootstrap-${1}.zip" ./ echo "[*] Finished successfully (${1})." } show_usage() { echo echo "Usage: generate-bootstraps.sh [options]" echo echo "Generate bootstrap archives for Termux application." echo echo "Options:" echo echo " -h, --help Show this help." echo echo " -a, --add PKG_LIST Specify one or more additional packages" echo " to include into bootstrap archive." echo " Multiple packages should be passed as" echo " comma-separated list." echo echo " --architectures ARCH_LIST Override default list of architectures" echo " for which bootstrap archives will be" echo " created." echo " Multiple architectures should be passed" echo " as comma-separated list." echo echo " -p, --prefix PATH Specify rootfs prefix absolute path." echo " Should be exactly same as in packages" echo " in the remote repository." echo echo " -r, --repository URL Specify URL for APT repository from" echo " which packages will be downloaded." echo echo "Architectures: ${TERMUX_ARCHITECTURES[*]}" echo "Repository URL: ${REPO_BASE_URL}" echo "Prefix: ${TERMUX_PREFIX}" echo } while (($# > 0)); do case "$1" in -h|--help) show_usage exit 0 ;; -a|--add) if [ $# -gt 1 ] && [ -n "$2" ] && [[ $2 != -* ]]; then for pkg in $(echo "$2" | tr ',' ' '); do ADDITIONAL_PACKAGES+=("$pkg") done unset pkg shift 1 else echo "[!] Option '--add' requires an argument." show_usage exit 1 fi ;; --architectures) if [ $# -gt 1 ] && [ -n "$2" ] && [[ $2 != -* ]]; then TERMUX_ARCHITECTURES=() for arch in $(echo "$2" | tr ',' ' '); do TERMUX_ARCHITECTURES+=("$arch") done unset arch shift 1 else echo "[!] Option '--architectures' requires an argument." show_usage exit 1 fi ;; -p|--prefix) if [ $# -gt 1 ] && [ -n "$2" ] && [[ $2 != -* ]]; then TERMUX_PREFIX="$2" shift 1 else echo "[!] Option '--prefix' requires an argument." show_usage exit 1 fi ;; -r|--repository) if [ $# -gt 1 ] && [ -n "$2" ] && [[ $2 != -* ]]; then REPO_BASE_URL="$2" shift 1 else echo "[!] Option '--repository' requires an argument." show_usage exit 1 fi ;; *) echo "[!] Got unknown option '$1'" show_usage exit 1 ;; esac shift 1 done for package_arch in "${TERMUX_ARCHITECTURES[@]}"; do BOOTSTRAP_ROOTFS="$BOOTSTRAP_TMPDIR/rootfs-${package_arch}" BOOTSTRAP_PKGDIR="$BOOTSTRAP_TMPDIR/packages-${package_arch}" # Create initial directories for $TERMUX_PREFIX mkdir -p "${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/etc/apt/apt.conf.d" mkdir -p "${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/etc/apt/preferences.d" mkdir -p "${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/tmp" mkdir -p "${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/cache/apt/archives/partial" mkdir -p "${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/info" mkdir -p "${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/triggers" mkdir -p "${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/updates" mkdir -p "${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/log/apt" touch "${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/available" touch "${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/status" # Read package metadata. unset PACKAGE_METADATA declare -A PACKAGE_METADATA read_package_list "$package_arch" # Package manager. pull_package apt pull_package game-repo pull_package science-repo # Core utilities. pull_package bash pull_package bzip2 pull_package command-not-found pull_package coreutils pull_package curl pull_package dash pull_package diffutils pull_package findutils pull_package gawk pull_package grep pull_package gzip pull_package less pull_package procps pull_package psmisc pull_package sed pull_package tar pull_package termux-exec pull_package termux-tools pull_package xz-utils # Additional. pull_package busybox pull_package ed pull_package dos2unix pull_package inetutils pull_package net-tools pull_package patch pull_package unzip pull_package util-linux # Handle additional packages. for add_pkg in "${ADDITIONAL_PACKAGES[@]}"; do pull_package "$add_pkg" done unset add_pkg # Create bootstrap archive. create_bootstrap_archive "$package_arch" done ================================================ FILE: ndk-patches/asm-generic-termbits.h.patch ================================================ diff -u -r /home/builder/lib/android-ndk/sysroot/usr/include/asm-generic/termbits.h ./usr/include/asm-generic/termbits.h --- /home/builder/lib/android-ndk/sysroot/usr/include/asm-generic/termbits.h 2018-09-10 17:37:50.000000000 +0000 +++ ./usr/include/asm-generic/termbits.h 2019-01-16 04:54:01.117253378 +0000 @@ -190,5 +190,6 @@ #define TCIOFLUSH 2 #define TCSANOW 0 #define TCSADRAIN 1 -#define TCSAFLUSH 2 +/* TCSAFLUSH is patched to be TCSANOW in Termux to work around Android SELinux rule */ +#define TCSAFLUSH 0 #endif ================================================ FILE: ndk-patches/bits-struct_file.h.patch ================================================ --- ./usr/include/bits/struct_file.h.orig 2019-06-10 09:40:35.872857650 +1000 +++ ./usr/include/bits/struct_file.h 2019-06-10 09:55:10.890308649 +1000 @@ -31,14 +31,79 @@ #include __BEGIN_DECLS +#if defined(__LP64__) +struct __sbuf { + unsigned char* _base; + size_t _size; +}; +#else +struct __sbuf { + unsigned char *_base; + int _size; +}; +#endif +#if defined(__LP64__) +typedef int64_t _struct_file_off_t; +#else +typedef __kernel_off_t _struct_file_off_t; +#endif + /** The opaque structure implementing `FILE`. Do not make any assumptions about its content. */ struct __sFILE { + unsigned char *_p; /* current position in (some) buffer */ + int _r; /* read space left for getc() */ + int _w; /* write space left for putc() */ #if defined(__LP64__) - char __private[152]; + int _flags; /* flags, below; this FILE is free if 0 */ + int _file; /* fileno, if Unix descriptor, else -1 */ #else - char __private[84]; + short _flags; /* flags, below; this FILE is free if 0 */ + short _file; /* fileno, if Unix descriptor, else -1 */ #endif -} __attribute__((aligned(sizeof(void*)))); + struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ + int _lbfsize; /* 0 or -_bf._size, for inline putc */ + + /* operations */ + void *_cookie; /* cookie passed to io functions */ + int (*_close)(void *); + int (*_read)(void *, char *, int); + _struct_file_off_t (*_seek)(void *, _struct_file_off_t, int); + int (*_write)(void *, const char *, int); + + /* extension data, to avoid further ABI breakage */ + struct __sbuf _ext; + /* data for long sequences of ungetc() */ + unsigned char *_up; /* saved _p when _p is doing ungetc data */ + int _ur; /* saved _r when _r is counting ungetc data */ + + /* tricks to meet minimum requirements even when malloc() fails */ + unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */ + unsigned char _nbuf[1]; /* guarantee a getc() buffer */ + + /* separate buffer for fgetln() when line crosses buffer boundary */ + struct __sbuf _lb; /* buffer for fgetln() */ + + /* Unix stdio files get aligned to block boundaries on fseek() */ + int _blksize; /* stat.st_blksize (may be != _bf._size) */ + _struct_file_off_t _offset; /* current lseek offset */ +}; +#define __SLBF 0x0001 /* line buffered */ +#define __SNBF 0x0002 /* unbuffered */ +#define __SRD 0x0004 /* OK to read */ +#define __SWR 0x0008 /* OK to write */ + /* RD and WR are never simultaneously asserted */ +#define __SRW 0x0010 /* open for reading & writing */ +#define __SEOF 0x0020 /* found EOF */ +#define __SERR 0x0040 /* found error */ +#define __SMBF 0x0080 /* _buf is from malloc */ +#define __SAPP 0x0100 /* fdopen()ed in append mode */ +#define __SSTR 0x0200 /* this is an sprintf/snprintf string */ +#define __SOPT 0x0400 /* do fseek() optimization */ +#define __SNPT 0x0800 /* do not do fseek() optimization */ +#define __SOFF 0x1000 /* set iff _offset is in fact correct */ +#define __SMOD 0x2000 /* true => fgetln modified _p text */ +#define __SALC 0x4000 /* allocate string space dynamically */ +#define __SIGN 0x8000 /* ignore this file in _fwalk */ __END_DECLS ================================================ FILE: ndk-patches/grp.h.patch ================================================ diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/grp.h ./usr/include/grp.h --- /home/fornwall/lib/android-ndk/sysroot/usr/include/grp.h 2017-11-09 09:57:12.000000000 +0100 +++ ./usr/include/grp.h 2017-11-15 11:43:43.065533963 +0100 @@ -52,18 +52,11 @@ /* Note: Android has thousands and thousands of ids to iterate through. */ -#if __ANDROID_API__ >= 26 -struct group* getgrent(void) __INTRODUCED_IN(26); - -void setgrent(void) __INTRODUCED_IN(26); -void endgrent(void) __INTRODUCED_IN(26); -#endif /* __ANDROID_API__ >= 26 */ - - -#if __ANDROID_API__ >= 24 -int getgrgid_r(gid_t __gid, struct group* __group, char* __buf, size_t __n, struct group** __result) __INTRODUCED_IN(24); -int getgrnam_r(const char* __name, struct group* __group, char* __buf, size_t __n, struct group** __result) __INTRODUCED_IN(24); -#endif /* __ANDROID_API__ >= 24 */ +static struct group* getgrent(void) { return 0; } +static void setgrent(void) {} +static void endgrent(void) {} +static int getgrgid_r(gid_t gid, struct group * grp, char * buf, size_t buflen, struct group ** result) { *result = 0; return 0; } +static int getgrnam_r(const char * name, struct group * grp, char * buf, size_t buflen, struct group ** result) { *result = 0; return 0; } int getgrouplist(const char* __user, gid_t __group, gid_t* __groups, int* __group_count); int initgroups(const char* __user, gid_t __group); ================================================ FILE: ndk-patches/ifaddrs.h ================================================ /* * Copyright (c) 1995, 1999 * Berkeley Software Design, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp */ /* Copyright (c) 2013, Kenneth MacKay All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _IFADDRS_H_ #define _IFADDRS_H_ struct ifaddrs { struct ifaddrs *ifa_next; char *ifa_name; unsigned int ifa_flags; struct sockaddr *ifa_addr; struct sockaddr *ifa_netmask; struct sockaddr *ifa_dstaddr; void *ifa_data; }; /* * This may have been defined in . Note that if is * to be included it must be included before this header file. */ #ifndef ifa_broadaddr #define ifa_broadaddr ifa_dstaddr /* broadcast address interface */ #endif #include __BEGIN_DECLS static int getifaddrs(struct ifaddrs **ifap); static void freeifaddrs(struct ifaddrs *ifa); __END_DECLS #include #include #include #include #include #include #include #include #include #include #include typedef struct NetlinkList { struct NetlinkList *m_next; struct nlmsghdr *m_data; unsigned int m_size; } NetlinkList; static int netlink_socket(void) { int l_socket = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (l_socket < 0) return -1; struct sockaddr_nl l_addr; memset(&l_addr, 0, sizeof(l_addr)); l_addr.nl_family = AF_NETLINK; if(bind(l_socket, (struct sockaddr *)&l_addr, sizeof(l_addr)) < 0) { close(l_socket); return -1; } return l_socket; } static int netlink_send(int p_socket, int p_request) { struct { struct nlmsghdr m_hdr; struct rtgenmsg m_msg; } l_data; memset(&l_data, 0, sizeof(l_data)); l_data.m_hdr.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtgenmsg)); l_data.m_hdr.nlmsg_type = p_request; l_data.m_hdr.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST; l_data.m_hdr.nlmsg_pid = 0; l_data.m_hdr.nlmsg_seq = p_socket; l_data.m_msg.rtgen_family = AF_UNSPEC; struct sockaddr_nl l_addr; memset(&l_addr, 0, sizeof(l_addr)); l_addr.nl_family = AF_NETLINK; return (sendto(p_socket, &l_data.m_hdr, l_data.m_hdr.nlmsg_len, 0, (struct sockaddr *)&l_addr, sizeof(l_addr))); } static int netlink_recv(int p_socket, void *p_buffer, size_t p_len) { struct msghdr l_msg; struct iovec l_iov = { p_buffer, p_len }; struct sockaddr_nl l_addr; for (;;) { l_msg.msg_name = (void *)&l_addr; l_msg.msg_namelen = sizeof(l_addr); l_msg.msg_iov = &l_iov; l_msg.msg_iovlen = 1; l_msg.msg_control = NULL; l_msg.msg_controllen = 0; l_msg.msg_flags = 0; int l_result = recvmsg(p_socket, &l_msg, 0); if (l_result < 0) { if (errno == EINTR) { continue; } return -2; } if (l_msg.msg_flags & MSG_TRUNC) { /* Buffer was too small. */ return -1; } return l_result; } } static struct nlmsghdr *getNetlinkResponse(int p_socket, int *p_size, int *p_done) { size_t l_size = 4096; void *l_buffer = NULL; for(;;) { free(l_buffer); l_buffer = malloc(l_size); if (l_buffer == NULL) return NULL; int l_read = netlink_recv(p_socket, l_buffer, l_size); *p_size = l_read; if (l_read == -2) { free(l_buffer); return NULL; } if (l_read >= 0) { pid_t l_pid = getpid(); struct nlmsghdr *l_hdr; for(l_hdr = (struct nlmsghdr *)l_buffer; NLMSG_OK(l_hdr, (unsigned int)l_read); l_hdr = (struct nlmsghdr *)NLMSG_NEXT(l_hdr, l_read)) { if((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket) continue; if(l_hdr->nlmsg_type == NLMSG_DONE) { *p_done = 1; break; } if(l_hdr->nlmsg_type == NLMSG_ERROR) { free(l_buffer); return NULL; } } return (struct nlmsghdr*)l_buffer; } l_size *= 2; } } static NetlinkList *newListItem(struct nlmsghdr *p_data, unsigned int p_size) { NetlinkList *l_item = (NetlinkList*)malloc(sizeof(NetlinkList)); if (l_item == NULL) return NULL; l_item->m_next = NULL; l_item->m_data = p_data; l_item->m_size = p_size; return l_item; } static void freeResultList(NetlinkList *p_list) { NetlinkList *l_cur; while (p_list) { l_cur = p_list; p_list = p_list->m_next; free(l_cur->m_data); free(l_cur); } } static NetlinkList *getResultList(int p_socket, int p_request) { if (netlink_send(p_socket, p_request) < 0) return NULL; NetlinkList *l_list = NULL; NetlinkList *l_end = NULL; int l_size; int l_done = 0; while (!l_done) { struct nlmsghdr *l_hdr = getNetlinkResponse(p_socket, &l_size, &l_done); if (!l_hdr) { freeResultList(l_list); return NULL; } NetlinkList *l_item = newListItem(l_hdr, l_size); if (!l_item) { freeResultList(l_list); return NULL; } if (!l_list) { l_list = l_item; } else { l_end->m_next = l_item; } l_end = l_item; } return l_list; } static size_t maxSize(size_t a, size_t b) { return (a > b ? a : b); } static size_t calcAddrLen(sa_family_t p_family, int p_dataSize) { switch (p_family) { case AF_INET: return sizeof(struct sockaddr_in); case AF_INET6: return sizeof(struct sockaddr_in6); case AF_PACKET: return maxSize(sizeof(struct sockaddr_ll), offsetof(struct sockaddr_ll, sll_addr) + p_dataSize); default: return maxSize(sizeof(struct sockaddr), offsetof(struct sockaddr, sa_data) + p_dataSize); } } static void makeSockaddr(sa_family_t p_family, struct sockaddr *p_dest, void *p_data, size_t p_size) { switch (p_family) { case AF_INET: memcpy(&((struct sockaddr_in*)p_dest)->sin_addr, p_data, p_size); break; case AF_INET6: memcpy(&((struct sockaddr_in6*)p_dest)->sin6_addr, p_data, p_size); break; case AF_PACKET: memcpy(((struct sockaddr_ll*)p_dest)->sll_addr, p_data, p_size); ((struct sockaddr_ll*)p_dest)->sll_halen = p_size; break; default: memcpy(p_dest->sa_data, p_data, p_size); break; } p_dest->sa_family = p_family; } static void addToEnd(struct ifaddrs **p_resultList, struct ifaddrs *p_entry) { if (!*p_resultList) { *p_resultList = p_entry; } else { struct ifaddrs *l_cur = *p_resultList; while(l_cur->ifa_next) { l_cur = l_cur->ifa_next; } l_cur->ifa_next = p_entry; } } static int interpretLink(struct nlmsghdr *p_hdr, struct ifaddrs **p_resultList) { struct ifinfomsg *l_info = (struct ifinfomsg *)NLMSG_DATA(p_hdr); size_t l_nameSize = 0; size_t l_addrSize = 0; size_t l_dataSize = 0; size_t l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifinfomsg)); struct rtattr *l_rta; for (l_rta = IFLA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize)) { void *l_rtaData = RTA_DATA(l_rta); size_t l_rtaDataSize = RTA_PAYLOAD(l_rta); switch (l_rta->rta_type) { case IFLA_ADDRESS: case IFLA_BROADCAST: l_addrSize += NLMSG_ALIGN(calcAddrLen(AF_PACKET, l_rtaDataSize)); break; case IFLA_IFNAME: l_nameSize += NLMSG_ALIGN(l_rtaSize + 1); break; case IFLA_STATS: l_dataSize += NLMSG_ALIGN(l_rtaSize); break; default: break; } } struct ifaddrs *l_entry = (struct ifaddrs*)malloc(sizeof(struct ifaddrs) + sizeof(int) + l_nameSize + l_addrSize + l_dataSize); if (l_entry == NULL) return -1; memset(l_entry, 0, sizeof(struct ifaddrs)); l_entry->ifa_name = (char*)""; char *l_index = ((char *)l_entry) + sizeof(struct ifaddrs); char *l_name = l_index + sizeof(int); char *l_addr = l_name + l_nameSize; char *l_data = l_addr + l_addrSize; /* Save the interface index so we can look it up when handling the addresses. */ memcpy(l_index, &l_info->ifi_index, sizeof(int)); l_entry->ifa_flags = l_info->ifi_flags; l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifinfomsg)); for (l_rta = IFLA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize)) { void *l_rtaData = RTA_DATA(l_rta); size_t l_rtaDataSize = RTA_PAYLOAD(l_rta); switch (l_rta->rta_type) { case IFLA_ADDRESS: case IFLA_BROADCAST: { size_t l_addrLen = calcAddrLen(AF_PACKET, l_rtaDataSize); makeSockaddr(AF_PACKET, (struct sockaddr *)l_addr, l_rtaData, l_rtaDataSize); ((struct sockaddr_ll *)l_addr)->sll_ifindex = l_info->ifi_index; ((struct sockaddr_ll *)l_addr)->sll_hatype = l_info->ifi_type; if (l_rta->rta_type == IFLA_ADDRESS) { l_entry->ifa_addr = (struct sockaddr *)l_addr; } else { l_entry->ifa_broadaddr = (struct sockaddr *)l_addr; } l_addr += NLMSG_ALIGN(l_addrLen); break; } case IFLA_IFNAME: strncpy(l_name, (char*)l_rtaData, l_rtaDataSize); l_name[l_rtaDataSize] = '\0'; l_entry->ifa_name = l_name; break; case IFLA_STATS: memcpy(l_data, l_rtaData, l_rtaDataSize); l_entry->ifa_data = l_data; break; default: break; } } addToEnd(p_resultList, l_entry); return 0; } static struct ifaddrs *findInterface(int p_index, struct ifaddrs **p_links, int p_numLinks) { int l_num = 0; struct ifaddrs *l_cur = *p_links; while (l_cur && l_num < p_numLinks) { char *l_indexPtr = ((char *)l_cur) + sizeof(struct ifaddrs); int l_index; memcpy(&l_index, l_indexPtr, sizeof(int)); if(l_index == p_index) return l_cur; l_cur = l_cur->ifa_next; ++l_num; } return NULL; } static int interpretAddr(struct nlmsghdr *p_hdr, struct ifaddrs **p_resultList, int p_numLinks) { struct ifaddrmsg *l_info = (struct ifaddrmsg *)NLMSG_DATA(p_hdr); struct ifaddrs *l_interface = findInterface(l_info->ifa_index, p_resultList, p_numLinks); if (l_info->ifa_family == AF_PACKET) return 0; size_t l_nameSize = 0; size_t l_addrSize = 0; int l_addedNetmask = 0; size_t l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifaddrmsg)); struct rtattr *l_rta; for (l_rta = IFA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize)) { void *l_rtaData = RTA_DATA(l_rta); size_t l_rtaDataSize = RTA_PAYLOAD(l_rta); switch (l_rta->rta_type) { case IFA_ADDRESS: case IFA_LOCAL: if ((l_info->ifa_family == AF_INET || l_info->ifa_family == AF_INET6) && !l_addedNetmask) { /* Make room for netmask. */ l_addrSize += NLMSG_ALIGN(calcAddrLen(l_info->ifa_family, l_rtaDataSize)); l_addedNetmask = 1; } case IFA_BROADCAST: l_addrSize += NLMSG_ALIGN(calcAddrLen(l_info->ifa_family, l_rtaDataSize)); break; case IFA_LABEL: l_nameSize += NLMSG_ALIGN(l_rtaSize + 1); break; default: break; } } struct ifaddrs *l_entry = (struct ifaddrs*)malloc(sizeof(struct ifaddrs) + l_nameSize + l_addrSize); if (l_entry == NULL) return -1; memset(l_entry, 0, sizeof(struct ifaddrs)); l_entry->ifa_name = (l_interface ? l_interface->ifa_name : (char*)""); char *l_name = ((char *)l_entry) + sizeof(struct ifaddrs); char *l_addr = l_name + l_nameSize; l_entry->ifa_flags = l_info->ifa_flags; if (l_interface) { l_entry->ifa_flags |= l_interface->ifa_flags; } l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifaddrmsg)); for (l_rta = IFA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize)) { void *l_rtaData = RTA_DATA(l_rta); size_t l_rtaDataSize = RTA_PAYLOAD(l_rta); switch (l_rta->rta_type) { case IFA_ADDRESS: case IFA_BROADCAST: case IFA_LOCAL: { size_t l_addrLen = calcAddrLen(l_info->ifa_family, l_rtaDataSize); makeSockaddr(l_info->ifa_family, (struct sockaddr *)l_addr, l_rtaData, l_rtaDataSize); if (l_info->ifa_family == AF_INET6) { if (IN6_IS_ADDR_LINKLOCAL((struct in6_addr *)l_rtaData) || IN6_IS_ADDR_MC_LINKLOCAL((struct in6_addr *)l_rtaData)) { ((struct sockaddr_in6 *)l_addr)->sin6_scope_id = l_info->ifa_index; } } if (l_rta->rta_type == IFA_ADDRESS) { /* Apparently in a point-to-point network IFA_ADDRESS contains the dest address and IFA_LOCAL contains the local address. */ if(l_entry->ifa_addr) { l_entry->ifa_dstaddr = (struct sockaddr *)l_addr; } else { l_entry->ifa_addr = (struct sockaddr *)l_addr; } } else if (l_rta->rta_type == IFA_LOCAL) { if(l_entry->ifa_addr) { l_entry->ifa_dstaddr = l_entry->ifa_addr; } l_entry->ifa_addr = (struct sockaddr *)l_addr; } else { l_entry->ifa_broadaddr = (struct sockaddr *)l_addr; } l_addr += NLMSG_ALIGN(l_addrLen); break; } case IFA_LABEL: strncpy(l_name, (char*)l_rtaData, l_rtaDataSize); l_name[l_rtaDataSize] = '\0'; l_entry->ifa_name = l_name; break; default: break; } } if (l_entry->ifa_addr && (l_entry->ifa_addr->sa_family == AF_INET || l_entry->ifa_addr->sa_family == AF_INET6)) { unsigned l_maxPrefix = (l_entry->ifa_addr->sa_family == AF_INET ? 32 : 128); unsigned l_prefix = (l_info->ifa_prefixlen > l_maxPrefix ? l_maxPrefix : l_info->ifa_prefixlen); char l_mask[16] = {0}; unsigned i; for (i=0; i<(l_prefix/8); ++i) { l_mask[i] = 0xff; } if (l_prefix % 8) { l_mask[i] = 0xff << (8 - (l_prefix % 8)); } makeSockaddr(l_entry->ifa_addr->sa_family, (struct sockaddr *)l_addr, l_mask, l_maxPrefix / 8); l_entry->ifa_netmask = (struct sockaddr *)l_addr; } addToEnd(p_resultList, l_entry); return 0; } static int interpretLinks(int p_socket, NetlinkList *p_netlinkList, struct ifaddrs **p_resultList) { int l_numLinks = 0; pid_t l_pid = getpid(); for(; p_netlinkList; p_netlinkList = p_netlinkList->m_next) { unsigned int l_nlsize = p_netlinkList->m_size; struct nlmsghdr *l_hdr; for(l_hdr = p_netlinkList->m_data; NLMSG_OK(l_hdr, l_nlsize); l_hdr = NLMSG_NEXT(l_hdr, l_nlsize)) { if ((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket) continue; if (l_hdr->nlmsg_type == NLMSG_DONE) break; if (l_hdr->nlmsg_type == RTM_NEWLINK) { if(interpretLink(l_hdr, p_resultList) == -1) return -1; ++l_numLinks; } } } return l_numLinks; } static int interpretAddrs(int p_socket, NetlinkList *p_netlinkList, struct ifaddrs **p_resultList, int p_numLinks) { pid_t l_pid = getpid(); for (; p_netlinkList; p_netlinkList = p_netlinkList->m_next) { unsigned int l_nlsize = p_netlinkList->m_size; struct nlmsghdr *l_hdr; for (l_hdr = p_netlinkList->m_data; NLMSG_OK(l_hdr, l_nlsize); l_hdr = NLMSG_NEXT(l_hdr, l_nlsize)) { if ((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket) continue; if (l_hdr->nlmsg_type == NLMSG_DONE) break; if (l_hdr->nlmsg_type == RTM_NEWADDR) { if (interpretAddr(l_hdr, p_resultList, p_numLinks) == -1) return -1; } } } return 0; } static int getifaddrs(struct ifaddrs **ifap) { if (!ifap) return -1; *ifap = NULL; int l_socket = netlink_socket(); if (l_socket < 0) { return -1; } NetlinkList *l_linkResults = getResultList(l_socket, RTM_GETLINK); if (!l_linkResults) { close(l_socket); return -1; } NetlinkList *l_addrResults = getResultList(l_socket, RTM_GETADDR); if (!l_addrResults) { close(l_socket); freeResultList(l_linkResults); return -1; } int l_result = 0; int l_numLinks = interpretLinks(l_socket, l_linkResults, ifap); if (l_numLinks == -1 || interpretAddrs(l_socket, l_addrResults, ifap, l_numLinks) == -1) { l_result = -1; } freeResultList(l_linkResults); freeResultList(l_addrResults); close(l_socket); return l_result; } static void freeifaddrs(struct ifaddrs *ifa) { struct ifaddrs *l_cur; while (ifa) { l_cur = ifa; ifa = ifa->ifa_next; free(l_cur); } } #endif ================================================ FILE: ndk-patches/langinfo.h ================================================ /* * Copyright (C) 2013 The Android Open Source Project * Copyright (C) 2016 The Android Open Source Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef _LANGINFO_H #define _LANGINFO_H // __LP64__ #include #include #include #define _NL_ITEM(category,index) (((category) << 10) | (index)) #define _NL_ITEM_CATEGORY(nl) ((nl) >> 10) #define _NL_ITEM_INDEX(nl) ((nl) & 0x3ff) #define CODESET 1 #define D_T_FMT 2 #define D_FMT 3 #define T_FMT 4 #define T_FMT_AMPM 5 #define AM_STR 6 #define PM_STR 7 #define DAY_1 8 #define DAY_2 9 #define DAY_3 10 #define DAY_4 11 #define DAY_5 12 #define DAY_6 13 #define DAY_7 14 #define ABDAY_1 15 #define ABDAY_2 16 #define ABDAY_3 17 #define ABDAY_4 18 #define ABDAY_5 19 #define ABDAY_6 20 #define ABDAY_7 21 #define MON_1 22 #define MON_2 23 #define MON_3 24 #define MON_4 25 #define MON_5 26 #define MON_6 27 #define MON_7 28 #define MON_8 29 #define MON_9 30 #define MON_10 31 #define MON_11 32 #define MON_12 33 #define ABMON_1 34 #define ABMON_2 35 #define ABMON_3 36 #define ABMON_4 37 #define ABMON_5 38 #define ABMON_6 39 #define ABMON_7 40 #define ABMON_8 41 #define ABMON_9 42 #define ABMON_10 43 #define ABMON_11 44 #define ABMON_12 45 #define ERA 46 #define ERA_D_FMT 47 #define ERA_D_T_FMT 48 #define ERA_T_FMT 49 #define ALT_DIGITS 50 #define RADIXCHAR 51 #define THOUSEP 52 #define YESEXPR 53 #define NOEXPR 54 #define CRNCYSTR 55 #define INT_CURRENCY_SYMBOL 55 #ifdef __cplusplus extern "C" { #endif static char *nl_langinfo_l(nl_item item, locale_t loc) { static const char c_time[] = "Sun\0" "Mon\0" "Tue\0" "Wed\0" "Thu\0" "Fri\0" "Sat\0" "Sunday\0" "Monday\0" "Tuesday\0" "Wednesday\0" "Thursday\0" "Friday\0" "Saturday\0" "Jan\0" "Feb\0" "Mar\0" "Apr\0" "May\0" "Jun\0" "Jul\0" "Aug\0" "Sep\0" "Oct\0" "Nov\0" "Dec\0" "January\0" "February\0" "March\0" "April\0" "May\0" "June\0" "July\0" "August\0" "September\0" "October\0" "November\0" "December\0" "AM\0" "PM\0" "%a %b %e %T %Y\0" "%m/%d/%y\0" "%H:%M:%S\0" "%I:%M:%S %p\0" "\0" "%m/%d/%y\0" "0123456789" "%a %b %e %T %Y\0" "%H:%M:%S"; static const char c_messages[] = "^[yY]\0" "^[nN]"; static const char c_numeric[] = ".\0" ""; static const char c_zero[] = "UTF-8\0" "UTF-8\0" "%F %T %z\0" "%F\0" "%T\0" "%I:%M:%S %p\0" "AM\0" "PM\0" "Sunday\0" "Monday\0" "Tuesday\0" "Wednesday\0" "Thursday\0" "Friday\0" "Saturday\0" "Sun\0" "Mon\0" "Tue\0" "Wed\0" "Thu\0" "Fri\0" "Sat\0" "January\0" "February\0" "March\0" "April\0" "May\0" "June\0" "July\0" "August\0" "September\0" "October\0" "November\0" "December\0" "Jan\0" "Feb\0" "Mar\0" "Apr\0" "May\0" "Jun\0" "Jul\0" "Aug\0" "Sep\0" "Oct\0" "Nov\0" "Dec\0" "\0" "\0" "\0" "\0" "\0" ".\0" "\0" "^[yY]\0" "^[nN]\0" "\0"; int cat = item >> 16; int idx = item & 65535; const char *str; if (item == CODESET) return "UTF-8"; switch (cat) { case 0: if (idx > 55) return NULL; str = c_zero; break; case LC_NUMERIC: if (idx > 1) return NULL; str = c_numeric; break; case LC_TIME: if (idx > 0x31) return NULL; str = c_time; break; case LC_MONETARY: if (idx > 0) return NULL; str = ""; break; case LC_MESSAGES: if (idx > 1) return NULL; str = c_messages; break; default: return NULL; } for (; idx; idx--, str++) for (; *str; str++); return (char *)str; } static char *nl_langinfo(nl_item item) { return nl_langinfo_l(item, 0); } #ifdef __cplusplus } // extern "C" #endif #endif /* _LANGINFO_H */ ================================================ FILE: ndk-patches/langinfo.h.patch ================================================ diff -N -a -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/langinfo.h ./usr/include/langinfo.h --- /home/fornwall/lib/android-ndk/sysroot/usr/include/langinfo.h 2017-11-09 09:57:12.000000000 +0100 +++ ./usr/include/langinfo.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _LANGINFO_H_ -#define _LANGINFO_H_ - -#include - -#include -#include - -__BEGIN_DECLS - -#define CODESET 1 -#define D_T_FMT 2 -#define D_FMT 3 -#define T_FMT 4 -#define T_FMT_AMPM 5 -#define AM_STR 6 -#define PM_STR 7 -#define DAY_1 8 -#define DAY_2 9 -#define DAY_3 10 -#define DAY_4 11 -#define DAY_5 12 -#define DAY_6 13 -#define DAY_7 14 -#define ABDAY_1 15 -#define ABDAY_2 16 -#define ABDAY_3 17 -#define ABDAY_4 18 -#define ABDAY_5 19 -#define ABDAY_6 20 -#define ABDAY_7 21 -#define MON_1 22 -#define MON_2 23 -#define MON_3 24 -#define MON_4 25 -#define MON_5 26 -#define MON_6 27 -#define MON_7 28 -#define MON_8 29 -#define MON_9 30 -#define MON_10 31 -#define MON_11 32 -#define MON_12 33 -#define ABMON_1 34 -#define ABMON_2 35 -#define ABMON_3 36 -#define ABMON_4 37 -#define ABMON_5 38 -#define ABMON_6 39 -#define ABMON_7 40 -#define ABMON_8 41 -#define ABMON_9 42 -#define ABMON_10 43 -#define ABMON_11 44 -#define ABMON_12 45 -#define ERA 46 -#define ERA_D_FMT 47 -#define ERA_D_T_FMT 48 -#define ERA_T_FMT 49 -#define ALT_DIGITS 50 -#define RADIXCHAR 51 -#define THOUSEP 52 -#define YESEXPR 53 -#define NOEXPR 54 -#define CRNCYSTR 55 - - -#if __ANDROID_API__ >= 26 -char* nl_langinfo(nl_item __item) __INTRODUCED_IN(26); -char* nl_langinfo_l(nl_item __item, locale_t __l) __INTRODUCED_IN(26); -#endif /* __ANDROID_API__ >= 26 */ - - -__END_DECLS - -#endif ================================================ FILE: ndk-patches/libintl.h ================================================ #ifndef _LIBINTL_H #define _LIBINTL_H #include #include static __inline__ char* gettext(const char* msgid) { return (char*) msgid; } static __inline__ char* dgettext(const char* domainname, const char* msgid) { return (char*) msgid; } static __inline__ char* dcgettext(const char* domainname, const char* msgid, int category) { return (char*) msgid; } static __inline__ char* ngettext(const char* msgid1, const char* msgid2, unsigned long int n) { return (char *) ((n == 1) ? msgid1 : msgid2); } static __inline__ char* dngettext(const char* domainname, const char* msgid1, const char* msgid2, unsigned long int n) { return (char *) ((n == 1) ? msgid1 : msgid2); } static __inline__ char* dcngettext(const char* domainname, const char* msgid1, const char* msgid2, unsigned long int n, int category) { return (char *) ((n == 1) ? msgid1 : msgid2); } static __inline__ char* textdomain(const char* domainname) { static const char default_str[] = "messages"; if (domainname && *domainname && strcmp(domainname, default_str)) { errno = EINVAL; return NULL; } return (char*) default_str; } static __inline__ char* bindtextdomain(const char* domainname, const char* dirname) { static const char dir[] = "/"; if (!domainname || !*domainname || (dirname && ((dirname[0] != '/') || dirname[1]))) { errno = EINVAL; return NULL; } return (char*) dir; } static __inline__ char* bind_textdomain_codeset(const char* domainname, const char* codeset) { if (!domainname || !*domainname || (codeset && strcasecmp(codeset, "UTF-8"))) { errno = EINVAL; } return NULL; } #endif ================================================ FILE: ndk-patches/linux-fcntl.h.patch ================================================ diff -uNr sysroot.orig/usr/include/linux/fcntl.h sysroot/usr/include/linux/fcntl.h --- sysroot.orig/usr/include/linux/fcntl.h 2019-02-12 16:12:24.000000000 +0000 +++ sysroot/usr/include/linux/fcntl.h 2019-03-20 13:22:32.823142545 +0000 @@ -50,6 +50,12 @@ #define DN_ATTRIB 0x00000020 #define DN_MULTISHOT 0x80000000 #define AT_FDCWD - 100 +/* Termux patch: This flag is not supported on Android 6.0+, and should not + be needed since there are not setuid binaries. Define AT_EACCESS to 0 to + avoid packages defining their own AT_EACCESS (which e.g. coreutil does) + since that will only result in errors. See: + https://android.googlesource.com/platform/bionic/+/3577825%5E!/ */ +#define AT_EACCESS 0 #define AT_SYMLINK_NOFOLLOW 0x100 #define AT_REMOVEDIR 0x200 #define AT_SYMLINK_FOLLOW 0x400 ================================================ FILE: ndk-patches/paths.h.patch ================================================ --- ./usr/include/paths.h.orig 2019-06-10 00:10:55.544212642 +0000 +++ ./usr/include/paths.h 2019-06-10 00:16:51.514412646 +0000 @@ -38,16 +38,14 @@ #include -#ifndef _PATH_BSHELL /** Path to the default system shell. Historically the 'B' was to specify the Bourne shell. */ -#define _PATH_BSHELL "/system/bin/sh" -#endif +#define _PATH_BSHELL "@TERMUX_PREFIX@/bin/sh" /** Path to the system console. */ #define _PATH_CONSOLE "/dev/console" /** Default shell search path. */ -#define _PATH_DEFPATH "/sbin:/system/sbin:/product/bin:/apex/com.android.runtime/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin" +#define _PATH_DEFPATH "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets" /** Path to the directory containing device files. */ #define _PATH_DEV "/dev/" @@ -63,3 +61,9 @@ /** Path to the calling process' tty. */ #define _PATH_TTY "/dev/tty" +#define _PATH_STDPATH _PATH_DEFPATH +#define _PATH_TMP "@TERMUX_PREFIX@/tmp/" +#define _PATH_VARDB "@TERMUX_PREFIX@/var/db/" +#define _PATH_VARRUN "@TERMUX_PREFIX@/var/run/" +#define _PATH_VARTMP "@TERMUX_PREFIX@/var/tmp/" + ================================================ FILE: ndk-patches/pwd.h.patch ================================================ diff -uNr sysroot.orig/usr/include/pwd.h sysroot/usr/include/pwd.h --- sysroot.orig/usr/include/pwd.h 2019-02-12 16:12:24.000000000 +0000 +++ sysroot/usr/include/pwd.h 2019-03-20 13:26:24.283060011 +0000 @@ -89,13 +89,58 @@ struct passwd* getpwent(void) __INTRODUCED_IN(26); void setpwent(void) __INTRODUCED_IN(26); -void endpwent(void) __INTRODUCED_IN(26); #endif /* __ANDROID_API__ >= 26 */ int getpwnam_r(const char* __name, struct passwd* __pwd, char* __buf, size_t __n, struct passwd** __result) __INTRODUCED_IN(12); int getpwuid_r(uid_t __uid, struct passwd* __pwd, char* __buf, size_t __n, struct passwd** __result) __INTRODUCED_IN(12); +int access(const char* __path, int __mode); + +static void android_setup_pwd(struct passwd* pw) { + char const* result = "@TERMUX_PREFIX@/bin/login"; + if (result == NULL || access(result, /*X_OK*/1) == -1) { + pw->pw_shell = "@TERMUX_PREFIX@/bin/bash"; + } else { + pw->pw_shell = (char*) result; + } + pw->pw_dir = "@TERMUX_HOME@"; + pw->pw_passwd = "*"; +#ifdef __LP64__ + pw->pw_gecos = ""; /* Avoid NULL field. */ +#endif +} + +static struct passwd* android_polyfill_getpwuid(uid_t t) { + struct passwd* pw = getpwuid(t); + if (pw == NULL) return NULL; + android_setup_pwd(pw); + return pw; +} + +static struct passwd* android_polyfill_getpwnam(const char* name) { + struct passwd* pw = getpwnam(name); + if (pw == NULL) return NULL; + android_setup_pwd(pw); + return pw; +} + +static int android_polyfill_getpwuid_r(uid_t uid, + struct passwd *pwd, + char *buffer, + size_t bufsize, + struct passwd **result) { + int ret = getpwuid_r(uid, pwd, buffer, bufsize, result); + if (ret != 0) return ret; + android_setup_pwd(pwd); + return 0; +} + +#define getpwnam android_polyfill_getpwnam +#define getpwuid android_polyfill_getpwuid +#define getpwuid_r android_polyfill_getpwuid_r +static void endpwent(void) { /* Do nothing. */ } + __END_DECLS #endif ================================================ FILE: ndk-patches/stdio.h.patch ================================================ diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/stdio.h ./usr/include/stdio.h --- /home/fornwall/lib/android-ndk/sysroot/usr/include/stdio.h 2017-11-09 09:57:12.000000000 +0100 +++ ./usr/include/stdio.h 2017-11-15 11:57:58.567432093 +0100 @@ -44,11 +44,12 @@ #include #include +#include /* For strcpy(3) used by ctermid() */ +#include /* For O_RDWR and other O_* constants */ + #include -#if __ANDROID_API__ < __ANDROID_API_N__ #include -#endif __BEGIN_DECLS @@ -165,7 +166,7 @@ __printflike(2, 0) __warnattr_strict("vsprintf is often misused; please use vsnprintf"); char* tmpnam(char* __s) __warnattr("tempnam is unsafe, use mkstemp or tmpfile instead"); -#define P_tmpdir "/tmp/" /* deprecated */ +#define P_tmpdir "@TERMUX_PREFIX@/tmp/" /* deprecated */ char* tempnam(const char* __dir, const char* __prefix) __warnattr("tempnam is unsafe, use mkstemp or tmpfile instead"); @@ -241,8 +242,6 @@ FILE* freopen64(const char* __path, const char* __mode, FILE* __fp) __INTRODUCED_IN(24); #endif /* __ANDROID_API__ >= 24 */ -FILE* tmpfile(void); - #if __ANDROID_API__ >= 24 FILE* tmpfile64(void) __INTRODUCED_IN(24); #endif /* __ANDROID_API__ >= 24 */ @@ -256,10 +255,15 @@ #define L_ctermid 1024 /* size for ctermid() */ -#if __ANDROID_API__ >= 26 -char* ctermid(char* __buf) __INTRODUCED_IN(26); -#endif /* __ANDROID_API__ >= 26 */ +/* Needed by gnulibs freading(). */ +#define __sferror(p) (((p)->_flags & __SERR) != 0) +/* Used by perl, fish, and others. */ +static __inline__ char* ctermid(char* s) { + if (s == 0) return (char*) "/dev/tty"; + strcpy(s, "/dev/tty"); + return s; +} FILE* fdopen(int __fd, const char* __mode); int fileno(FILE* __fp); @@ -328,6 +332,29 @@ #include #endif +int open(const char*, int, ...); +extern pid_t getpid(); +extern int unlink(const char*); +void free(void* p); +uint32_t arc4random(void); +static __inline__ FILE* tmpfile() { + int p = getpid(); + char* path; + int i; + for (i = 0; i < 100; i++) { + unsigned int r = arc4random(); + if (asprintf(&path, "@TERMUX_PREFIX@/tmp/tmpfile.%d-%u", p, r) == -1) return NULL; + int fd = open(path, O_RDWR | O_CREAT | O_EXCL | O_LARGEFILE, 0600); + free(path); + if (fd >= 0) { + FILE* result = fdopen(fd, "w+"); + unlink(path); + return result; + } + } + return NULL; +} + __END_DECLS #endif ================================================ FILE: ndk-patches/stdlib.h.patch ================================================ diff -uNr sysroot.orig/usr/include/stdlib.h sysroot/usr/include/stdlib.h --- sysroot.orig/usr/include/stdlib.h 2019-02-12 16:12:24.000000000 +0000 +++ sysroot/usr/include/stdlib.h 2019-03-20 13:23:48.870108924 +0000 @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -211,8 +212,7 @@ size_t wcstombs(char* __dst, const wchar_t* __src, size_t __n); #if __ANDROID_API__ >= __ANDROID_API_L__ -size_t __ctype_get_mb_cur_max(void) __INTRODUCED_IN(21); -#define MB_CUR_MAX __ctype_get_mb_cur_max() +#define MB_CUR_MAX 4 #else /* * Pre-L we didn't have any locale support and so we were always the POSIX ================================================ FILE: ndk-patches/sys-cdefs.h.patch ================================================ diff -uNr sysroot.orig/usr/include/sys/cdefs.h sysroot/usr/include/sys/cdefs.h --- sysroot.orig/usr/include/sys/cdefs.h 2019-02-12 16:12:24.000000000 +0000 +++ sysroot/usr/include/sys/cdefs.h 2019-03-20 13:27:29.977876824 +0000 @@ -206,7 +206,11 @@ * _FILE_OFFSET_BITS 64 support. * See https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md */ -#if !defined(__LP64__) && defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64 +/* Using _FILE_OFFSET_BITS=64 does not work well on Android + * and can cause problems when mixing libraries, which is why + * Termux hides away this unless TERMUX_EXPOSE_FILE_OFFSET64 + * is defined. */ +#if !defined(__LP64__) && defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64 && defined(TERMUX_EXPOSE_FILE_OFFSET64) # define __USE_FILE_OFFSET64 1 /* * Note that __RENAME_IF_FILE_OFFSET64 is only valid if the off_t and off64_t @@ -336,3 +340,6 @@ #include #include + +#define __TERMUX__ 1 +#define __TERMUX_PREFIX__ "@TERMUX_PREFIX@" ================================================ FILE: ndk-patches/sys-wait.h.patch ================================================ diff -uNr sysroot.orig/usr/include/sys/wait.h sysroot/usr/include/sys/wait.h --- sysroot.orig/usr/include/sys/wait.h 2019-02-12 16:12:24.000000000 +0000 +++ sysroot/usr/include/sys/wait.h 2019-03-20 13:28:06.689331544 +0000 @@ -46,6 +46,9 @@ // Implemented as a static inline before 18. #endif +/* Termux addition: Add wait3() declaration used by busybox. Available in libc for 32-bit only. */ +static pid_t wait3(int* status, int options, struct rusage* rusage) { return wait4(-1, status, options, rusage); } + /* Posix states that idtype_t should be an enumeration type, but * the kernel headers define P_ALL, P_PID and P_PGID as constant macros * instead. ================================================ FILE: ndk-patches/syslog.patch ================================================ diff -uNr sysroot.orig/usr/include/syslog.h sysroot/usr/include/syslog.h --- sysroot.orig/usr/include/syslog.h 2019-02-12 16:12:24.000000000 +0000 +++ sysroot/usr/include/syslog.h 2019-03-20 13:19:44.315965728 +0000 @@ -32,6 +32,8 @@ #include #include #include +#include /* for __android_log_vprint() */ +#include /* for getpid() */ __BEGIN_DECLS @@ -92,6 +94,64 @@ void syslog(int __priority, const char* __fmt, ...) __printflike(2, 3); void vsyslog(int __priority, const char* __fmt, va_list __args) __printflike(2, 0); +extern /*const*/ char* __progname; +static __inline__ void android_polyfill_openlog(const char* a, int b, int c) { + (void) a; + (void) b; + (void) c; +} +static __inline__ void android_polyfill_closelog() {} + +static __inline__ void android_polyfill_vsyslog(int syslog_priority, char const* format, va_list ap) +{ + android_LogPriority a = ANDROID_LOG_ERROR; + switch (syslog_priority) { + case LOG_WARNING: a = ANDROID_LOG_WARN; break; + case LOG_NOTICE : a = ANDROID_LOG_INFO; break; + case LOG_INFO: a = ANDROID_LOG_INFO; break; + case LOG_DEBUG: a = ANDROID_LOG_DEBUG; break; + } + char* syslog_text; + if (vasprintf(&syslog_text, format, ap) == -1) { + __android_log_vprint(a, "syslog", format, ap); + return; + } + __android_log_print(a, "syslog", "%s - %s", __progname, syslog_text); + free(syslog_text); +} + +static __inline__ void android_polyfill_syslog(int priority, const char* format, ...) +{ + va_list myargs; + va_start(myargs, format); + android_polyfill_vsyslog(priority, format, myargs); + va_end(myargs); +} + +static __inline__ void android_polyfill_syslog_r(int syslog_priority, void* d, const char* format, ...) +{ + (void) d; + va_list myargs; + va_start(myargs, format); + android_polyfill_vsyslog(syslog_priority, format, myargs); + va_end(myargs); +} + +static __inline__ void android_polyfill_vsyslog_r(int syslog_priority, void* d, const char* fmt, va_list ap) +{ + (void) d; + android_polyfill_vsyslog(syslog_priority, fmt, ap); +} + +#define openlog android_polyfill_openlog +#define closelog android_polyfill_closelog + +#define syslog android_polyfill_syslog +#define syslog_r android_polyfill_syslog_r + +#define vsyslog android_polyfill_vsyslog +#define vsyslog_r android_polyfill_vsyslog_r + __END_DECLS #endif /* _SYSLOG_H */ ================================================ FILE: ndk-patches/unistd.h.patch ================================================ --- sysroot/usr/include/unistd.h 2018-04-30 19:24:22.000000000 +0000 +++ usr/include/unistd.h 2018-08-16 10:42:51.158596753 +0000 @@ -302,6 +302,74 @@ #include #endif +#if !defined GETPASS_H && !defined getpass && !defined HAVE_GETPASS && !defined HAS_GETPASS && !defined NO_INLINE_GETPASS +#define GETPASS_H 1 +#define HAVE_GETPASS 1 +#define HAS_GETPASS 1 +#define PASSWORDLEN 512 + +static __inline__ char* getpass(const char* prompt) { + // termios struct as in asm-generic/termbits.h + struct _termios { + unsigned int c_iflag; /* input mode flags */ + unsigned int c_oflag; /* output mode flags */ + unsigned int c_cflag; /* control mode flags */ + unsigned int c_lflag; /* local mode flags */ + unsigned char c_line; /* line discipline */ + unsigned char c_cc[19/* NCCS */]; /* control characters */ + }; + + struct _termios term_old, term_new; + static char password[513] = { 0 }; /* 512 1-byte charactes and '0' */ + int len = 0, tty_changed = 0; + + // print prompt + while (*prompt) { + write(1, prompt, 1); + prompt++; + } + + // try to disable echoing on terminal + if (ioctl(0, 0x5401 /* TCGETS */, &term_old) == 0) { + term_new = term_old; + term_new.c_lflag &= ~0000010;/* ~ECHO */ + + if (ioctl(0, 0x5402+0 /* TCSETS+TCSANOW */, &term_new) == 0) { + tty_changed = 1; + } else { + tty_changed = 0; + } + } + + // read password + char chr; + while (read(0, &chr, sizeof(char)) > 0) { + if (chr == '\r' || chr == '\n' || chr == 0) { + break; + } + + if (len == sizeof(password)-1) { + // we should consume all entered characters even + // if maximal input length reached + continue; + } else { + password[len++] = chr; + } + } + password[len] = 0; + + // restore terminal to previous state if needed + if (tty_changed) { + ioctl(0, 0x5402+0 /* TCSETS+TCSANOW */, &term_old); + } + + // force new line + write(1, "\n", 1); + + return password; +} +#endif + __END_DECLS #endif ================================================ FILE: packages/aapt/aapt-Main.cpp.patch.txt ================================================ diff -u -r ../../src-pristine/aapt/Main.cpp ./Main.cpp --- ../../src-pristine/aapt/Main.cpp 2016-10-07 15:12:44.322248606 -0400 +++ ./Main.cpp 2016-10-07 15:18:50.708065085 -0400 @@ -268,6 +268,9 @@ /* default to compression */ bundle.setCompressionMethod(ZipEntry::kCompressDeflated); + // Convenience when using aapt in termux. + bundle.addPackageInclude("@TERMUX_PREFIX@/share/aapt/android.jar"); + if (argc < 2) { wantUsage = true; goto bail; ================================================ FILE: packages/aapt/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://elinux.org/Android_aapt TERMUX_PKG_DESCRIPTION="Android Asset Packaging Tool" TERMUX_PKG_LICENSE="Apache-2.0" _TAG_VERSION=7.1.2 _TAG_REVISION=33 TERMUX_PKG_VERSION=${_TAG_VERSION}.${_TAG_REVISION} TERMUX_PKG_REVISION=7 TERMUX_PKG_SKIP_SRC_EXTRACT=true TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_DEPENDS="libc++, libexpat, libpng, libzopfli, zlib" termux_step_pre_configure() { # Certain packages are not safe to build on device because their # build.sh script deletes specific files in $TERMUX_PREFIX. if $TERMUX_ON_DEVICE_BUILD; then termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds." fi } termux_step_make_install() { # FIXME: We would like to enable checksums when downloading # tar files, but they change each time as the tar metadata # differs: https://github.com/google/gitiles/issues/84 local _TAGNAME=${_TAG_VERSION}_r${_TAG_REVISION} SYSTEM_CORE_INCLUDE_TARFILE=$TERMUX_PKG_CACHEDIR/system_core_include_${_TAGNAME}.tar.gz test ! -f $SYSTEM_CORE_INCLUDE_TARFILE && termux_download \ "https://android.googlesource.com/platform/system/core/+archive/android-$_TAGNAME/include.tar.gz" \ $SYSTEM_CORE_INCLUDE_TARFILE \ SKIP_CHECKSUM ANDROIDFW_INCLUDE_TARFILE=$TERMUX_PKG_CACHEDIR/androidfw_include_${_TAGNAME}.tar.gz test ! -f $ANDROIDFW_INCLUDE_TARFILE && termux_download \ "https://android.googlesource.com/platform/frameworks/base/+archive/android-$_TAGNAME/include/androidfw.tar.gz" \ $ANDROIDFW_INCLUDE_TARFILE \ SKIP_CHECKSUM ANDROID_BASE_INCLUDE_TARFILE=$TERMUX_PKG_CACHEDIR/android_base_include_${_TAGNAME}.tar.gz test ! -f $ANDROID_BASE_INCLUDE_TARFILE && termux_download \ "https://android.googlesource.com/platform/system/core/+archive/android-$_TAGNAME/base/include/android-base.tar.gz" \ $ANDROID_BASE_INCLUDE_TARFILE \ SKIP_CHECKSUM local AOSP_INCLUDE_DIR=$TERMUX_PREFIX/include/aosp mkdir -p $AOSP_INCLUDE_DIR cd $AOSP_INCLUDE_DIR rm -Rf * tar xf $SYSTEM_CORE_INCLUDE_TARFILE mkdir -p androidfw cd androidfw tar xf $ANDROIDFW_INCLUDE_TARFILE cd .. mkdir -p android-base cd android-base tar xf $ANDROID_BASE_INCLUDE_TARFILE cd ../log patch -p0 < $TERMUX_PKG_BUILDER_DIR/log.h.patch.txt CXXFLAGS+=" -fPIC" # Build libcutils: mkdir -p $TERMUX_PKG_SRCDIR/{libcutils,androidfw} cd $TERMUX_PKG_SRCDIR/libcutils LIBCUTILS_TARFILE=$TERMUX_PKG_CACHEDIR/libcutils_${_TAGNAME}.tar.gz test ! -f $LIBCUTILS_TARFILE && termux_download \ "https://android.googlesource.com/platform/system/core/+archive/android-$_TAGNAME/libcutils.tar.gz" \ $LIBCUTILS_TARFILE \ SKIP_CHECKSUM tar xf $LIBCUTILS_TARFILE patch -p0 < $TERMUX_PKG_BUILDER_DIR/libcutils-patch.txt $CXX $CXXFLAGS -isystem $AOSP_INCLUDE_DIR -c -o sockets.o sockets.cpp $CXX $CXXFLAGS -isystem $AOSP_INCLUDE_DIR -c -o sockets_unix.o sockets_unix.cpp sed -i 's%include %include %' properties.c # From Android.mk: libcutils_common_sources="\ config_utils.c \ fs_config.c \ canned_fs_config.c \ hashmap.c \ iosched_policy.c \ load_file.c \ native_handle.c \ open_memstream.c \ process_name.c \ record_stream.c \ sched_policy.c \ sockets.o \ strdup16to8.c \ strdup8to16.c \ strlcpy.c \ threads.c" libcutils_nonwindows_sources="\ fs.c \ multiuser.c \ socket_inaddr_any_server_unix.c \ socket_local_client_unix.c \ socket_local_server_unix.c \ socket_loopback_client_unix.c \ socket_loopback_server_unix.c \ socket_network_client_unix.c \ sockets_unix.o \ str_parms.c" # -D_FORTIFY_SOURCE=2 makes debug build fail with: # In file included from process_name.c:29: # /data/data/com.termux/files/usr/include/aosp/cutils/properties.h:116:45: error: expected identifier # __errordecl(__property_get_too_small_error, "property_get() called with too small of a buffer"); # ^ # /data/data/com.termux/files/usr/include/aosp/cutils/properties.h:119:5: error: static declaration of 'property_get' follows non-static declaration # int property_get(const char *key, char *value, const char *default_value) { # ^ # /data/data/com.termux/files/usr/include/aosp/cutils/properties.h:46:5: note: previous declaration is here # int property_get(const char *key, char *value, const char *default_value); $CC ${CFLAGS/-D_FORTIFY_SOURCE=2/} \ $LDFLAGS \ -Dchar16_t=uint16_t \ -std=c11 \ -isystem $AOSP_INCLUDE_DIR \ $libcutils_common_sources \ $libcutils_nonwindows_sources \ trace-host.c \ properties.c \ -llog \ -shared \ -o $TERMUX_PREFIX/lib/libandroid-cutils.so # Build libutil: local LIBUTILS_TARFILE=$TERMUX_PKG_CACHEDIR/libutils_${_TAGNAME}.tar.gz test ! -f $LIBUTILS_TARFILE && termux_download \ "https://android.googlesource.com/platform/system/core/+archive/android-$_TAGNAME/libutils.tar.gz" \ $LIBUTILS_TARFILE \ SKIP_CHECKSUM local SAFE_IOP_TARFILE=$TERMUX_PKG_CACHEDIR/safe_iop.tar.gz test ! -f $SAFE_IOP_TARFILE && termux_download \ https://android.googlesource.com/platform/external/safe-iop/+archive/cd76f998688d145235de78ecd5b340d0eac9239d.tar.gz \ $SAFE_IOP_TARFILE \ SKIP_CHECKSUM local SAFE_IOP_DIR=$TERMUX_PKG_TMPDIR/safe-iop mkdir -p $SAFE_IOP_DIR cd $SAFE_IOP_DIR tar xf $SAFE_IOP_TARFILE mv src/safe_iop.c src/safe_iop.cpp mkdir $TERMUX_PKG_SRCDIR/libutils cd $TERMUX_PKG_SRCDIR/libutils tar xf $LIBUTILS_TARFILE # From Android.mk: #CallStack.cpp \ #SystemClock.cpp \ commonSources="\ FileMap.cpp \ JenkinsHash.cpp \ LinearTransform.cpp \ Log.cpp \ NativeHandle.cpp \ Printer.cpp \ PropertyMap.cpp \ RefBase.cpp \ SharedBuffer.cpp \ Static.cpp \ StopWatch.cpp \ String8.cpp \ String16.cpp \ Threads.cpp \ Timers.cpp \ Tokenizer.cpp \ Unicode.cpp \ VectorImpl.cpp \ misc.cpp" $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS \ -std=c++11 \ '-DALOG_ASSERT(a,...)=' \ -Dtypeof=decltype \ -isystem $TERMUX_PREFIX/include/aosp \ -isystem $SAFE_IOP_DIR/include \ $SAFE_IOP_DIR/src/safe_iop.cpp \ $commonSources \ -landroid-cutils \ -llog \ -shared \ -o $TERMUX_PREFIX/lib/libandroid-utils.so # Build libbase: local LIBBASE_TARFILE=$TERMUX_PKG_CACHEDIR/libbase_${_TAGNAME}.tar.gz test ! -f $LIBBASE_TARFILE && termux_download \ "https://android.googlesource.com/platform/system/core/+archive/android-${_TAGNAME}/base.tar.gz" \ $LIBBASE_TARFILE \ SKIP_CHECKSUM mkdir -p $TERMUX_PKG_SRCDIR/libbase cd $TERMUX_PKG_SRCDIR/libbase tar xf $LIBBASE_TARFILE rm -Rf $TERMUX_PREFIX/include/aosp/android-base mv include/android-base $TERMUX_PREFIX/include/aosp patch -p1 < $TERMUX_PKG_BUILDER_DIR/libbase-patch.txt #logging.cpp \ libbase_src_files="\ file.cpp \ parsenetaddress.cpp \ stringprintf.cpp \ strings.cpp \ test_utils.cpp" libbase_linux_src_files="\ errors_unix.cpp" # __USE_BSD for DEFFILEMODE to be defined by . $CXX $CXXFLAGS $CPPFLAGS \ $LDFLAGS \ -std=c++11 \ -include memory \ -D__USE_BSD \ -isystem $AOSP_INCLUDE_DIR \ $libbase_src_files $libbase_linux_src_files \ -llog \ -shared \ -o $TERMUX_PREFIX/lib/libandroid-base.so # Build libziparchive: LIBZIPARCHIVE_TARFILE=$TERMUX_PKG_CACHEDIR/libziparchive_${_TAGNAME}.tar.gz test ! -f $LIBZIPARCHIVE_TARFILE && termux_download \ "https://android.googlesource.com/platform/system/core/+archive/android-$_TAGNAME/libziparchive.tar.gz" \ $LIBZIPARCHIVE_TARFILE \ SKIP_CHECKSUM mkdir -p $TERMUX_PKG_SRCDIR/libziparchive cd $TERMUX_PKG_SRCDIR/libziparchive tar xf $LIBZIPARCHIVE_TARFILE libziparchive_source_files="\ zip_archive.cc \ zip_archive_stream_entry.cc \ zip_writer.cc" patch -p0 < $TERMUX_PKG_BUILDER_DIR/libziparchive.patch.txt $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -std=c++11 \ -DZLIB_CONST \ -isystem $AOSP_INCLUDE_DIR \ $libziparchive_source_files \ -landroid-base \ -landroid-utils \ -lz \ -llog \ -shared \ -o $TERMUX_PREFIX/lib/libandroid-ziparchive.so # Build libandroidfw: ANDROIDFW_TARFILE=$TERMUX_PKG_CACHEDIR/androidfw_${_TAGNAME}.tar.gz test ! -f $ANDROIDFW_TARFILE && termux_download \ https://android.googlesource.com/platform/frameworks/base/+archive/android-$_TAGNAME/libs/androidfw.tar.gz \ $ANDROIDFW_TARFILE \ SKIP_CHECKSUM mkdir -p $TERMUX_PKG_SRCDIR/androidfw cd $TERMUX_PKG_SRCDIR/androidfw tar xf $ANDROIDFW_TARFILE commonSources="\ Asset.cpp \ AssetDir.cpp \ AssetManager.cpp \ LocaleData.cpp \ misc.cpp \ ObbFile.cpp \ ResourceTypes.cpp \ StreamingZipInflater.cpp \ TypeWrappers.cpp \ ZipFileRO.cpp \ ZipUtils.cpp" sed -i 's%#include %%' ResourceTypes.cpp $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -isystem $AOSP_INCLUDE_DIR \ -std=c++11 \ -include memory \ $commonSources \ -landroid-cutils \ -landroid-utils \ -landroid-ziparchive \ -llog \ -lz \ -shared \ -o $TERMUX_PREFIX/lib/libandroid-fw.so # Build aapt: AAPT_TARFILE=$TERMUX_PKG_CACHEDIR/aapt_${_TAGNAME}.tar.gz test ! -f $AAPT_TARFILE && termux_download \ "https://android.googlesource.com/platform/frameworks/base/+archive/android-$_TAGNAME/tools/aapt.tar.gz" \ $AAPT_TARFILE \ SKIP_CHECKSUM mkdir $TERMUX_PKG_SRCDIR/aapt cd $TERMUX_PKG_SRCDIR/aapt tar xf $AAPT_TARFILE sed "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PKG_BUILDER_DIR/aapt-Main.cpp.patch.txt | patch -p1 $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS \ -std=c++11 \ -include memory \ -DANDROID_SMP=1 \ -DNDEBUG=1 \ -DHAVE_ENDIAN_H=1 -DHAVE_POSIX_FILEMAP=1 -DHAVE_OFF64_T=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_PTHREADS=1 \ -isystem $AOSP_INCLUDE_DIR \ *.cpp \ -landroid-cutils -landroid-utils -landroid-fw -landroid-ziparchive \ -llog \ -lm -lz -lpng -lexpat \ -pie \ -o $TERMUX_PREFIX/bin/aapt # Build zipalign: ZIPALIGN_TARFILE=$TERMUX_PKG_CACHEDIR/zipalign_${_TAGNAME}.tar.gz test ! -f $ZIPALIGN_TARFILE && termux_download \ "https://android.googlesource.com/platform/build.git/+archive/android-$_TAGNAME/tools/zipalign.tar.gz" \ $ZIPALIGN_TARFILE \ SKIP_CHECKSUM mkdir $TERMUX_PKG_SRCDIR/zipalign cd $TERMUX_PKG_SRCDIR/zipalign tar xf $ZIPALIGN_TARFILE $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS \ -isystem $AOSP_INCLUDE_DIR \ -std=c++11 \ ZipAlign.cpp ZipEntry.cpp ZipFile.cpp \ -landroid-cutils -landroid-utils -landroid-fw \ -lm -lz -llog \ -lzopfli \ -pie \ -o $TERMUX_PREFIX/bin/zipalign # Remove this one for now: rm -Rf $AOSP_INCLUDE_DIR # Create an android.jar with AndroidManifest.xml and resources.arsc: cd $TERMUX_PKG_TMPDIR rm -rf android-jar mkdir android-jar cd android-jar cp $ANDROID_HOME/platforms/android-28/android.jar . unzip -q android.jar mkdir -p $TERMUX_PREFIX/share/aapt jar cfM $TERMUX_PREFIX/share/aapt/android.jar AndroidManifest.xml resources.arsc } ================================================ FILE: packages/aapt/libbase-patch.txt ================================================ diff -u -r ../../libbase/logging.cpp ./logging.cpp --- ../../libbase/logging.cpp 2016-09-01 11:56:01.000000000 -0400 +++ ./logging.cpp 2016-09-01 12:17:04.405086704 -0400 @@ -46,7 +46,6 @@ // Headers for LogMessage::LogLine. #ifdef __ANDROID__ -#include #include "cutils/log.h" #else #include @@ -398,9 +397,6 @@ // Abort if necessary. if (data_->GetSeverity() == FATAL) { -#ifdef __ANDROID__ - android_set_abort_message(msg.c_str()); -#endif abort(); } } ================================================ FILE: packages/aapt/libcutils-patch.txt ================================================ https://android.googlesource.com/platform/system/core/+/84421d8475ca8262a914b3875ed110fc6187ee74 Add ioprio values directly. The ioprio.h header is not a uapi header, so remove it's use and add the two values that this code needs to use. Bug: 30072483 Change-Id: I5c8b6f40bd60a43f50ac26792f96d2fa3f6db020 diff -u -r ../libcutils-orig/iosched_policy.c ./iosched_policy.c --- ../libcutils-orig/iosched_policy.c 2017-06-28 13:45:36.296011839 +0200 +++ ./iosched_policy.c 2017-06-28 13:45:47.307888245 +0200 @@ -24,7 +24,8 @@ #include #if defined(__ANDROID__) -#include +#define IOPRIO_WHO_PROCESS (1) +#define IOPRIO_CLASS_SHIFT (13) #include #define __android_unused #else ================================================ FILE: packages/aapt/libziparchive.patch.txt ================================================ Remove reference to __android_log_error_write which does not exist on Android 5. See: https://github.com/termux/termux-packages/issues/1306 diff -u -r ../../pristine-src/libziparchive/zip_archive.cc ./zip_archive.cc --- ../../pristine-src/libziparchive/zip_archive.cc 2017-08-23 21:25:26.492287975 +0200 +++ ./zip_archive.cc 2017-08-23 21:31:15.904280978 +0200 @@ -272,11 +272,6 @@ if (static_cast(eocd->cd_start_offset) + eocd->cd_size > eocd_offset) { ALOGW("Zip: bad offsets (dir %" PRIu32 ", size %" PRIu32 ", eocd %" PRId64 ")", eocd->cd_start_offset, eocd->cd_size, static_cast(eocd_offset)); -#if defined(__ANDROID__) - if (eocd->cd_start_offset + eocd->cd_size <= eocd_offset) { - android_errorWriteLog(0x534e4554, "31251826"); - } -#endif return kInvalidOffset; } if (eocd->num_records == 0) { @@ -388,9 +383,6 @@ for (uint16_t i = 0; i < num_entries; i++) { if (ptr > cd_end - sizeof(CentralDirectoryRecord)) { ALOGW("Zip: ran off the end (at %" PRIu16 ")", i); -#if defined(__ANDROID__) - android_errorWriteLog(0x534e4554, "36392138"); -#endif return -1; } ================================================ FILE: packages/aapt/log.h.patch.txt ================================================ --- log-orig.h 2017-03-04 02:11:04.589477520 +0100 +++ log.h 2017-03-04 02:11:54.556875283 +0100 @@ -217,7 +217,7 @@ */ #ifndef SLOGV #define __SLOGV(...) \ - ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) + ((void)__android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) #if LOG_NDEBUG #define SLOGV(...) do { if (0) { __SLOGV(__VA_ARGS__); } } while (0) #else @@ -231,7 +231,7 @@ #else #define SLOGV_IF(cond, ...) \ ( (__predict_false(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ + ? ((void)__android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ : (void)0 ) #endif #endif @@ -241,13 +241,13 @@ */ #ifndef SLOGD #define SLOGD(...) \ - ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) + ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) #endif #ifndef SLOGD_IF #define SLOGD_IF(cond, ...) \ ( (__predict_false(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ + ? ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ : (void)0 ) #endif @@ -256,13 +256,13 @@ */ #ifndef SLOGI #define SLOGI(...) \ - ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) + ((void)__android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) #endif #ifndef SLOGI_IF #define SLOGI_IF(cond, ...) \ ( (__predict_false(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \ + ? ((void)__android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \ : (void)0 ) #endif @@ -271,13 +271,13 @@ */ #ifndef SLOGW #define SLOGW(...) \ - ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) + ((void)__android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) #endif #ifndef SLOGW_IF #define SLOGW_IF(cond, ...) \ ( (__predict_false(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \ + ? ((void)__android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \ : (void)0 ) #endif @@ -286,13 +286,13 @@ */ #ifndef SLOGE #define SLOGE(...) \ - ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) + ((void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) #endif #ifndef SLOGE_IF #define SLOGE_IF(cond, ...) \ ( (__predict_false(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ + ? ((void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ : (void)0 ) #endif ================================================ FILE: packages/abduco/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.brain-dump.org/projects/abduco/ TERMUX_PKG_DESCRIPTION="Clean and simple terminal session manager" TERMUX_PKG_LICENSE="ISC" TERMUX_PKG_VERSION=0.6 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=http://www.brain-dump.org/projects/abduco/abduco-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=c90909e13fa95770b5afc3b59f311b3d3d2fdfae23f9569fa4f96a3e192a35f4 TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_DEPENDS="dvtm" termux_step_pre_configure() { CFLAGS+=" $CPPFLAGS" } ================================================ FILE: packages/abook/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://abook.sourceforge.net/ TERMUX_PKG_DESCRIPTION="Abook is a text-based addressbook program designed to use with mutt mail client" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=0.6.1 TERMUX_PKG_SHA256=f0a90df8694fb34685ecdd45d97db28b88046c15c95e7b0700596028bd8bc0f9 TERMUX_PKG_SRCURL=http://abook.sourceforge.net/devel/abook-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_DEPENDS="libandroid-support, ncurses, readline" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--mandir=$TERMUX_PREFIX/share/man" termux_step_pre_configure() { aclocal automake --add-missing autoreconf } ================================================ FILE: packages/abook/database.h.patch ================================================ diff -u -r ../abook-0.6.0pre2/database.h ./database.h --- ../abook-0.6.0pre2/database.h 2006-09-04 21:24:18.000000000 +0200 +++ ./database.h 2017-01-15 21:47:00.441932233 +0100 @@ -60,7 +60,7 @@ /* * Field operations */ -inline int field_id(int i); +int field_id(int i); abook_field *find_standard_field(char *key, int do_declare); abook_field *real_find_field(char *key, abook_field_list *list, int *nb); #define find_field(key, list) real_find_field(key, list, NULL) ================================================ FILE: packages/abook/filter.c.patch ================================================ diff -u -r ../abook-0.6.0pre2/filter.c ./filter.c --- ../abook-0.6.0pre2/filter.c 2006-09-06 01:26:10.000000000 -0400 +++ ./filter.c 2016-08-09 15:02:24.050415314 -0400 @@ -146,6 +146,9 @@ get_real_name() { char *username = getenv("USER"); +#ifdef __ANDROID__ + return xstrdup(username); +#else struct passwd *pwent; int rtn; char *tmp; @@ -161,6 +164,7 @@ return xstrdup(username); } else return tmp; +#endif } /* ================================================ FILE: packages/ack-grep/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://beyondgrep.com/ TERMUX_PKG_DESCRIPTION="Tool like grep optimized for programmers" TERMUX_PKG_LICENSE="Artistic-License-2.0" TERMUX_PKG_VERSION=3.2.0 TERMUX_PKG_SRCURL=https://beyondgrep.com/ack-v${TERMUX_PKG_VERSION} TERMUX_PKG_SHA256=dee06c35c2f432ceedf6b0dad6d393c946d49d51af4e1e031be13445a0e6ce55 TERMUX_PKG_DEPENDS="perl" TERMUX_PKG_SKIP_SRC_EXTRACT=true TERMUX_PKG_PLATFORM_INDEPENDENT=true termux_step_make_install() { termux_download \ $TERMUX_PKG_SRCURL \ $TERMUX_PREFIX/bin/ack \ $TERMUX_PKG_SHA256 touch $TERMUX_PREFIX/bin/ack chmod +x $TERMUX_PREFIX/bin/ack } ================================================ FILE: packages/acr/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/radare/acr TERMUX_PKG_DESCRIPTION="A fully compatible autoconf replacement" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.7.2 TERMUX_PKG_REVISION=4 TERMUX_PKG_SRCURL=https://github.com/radare/acr/archive/$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=93571bc141b53f838fb40f6e53f958c56b6abf7520d151874e8707db7cb9c4c6 TERMUX_PKG_DEPENDS="dash" TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/acr/no_dev-stderr.patch ================================================ diff -uNr acr-1.7.2/doc/developers/string-mode acr-1.7.2.mod/doc/developers/string-mode --- acr-1.7.2/doc/developers/string-mode 2019-02-19 06:32:31.000000000 +0200 +++ acr-1.7.2.mod/doc/developers/string-mode 2019-10-29 02:54:47.891089384 +0200 @@ -20,7 +20,7 @@ wait_string_mode # do whatever i want with the string - echo "My string is: ${STRING}" >/dev/stderr + echo "My string is: ${STRING}" >/proc/self/fd/2 leave_string_mode ;; diff -uNr acr-1.7.2/src/acr acr-1.7.2.mod/src/acr --- acr-1.7.2/src/acr 2019-02-19 06:32:31.000000000 +0200 +++ acr-1.7.2.mod/src/acr 2019-10-29 02:55:12.247853031 +0200 @@ -93,7 +93,7 @@ break; ;; "-D"|"--dist") - echo "[1/4] Parsing configure.acr." >/dev/stderr + echo "[1/4] Parsing configure.acr." >/proc/self/fd/2 PBAR=1 MAKEDIST=1 NOPE=1 @@ -140,7 +140,7 @@ done #if [ "`echo ${ACRFILE}|cut -c 1`" = "-" ]; then -# echo "error: unknown flag '${ACRFILE}'." > /dev/stderr +# echo "error: unknown flag '${ACRFILE}'." > /proc/self/fd/2 # exit 1 #fi @@ -151,7 +151,7 @@ fi if [ ! -f "${ACRFILE}" ]; then - echo "error: file ${ACRFILE} not found" > /dev/stderr + echo "error: file ${ACRFILE} not found" > /proc/self/fd/2 exit 1 fi diff -uNr acr-1.7.2/src/acr-cat acr-1.7.2.mod/src/acr-cat --- acr-1.7.2/src/acr-cat 2019-02-19 06:32:31.000000000 +0200 +++ acr-1.7.2.mod/src/acr-cat 2019-10-29 02:55:54.901355928 +0200 @@ -47,18 +47,18 @@ fi if [ ! -f "$1" ]; then - echo "error: target file '$1' does not exist." > /dev/stderr + echo "error: target file '$1' does not exist." > /proc/self/fd/2 exit 1 fi if [ ! -x "$1" ]; then - echo "error: target file '$1' is not executable." > /dev/stderr + echo "error: target file '$1' is not executable." > /proc/self/fd/2 exit 1 fi VERSION="`./${1} --version 2>/dev/null`" if [ -z "`echo ${VERSION} | grep ACR`" ]; then - echo "error: this is not an acr generated configure script." > /dev/stderr + echo "error: this is not an acr generated configure script." > /proc/self/fd/2 exit 1 fi diff -uNr acr-1.7.2/src/amr acr-1.7.2.mod/src/amr --- acr-1.7.2/src/amr 2019-02-19 06:32:31.000000000 +0200 +++ acr-1.7.2.mod/src/amr 2019-10-29 02:55:36.927951184 +0200 @@ -114,7 +114,7 @@ [ "$A" = "$FILE" ] && return done - echo "CInclude ${FILE} not found" > /dev/stderr + echo "CInclude ${FILE} not found" > /proc/self/fd/2 exit 1 } @@ -124,7 +124,7 @@ [ "$A" = "$FILE" ] && return done - echo "CSource ${FILE} not found" > /dev/stderr + echo "CSource ${FILE} not found" > /proc/self/fd/2 exit 1 } @@ -212,7 +212,7 @@ parse_configure_amr() { FILE=$1 -echo "Parsing ${FILE}..." >/dev/stderr +echo "Parsing ${FILE}..." >/proc/self/fd/2 CONFIGURE_AMR="`cat ${FILE} 2>/dev/null`" for A in $CONFIGURE_AMR ; do # TODO: Support for oneline commands and /* */ @@ -268,7 +268,7 @@ eval "${CDEPS_VAR}=\"\$${CDEPS_VAR} ${A}\"" ;; *|0) - echo "Invalid keyword '$A'" > /dev/stderr + echo "Invalid keyword '$A'" > /proc/self/fd/2 exit 1 ;; esac ================================================ FILE: packages/algernon/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://algernon.roboticoverlords.org/ TERMUX_PKG_DESCRIPTION="Small self-contained web server with Lua, Markdown, QUIC, Redis and PostgreSQL support" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.12.5 TERMUX_PKG_SRCURL=https://github.com/xyproto/algernon/archive/$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=b7fe682748e060c404aff5cbcbeca83feb9afb25de15c91a14c1fe78485b423b termux_step_make() { termux_setup_golang export GOPATH=$TERMUX_PKG_BUILDDIR mkdir -p "$GOPATH"/src/github.com/xyproto ln -sf "$TERMUX_PKG_SRCDIR" "$GOPATH"/src/github.com/xyproto/algernon cd "$GOPATH"/src/github.com/xyproto/algernon # Needed to deal with following error on v1.12.5: # verifying github.com/lucas-clemente/quic-go@v0.12.0: checksum mismatch rm -f go.sum go build } termux_step_make_install() { install -Dm700 \ "$GOPATH"/src/github.com/xyproto/algernon/algernon \ "$TERMUX_PREFIX"/bin/ # Offline samples may be useful to get started with Algernon. rm -rf "$TERMUX_PREFIX"/share/doc/algernon mkdir -p "$TERMUX_PREFIX"/share/doc/algernon cp -a "$GOPATH"/src/github.com/xyproto/algernon/samples \ "$TERMUX_PREFIX"/share/doc/algernon/ } ================================================ FILE: packages/algernon/fix-hardcoded-paths.patch ================================================ diff -uNr algernon-1.12.3/engine/config.go algernon-1.12.3.mod/engine/config.go --- algernon-1.12.3/engine/config.go 2019-02-19 17:14:55.000000000 +0200 +++ algernon-1.12.3.mod/engine/config.go 2019-02-25 19:41:17.564347427 +0200 @@ -273,16 +273,16 @@ defaultLimitString: strconv.Itoa(10), // Default Bolt database file, for some operating systems - defaultBoltFilename: "/tmp/algernon.db", + defaultBoltFilename: "@TERMUX_PREFIX@/tmp/algernon.db", // Default log file, for some operating systems - defaultLogFile: "/tmp/algernon.log", + defaultLogFile: "@TERMUX_PREFIX@/var/log/algernon.log", // Default filename for a Lua script that provides data to a template defaultLuaDataFilename: "data.lua", // List of configuration filenames to check - serverConfigurationFilenames: []string{"/etc/algernon/serverconf.lua", "/etc/algernon/server.lua"}, + serverConfigurationFilenames: []string{"@TERMUX_PREFIX@/etc/algernon/serverconf.lua", "@TERMUX_PREFIX@/etc/algernon/server.lua"}, // Compression speed over compactness cacheCompressionSpeed: true, diff -uNr algernon-1.12.3/engine/flags.go algernon-1.12.3.mod/engine/flags.go --- algernon-1.12.3/engine/flags.go 2019-02-19 17:14:55.000000000 +0200 +++ algernon-1.12.3.mod/engine/flags.go 2019-02-25 19:42:16.171195391 +0200 @@ -300,9 +300,9 @@ switch { case ac.productionMode: // Use system directories - ac.serverDirOrFilename = "/srv/algernon" - ac.serverCert = "/etc/algernon/cert.pem" - ac.serverKey = "/etc/algernon/key.pem" + ac.serverDirOrFilename = "@TERMUX_PREFIX@/var/lib/algernon" + ac.serverCert = "@TERMUX_PREFIX@/etc/algernon/cert.pem" + ac.serverKey = "@TERMUX_PREFIX@/etc/algernon/key.pem" ac.cacheMode = cachemode.Production ac.serverMode = true case ac.devMode: diff -uNr algernon-1.12.3/engine/mime.go algernon-1.12.3.mod/engine/mime.go --- algernon-1.12.3/engine/mime.go 2019-02-19 17:14:55.000000000 +0200 +++ algernon-1.12.3.mod/engine/mime.go 2019-02-25 19:42:57.227988150 +0200 @@ -6,5 +6,5 @@ func (ac *Config) initializeMime() { // Read in the mimetype information from the system. Set UTF-8 when setting Content-Type. - ac.mimereader = mime.New("/etc/mime.types", true) + ac.mimereader = mime.New("@TERMUX_PREFIX@/etc/mime.types", true) } diff -uNr algernon-1.12.3/vendor/github.com/go-sql-driver/mysql/dsn.go algernon-1.12.3.mod/vendor/github.com/go-sql-driver/mysql/dsn.go --- algernon-1.12.3/vendor/github.com/go-sql-driver/mysql/dsn.go 2019-02-19 17:14:55.000000000 +0200 +++ algernon-1.12.3.mod/vendor/github.com/go-sql-driver/mysql/dsn.go 2019-02-25 20:31:01.069051948 +0200 @@ -88,7 +88,7 @@ case "tcp": cfg.Addr = "127.0.0.1:3306" case "unix": - cfg.Addr = "/tmp/mysql.sock" + cfg.Addr = "@TERMUX_PREFIX@/tmp/mysql.sock" default: return errors.New("default addr for network '" + cfg.Net + "' unknown") } diff -uNr algernon-1.12.3/vendor/github.com/xyproto/gopher-lua/utils.go algernon-1.12.3.mod/vendor/github.com/xyproto/gopher-lua/utils.go --- algernon-1.12.3/vendor/github.com/xyproto/gopher-lua/utils.go 2019-02-19 17:14:55.000000000 +0200 +++ algernon-1.12.3.mod/vendor/github.com/xyproto/gopher-lua/utils.go 2019-02-25 20:30:26.585626361 +0200 @@ -156,7 +156,7 @@ } func popenArgs(arg string) (string, []string) { - cmd := "/bin/sh" + cmd := "@TERMUX_PREFIX@/bin/sh" args := []string{"-c"} if LuaOS == "windows" { cmd = "C:\\Windows\\system32\\cmd.exe" ================================================ FILE: packages/alpine/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://repo.or.cz/alpine.git TERMUX_PKG_DESCRIPTION="Fast, easy to use email client" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_VERSION=2.21.99999 TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/alpine-$TERMUX_PKG_VERSION.tar.xz TERMUX_PKG_SHA256=229de9f673430190055207f8980205186ed6f73873f1ae6e1467d9d78e0f9dec TERMUX_PKG_DEPENDS="libcrypt, ncurses, openssl-tool" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-debug --with-c-client-target=lnx --without-krb5 --without-ldap --without-pthread --without-tcl --with-system-pinerc=${TERMUX_PREFIX}/etc/pine.conf --with-passfile=$TERMUX_ANDROID_HOME/.pine-passfile " TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { export TCC=$CC export TRANLIB=$RANLIB export SPELLPROG=${TERMUX_PREFIX}/bin/hunspell export alpine_SSLVERSION=old export TPATH=$PATH export LIBS="-lcrypt -llog" # To get S_IREAD and friends: CPPFLAGS+=" -D__USE_BSD" cp $TERMUX_PKG_BUILDER_DIR/pine.conf $TERMUX_PREFIX/etc/pine.conf touch $TERMUX_PKG_SRCDIR/imap/lnxok } termux_step_post_configure() { cd pith $CC_FOR_BUILD help_c_gen.c -o help_c_gen $CC_FOR_BUILD help_h_gen.c -o help_h_gen touch -d "next hour" help_c_gen help_h_gen } termux_step_create_debscripts() { echo "#!$TERMUX_PREFIX/bin/sh" >> postinst echo "if [ ! -e $TERMUX_ANDROID_HOME/.alpine-smime/.pwd/MasterPassword.crt ] && [ ! -e $HOME/.alpine-smime/.pwd/MasterPassword.key ]; then" >> postinst echo "echo 'warning making a passwordless masterpasword file'" >> postinst echo "mkdir -p \$HOME/.alpine-smime/public \$HOME/.alpine-smime/.pwd \$HOME/.alpine-smime/private \$HOME/.alpine-smime/ca" >> postinst echo "openssl req -x509 -newkey rsa:2048 -keyout \$HOME/.alpine-smime/.pwd/MasterPassword.key -out \$HOME/.alpine-smime/.pwd/MasterPassword.crt -days 10000 -nodes -subj '/C=US/ST=dont/L=use/O=this Name/OU=for/CN=anything.com.termux'" >> postinst echo "touch \$HOME/.pine-passfile" >> postinst echo "fi" >> postinst } ================================================ FILE: packages/alpine/configure.patch ================================================ diff -u -r ../alpine-2.21/configure ./configure --- ../alpine-2.21/configure 2017-02-06 00:06:22.491217965 +0000 +++ ./configure 2017-06-14 23:28:28.132302332 +0000 @@ -17646,6 +17646,14 @@ fi ;; + *-*-*-android*) + alpine_SSLDIR="@TERMUX_PREFIX@/etc/tls" + alpine_SSLCERTS="$alpine_SSLDIR/certs" + alpine_SSLKEYS="$alpine_SSLDIR/private" + alpine_SSLINCLUDE="@TERMUX_PREFIX@/include/openssl" + alpine_SSLLIB="@TERMUX_PREFIX@/lib" + alpine_path_delim="/" + ;; *-apple-darwin*) systype="OSX" alpine_path_delim="/" ================================================ FILE: packages/alpine/env_unix.c.patch ================================================ diff --git a/imap/src/osdep/unix/env_unix.c b/imap/src/osdep/unix/env_unix.c index 89e5092..f5a734e 100644 --- a/imap/src/osdep/unix/env_unix.c +++ b/imap/src/osdep/unix/env_unix.c @@ -123,7 +123,7 @@ static char *lockpgm = LOCKPGM; * systems. */ -static const char *tmpdir = "/tmp"; +static const char *tmpdir = "@TERMUX_PREFIX@/tmp"; /* Do not change shlock_mode. Doing so can cause mailbox corruption and * denial of service. It also defeats the entire purpose of the shared ================================================ FILE: packages/alpine/fdstring.c.patch ================================================ --- ../fdstring.c 2016-12-10 08:02:12.555352750 +0000 +++ ./imap/src/osdep/unix/fdstring.c 2016-12-10 08:24:29.096929788 +0000 @@ -25,7 +25,7 @@ * Date: 15 April 1997 * Last Edited: 4 April 2007 */ - +#define L_SET SEEK_SET #include "mail.h" #include "osdep.h" #include "misc.h" ================================================ FILE: packages/alpine/imap-src-osdep-unix-Makefile.patch ================================================ --- ../cache/alpine-2.20/imap/src/osdep/unix/Makefile 2015-01-12 05:12:25.505178442 +0000 +++ ./imap/src/osdep/unix/Makefile 2016-12-11 07:08:54.821695452 +0000 @@ -131,13 +131,8 @@ # Commands possibly overriden by the individual port - -ARRC=ar rc -CC=cc LN=ln -s -RANLIB=ranlib - - +AARC="ar rc" # Standard distribution build parameters DEFAULTAUTHENTICATORS=ext md5 pla log @@ -513,8 +508,10 @@ SPOOLDIR=/var/spool \ ACTIVEFILE=/var/lib/news/active \ RSHPATH=/usr/bin/rsh \ - BASECFLAGS="$(GCCCFLAGS)" - + CC=$(TCC) \ + BASECFLAGS="$(GCCCFLAGS)" \ + RANLIB="$(TRANLIB)" + lyn: # LynxOS $(BUILD) `$(CAT) SPECIALS` OS=$@ \ CRXTYPE=nfs \ @@ -869,8 +866,13 @@ all: $(ARCHIVE) $(ARCHIVE): $(BINARIES) - sh -c '$(RM) $(ARCHIVE) || true' + rm -rf client-a + { echo -n 'ar rc '; cat ARCHIVE; } >ARCHIVE.new + rm ARCHIVE + mv ARCHIVE.new ARCHIVE + chmod +x ARCHIVE @$(CAT) ./ARCHIVE + @$(SH) ./ARCHIVE .c.o: ================================================ FILE: packages/alpine/imapmkf.patch ================================================ --- ../cache/alpine-2.20/imap/Makefile 2015-01-12 05:12:25.521178518 +0000 +++ ./imap/Makefile 2016-12-11 06:43:56.986805502 +0000 @@ -457,7 +457,7 @@ # Linux shadow password support doesn't build on traditional systems, but most # Linux systems are shadow these days. -lnx: lnxnul an +lnx: lnxok an $(BUILD) BUILDTYPE=$@ lnxnul: ================================================ FILE: packages/alpine/mlockmake.patch ================================================ --- ../cache/alpine-2.21/imap/src/mlock/Makefile 2017-02-06 00:06:22.515218494 +0000 +++ ./imap/src/mlock/Makefile 2017-07-08 09:25:17.637293516 +0000 @@ -36,7 +36,7 @@ all: mlock mlock: mlock.o - $(CC) $(CFLAGS) -o mlock mlock.o + $(CC) $(CFLAGS) -o mlock mlock.o -llog install: mlock chgrp mail mlock ================================================ FILE: packages/alpine/mtest.c.patch ================================================ --- ../cache/alpine-2.21/imap/src/mtest/mtest.c 2017-02-06 00:06:22.499218141 +0000 +++ ./imap/src/mtest/mtest.c 2017-04-25 11:05:20.133809205 +0000 @@ -97,7 +97,7 @@ } #endif curusr = cpystr (((s = myusername ()) && *s) ? s : "somebody"); -#if UNIXLIKE +#if UNIXLIKE && !defined __ANDROID__ { char *suffix; struct passwd *pwd = getpwnam (curusr); ================================================ FILE: packages/alpine/os_lnx.c.patch ================================================ diff -uNr alpine-2.21/imap/src/osdep/unix/os_lnx.c alpine-2.21.mod/imap/src/osdep/unix/os_lnx.c --- alpine-2.21/imap/src/osdep/unix/os_lnx.c 2017-02-06 02:06:22.499218141 +0200 +++ alpine-2.21.mod/imap/src/osdep/unix/os_lnx.c 2018-07-03 21:08:21.624860068 +0300 @@ -35,7 +35,6 @@ #include #include #include -extern int errno; /* just in case */ #include #include "misc.h" @@ -50,3 +49,7 @@ #include "tz_sv4.c" #include "flocklnx.c" #include "utime.c" +long gethostid (void) +{ +return 0xdeadface; +} ================================================ FILE: packages/alpine/os_lnx.h.patch ================================================ --- ../cache/alpine-2.20/imap/src/osdep/unix/os_lnx.h 2015-01-12 05:12:25.505178442 +0000 +++ ./imap/src/osdep/unix/os_lnx.h 2016-12-10 23:21:20.644163814 +0000 @@ -48,13 +48,13 @@ #include #include - /* Linux gets this wrong */ #define setpgrp setpgid #define direct dirent - +#define L_SET SEEK_SET +#define FNDELAY O_NDELAY #define flock safe_flock #define utime portable_utime ================================================ FILE: packages/alpine/pine.conf ================================================ # # Alpine configuration file # # This file sets the configuration options used by Alpine and PC-Alpine. These # options are usually set from within Alpine or PC-Alpine. There may be a # system-wide configuration file which sets the defaults for some of the # variables. On Unix, run alpine -conf to see how system defaults have been set. # For variables that accept multiple values, list elements are separated by # commas. A line beginning with a space or tab is considered to be a # continuation of the previous line. For a variable to be unset its value must # be blank. To set a variable to the empty string its value should be "". # You can override system defaults by setting a variable to the empty string. # Lines beginning with "#" are comments, and ignored by Alpine. # Over-rides your full name from Unix password file. Required for PC-Alpine. personal-name= # Sets domain part of From: and local addresses in outgoing mail. user-domain= # List of SMTP servers for sending mail. If blank: Unix Alpine uses sendmail. smtp-server= # NNTP server for posting news. Also sets news-collections for news reading. nntp-server= # Path of (local or remote) INBOX, e.g. ={mail.somewhere.edu}inbox # Normal Unix default is the local INBOX (usually /usr/spool/mail/$USER). inbox-path= # List of folder pairs; the first indicates a folder to archive, and the # second indicates the folder read messages in the first should # be moved to. incoming-archive-folders= # List of folders, assumed to be in first folder collection, # offered for pruning each month. For example: mumble pruned-folders= # Over-rides default path for sent-mail folder, e.g. =old-mail (using first # folder collection dir) or ={host2}sent-mail or ="" (to suppress saving). # Default: sent-mail (Unix) or SENTMAIL.MTX (PC) in default folder collection. default-fcc= # Over-rides default path for saved-msg folder, e.g. =saved-messages (using 1st # folder collection dir) or ={host2}saved-mail or ="" (to suppress saving). # Default: saved-messages (Unix) or SAVEMAIL.MTX (PC) in default collection. default-saved-msg-folder= # Over-rides default path for postponed messages folder, e.g. =pm (which uses # first folder collection dir) or ={host4}pm (using home dir on host4). # Default: postponed-msgs (Unix) or POSTPOND.MTX (PC) in default fldr coltn. postponed-folder= # If set, specifies where already-read messages will be moved upon quitting. read-message-folder= # If set, specifies where form letters should be stored. form-letter-folder= # If set, specifies where trash is moved to in Web Alpine. trash-folder= # Contains the actual signature contents as opposed to the signature filename. # If defined, this overrides the signature-file. Default is undefined. literal-signature= # Over-rides default path for signature file. Default is ~/.signature signature-file= # List of features; see Alpine's Setup/options menu for the current set. # e.g. feature-list= select-without-confirm, signature-at-bottom # Default condition for all of the features is no-. feature-list= # Alpine executes these keys upon startup (e.g. to view msg 13: i,j,1,3,CR,v) initial-keystroke-list= # Only show these headers (by default) when composing messages default-composer-hdrs= # Add these customized headers (and possible default values) when composing customized-hdrs= # When viewing messages, include this list of headers viewer-hdrs= # When viewing messages, number of blank spaces between left display edge and text viewer-margin-left= # When viewing messages, number of blank spaces between right display edge and text viewer-margin-right= # When viewing messages, number of lines of quote displayed before suppressing quote-suppression-threshold= # Determines default folder name for Saves... # Choices: default-folder, by-sender, by-from, by-recipient, last-folder-used. # Default: "default-folder", i.e. "saved-messages" (Unix) or "SAVEMAIL" (PC). saved-msg-name-rule= # Determines default name for Fcc... # Choices: default-fcc, by-recipient, last-fcc-used. # Default: "default-fcc" (see also "default-fcc=" variable.) fcc-name-rule= # Sets presentation order of messages in Index. Choices: # Subject, From, Arrival, Date, Size, To, Cc, OrderedSubj, Score, and Thread. # Order may be reversed by appending /Reverse. Default: "Arrival". sort-key= # Sets presentation order of address book entries. Choices: dont-sort, # fullname-with-lists-last, fullname, nickname-with-lists-last, nickname # Default: "fullname-with-lists-last". addrbook-sort-rule= # Sets presentation order of folder list entries. Choices: alphabetical, # alpha-with-dirs-last, alpha-with-dirs-first. # Default: "alpha-with-directories-last". folder-sort-rule= # Sets the default folder and collection offered at the Goto Command's prompt. goto-default-rule= # Sets message which cursor begins on. Choices: first-unseen, first-recent, # first-important, first-important-or-unseen, first-important-or-recent, # first, last. Default: "first-unseen". incoming-startup-rule= # Allows a default answer for the prune folder questions. Choices: yes-ask, # yes-no, no-ask, no-no, ask-ask, ask-no. Default: "ask-ask". pruning-rule= # Controls behavior when reopening an already open folder. folder-reopen-rule= # Style that MESSAGE INDEX is displayed in when threading. threading-display-style= # Style of THREAD INDEX or default MESSAGE INDEX when threading. threading-index-style= # When threading, character used to indicate collapsed messages underneath. threading-indicator-character= # When threading, character used to indicate expanded messages underneath. threading-expanded-character= # When threading, character used to indicate this is the last reply # to the parent of this message. threading-lastreply-character= # Reflects capabilities of the display you have. # If unset, the default is taken from your locale. That is usually the right # thing to use. Typical alternatives include UTF-8, ISO-8859-x, and EUC-JP # (where x is a number between 1 and 9). display-character-set= # Reflects capabilities of the keyboard you have. # If unset, the default is to use the same value # used for the display-character-set. keyboard-character-set= # Defaults to UTF-8. This is used for outgoing messages. # It is usually correct to leave this unset. posting-character-set= # Defaults to nothing, which is equivalent to US-ASCII. This is used for # unlabeled incoming messages. It is ok to leave this unset but if you receive # unlabeled mail that is usually in some known character set, set that here. unknown-character-set= # Specifies the program invoked by ^_ in the Composer, # or the "enable-alternate-editor-implicitly" feature. editor= # Specifies the program invoked by ^T in the Composer. speller= # Specifies the column of the screen where the composer should wrap. composer-wrap-column= # Specifies the string to insert when replying to a message. reply-indent-string= # Specifies the introduction to insert when replying to a message. reply-leadin= # Specifies the string to replace quotes with when viewing a message. quote-replace-string= # When these characters appear in the middle of a word in the composer # the forward word function will stop at the first text following (as happens # with SPACE characters by default) composer-word-separators= # Specifies the string to use when sending a message with no to or cc. empty-header-message= # Program to view images (e.g. GIF or TIFF attachments). image-viewer= # If "user-domain" not set, strips hostname in FROM address. (Unix only) use-only-domain-name= # This variable takes a list of programs that message text is piped into # after MIME decoding, prior to display. display-filters= # This defines a program that message text is piped into before MIME # encoding, prior to sending sending-filters= # A list of alternate addresses the user is known by alt-addresses= # A list of keywords for use in categorizing messages keywords= # Characters which surround keywords in SUBJKEY token. # Default is "{" "} " keyword-surrounding-chars= # Characters between subject and opening text in SUBJECTTEXT token. # Default is " - " opening-text-separator-chars= # This is a list of formats for address books. Each entry in the list is made # up of space-delimited tokens telling which fields are displayed and in # which order. See help text addressbook-formats= # This gives a format for displaying the index. It is made # up of space-delimited tokens telling which fields are displayed and in # which order. See help text index-format= # The number of lines of overlap when scrolling through message text viewer-overlap= # Number of lines from top and bottom of screen where single # line scrolling occurs. scroll-margin= # The number of seconds to sleep after writing a status message status-message-delay= # Number of times per-second to update busy cue messages busy-cue-rate= # UNIX ONLY (except MAC OSX): When an attachment is opened, this variable controls the number #of seconds to wait between checks if the user has ended viewing the attachment. #minimun value: 60 seconds, maximum value: 600 seconds (10 minutes). Default: 60 seconds mailcap-check-interval= # The approximate number of seconds between checks for new mail mail-check-interval= # The approximate number of seconds between checks for new mail in folders # other than the current folder and inbox. # Default is same as mail-check-interval mail-check-interval-noncurrent= # The minimum number of seconds between checks for new mail in a Mail Drop. # This is always effectively at least as large as the mail-check-interval maildrop-check-minimum= # For newsgroups accessed using NNTP, only messages numbered in the range # lastmsg-range+1 to lastmsg will be considered nntp-range= # Full path and name of NEWSRC file newsrc-path= # Path and filename of news configuration's active file. # The default is typically "/usr/lib/news/active". news-active-file-path= # Directory containing system's news data. # The default is typically "/usr/spool/news" news-spool-directory= # Path and filename of the program used to upload text from your terminal # emulator's into Alpine's composer. upload-command= # Text sent to terminal emulator prior to invoking the program defined by # the upload-command variable. # Note: _FILE_ will be replaced with the temporary file used in the upload. upload-command-prefix= # Path and filename of the program used to download text via your terminal # emulator from Alpine's export and save commands. download-command= # Text sent to terminal emulator prior to invoking the program defined by # the download-command variable. # Note: _FILE_ will be replaced with the temporary file used in the download. download-command-prefix= # Sets the search path for the mailcap configuration file. # NOTE: colon delimited under UNIX, semi-colon delimited under DOS/Windows/OS2. mailcap-search-path= # Sets the search path for the mimetypes configuration file. # NOTE: colon delimited under UNIX, semi-colon delimited under DOS/Windows/OS2. mimetype-search-path= # List of programs to open Internet URLs (e.g. http or ftp references). url-viewers= # The maximum number of non-stayopen remote connections that Alpine will use max-remote-connections= # A list of folders that should be left open once opened (INBOX is implicit) stay-open-folders= # Sets the time in seconds that Alpine will attempt to open a network # connection when checking for new unseen messages in an incoming folder. # The default is 5. incoming-check-timeout= # Sets the approximate number of seconds between checks for unseen messages # in incoming folders. The default is 180. incoming-check-interval= # Sets the approximate number of seconds between checks for unseen messages # for other than local or IMAP folders. The default is 180. incoming-check-interval-secondary= # List of incoming folders to check for unseen messages. The default if left # blank is to check all incoming folders. incoming-check-list= # Specifies the number of dead letter files to keep when canceling. dead-letter-files= # Sets the filename for the newmail fifo (named pipe). Unix only. newmail-fifo-path= # Sets the width for the NewMail screen. newmail-window-width= # List of incoming msg folders besides INBOX, e.g. ={host2}inbox, {host3}inbox # Syntax: optnl-label {optnl-imap-host-name}folder-path incoming-folders= # List of directories where saved-message folders may be. First one is # the default for Saves. Example: Main {host1}mail/[], Desktop mail\[] # Syntax: optnl-label {optnl-imap-hostname}optnl-directory-path[] folder-collections= # List, only needed if nntp-server not set, or news is on a different host # than used for NNTP posting. Examples: News *[] or News *{host3/nntp}[] # Syntax: optnl-label *{news-host/protocol}[] news-collections= # List of file or path names for personal addressbook(s). # Default: ~/.addressbook (Unix) or \PINE\ADDRBOOK (PC) # Syntax: optnl-label path-name address-book= # List of file or path names for global/shared addressbook(s). # Default: none # Syntax: optnl-label path-name global-address-book= # Set by Alpine; controls beginning-of-month sent-mail pruning. last-time-prune-questioned=117.4 # Set by Alpine; controls display of "new version" message. last-version-used=6.20 # This names the path to an alternative program, and any necessary arguments, # to be used in posting mail messages. Example: # /usr/lib/sendmail -oem -t -oi # or, # /usr/local/bin/sendit.sh # The latter a script found in Alpine distribution's contrib/util directory. # NOTE: The program MUST read the message to be posted on standard input, # AND operate in the style of sendmail's "-t" option. sendmail-path= # This names the root of the tree to which the user is restricted when reading # and writing folders and files. For example, on Unix ~/work confines the # user to the subtree beginning with their work subdirectory. # (Note: this alone is not sufficient for preventing access. You will also # need to restrict shell access and so on, see Alpine Technical Notes.) # Default: not set (so no restriction) operating-dir= # If no user input for this many hours, Alpine will exit if in an idle loop # waiting for a new command. If set to zero (the default), then there will # be no timeout. user-input-timeout= # Sets the time in seconds that Alpine will attempt to open a network # connection. The default is 30, the minimum is 5, and the maximum is # system defined (typically 75). tcp-open-timeout= # Network read warning timeout. The default is 15, the minimum is 5, and the # maximum is 1000. tcp-read-warning-timeout= # Network write warning timeout. The default is 0 (unset), the minimum # is 5 (if not 0), and the maximum is 1000. tcp-write-warning-timeout= # If this much time has elapsed at the time of a tcp read or write # timeout, Alpine will ask if you want to break the connection. # Default is 60 seconds, minimum is 5, maximum is 1000. tcp-query-timeout= # Sets the format of the command used to open a UNIX remote # shell connection. The default is "%s %s -l %s exec /etc/r%sd" # NOTE: the 4 (four) "%s" entries MUST exist in the provided command # where the first is for the command's path, the second is for the # host to connect to, the third is for the user to connect as, and the # fourth is for the connection method (typically "imap") rsh-command= # Sets the name of the command used to open a UNIX remote shell connection. # The default is typically /usr/ucb/rsh. rsh-path= # Sets the time in seconds that Alpine will attempt to open a UNIX remote # shell connection. The default is 15, min is 5, and max is unlimited. # Zero disables rsh altogether. rsh-open-timeout= # Sets the format of the command used to open a UNIX secure # shell connection. The default is "%s %s -l %s exec /etc/r%sd" # NOTE: the 4 (four) "%s" entries MUST exist in the provided command # where the first is for the command's path, the second is for the # host to connect to, the third is for the user to connect as, and the # fourth is for the connection method (typically "imap") ssh-command= # Sets the name of the command used to open a UNIX secure shell connection. # Typically this is /usr/bin/ssh. ssh-path= # Sets the time in seconds that Alpine will attempt to open a UNIX secure # shell connection. The default is 15, min is 5, and max is unlimited. # Zero disables ssh altogether. ssh-open-timeout= # Sets the version number Alpine will use as a threshold for offering # its new version message on startup. new-version-threshold= # List of mail drivers to disable. disable-these-drivers= # List of SASL authenticators to disable. disable-these-authenticators= # Set by Alpine; contains data for caching remote address books. remote-abook-metafile= # How many extra copies of remote address book should be kept. Default: 3 remote-abook-history= # Minimum number of minutes between checks for remote address book changes. # 0 means never check except when opening a remote address book. # -1 means never check. Default: 5 remote-abook-validity= # Your default printer selection printer= # List of special print commands personal-print-command= # Which category default print command is in personal-print-category= # Patterns and their actions are stored here. patterns-roles= # Patterns and their actions are stored here. patterns-filters2= # Patterns and their actions are stored here. patterns-scores2= # Patterns and their actions are stored here. patterns-indexcolors= # Patterns and their actions are stored here. patterns-other= # Patterns and their actions are stored here. patterns-search= # Controls display of color color-style=force-xterm-256color # Controls display of color for current index line current-indexline-style=flip-colors # Controls display of color for the titlebar at top of screen titlebar-color-style= # Choose: black, blue, green, cyan, red, magenta, yellow, or white. normal-foreground-color= normal-background-color= reverse-foreground-color= reverse-background-color= title-foreground-color= title-background-color= title-closed-foreground-color= title-closed-background-color= folder-foreground-color= folder-background-color= directory-foreground-color= directory-background-color= folder-list-text-foreground-color= folder-list-text-background-color= status-foreground-color= status-background-color= keylabel-foreground-color= keylabel-background-color= keyname-foreground-color= keyname-background-color= selectable-item-foreground-color= selectable-item-background-color= meta-message-foreground-color= meta-message-background-color= quote1-foreground-color= quote1-background-color= quote2-foreground-color= quote2-background-color= quote3-foreground-color= quote3-background-color= incoming-unseen-foreground-color= incoming-unseen-background-color= signature-foreground-color= signature-background-color= prompt-foreground-color= prompt-background-color= header-general-foreground-color= header-general-background-color= index-to-me-foreground-color= index-to-me-background-color= index-important-foreground-color= index-important-background-color= index-deleted-foreground-color= index-deleted-background-color= index-answered-foreground-color= index-answered-background-color= index-new-foreground-color= index-new-background-color= index-recent-foreground-color= index-recent-background-color= index-forward-foreground-color= index-forward-background-color= index-unseen-foreground-color= index-unseen-background-color= index-highpriority-foreground-color= index-highpriority-background-color= index-lowpriority-foreground-color= index-lowpriority-background-color= index-arrow-foreground-color= index-arrow-background-color= index-subject-foreground-color= index-subject-background-color= index-from-foreground-color= index-from-background-color= index-opening-foreground-color= index-opening-background-color= # Colors in which tokens will be displayed in the index screen index-token-colors= # When viewing messages, these are the header colors viewer-hdr-colors= # Colors used to display keywords in the index keyword-colors= # RSS News feed rss-news= # RSS Weather feed rss-weather= # Web Alpine index table row height wp-indexheight= # Web Alpine number of index lines in table wp-indexlines= # Web Alpine aggregate operations tab state wp-aggstate= # Web Alpine various aspects of cross-session state wp-state= # Web Alpine preferred width for message display in characters wp-columns= # Public certificates are kept in files in this directory. The files should # contain certificates in PEM format. The name of each file should look # like .crt. The default directory is .alpine-smime/public. smime-public-cert-directory= # If this option is set then public certificates are kept in a single container # "file" similar to a remote configuration file instead of in the # smime-publiccert-directory. The value can be a remote or local folder # specification like for a non-standard pinerc value. The default # is that it is not set. smime-public-cert-container= # Private keys are kept in files in this directory. The files are in PEM format. # The name of a file should look like .key. # The default directory is .alpine-smime/private. smime-private-key-directory= # If this option is set then private keys are kept in a single container # "file" similar to a remote configuration file instead of in the # private-key-directory. The value can be a remote or local folder # specification like for a non-standard pinerc value. The default # is that it is not set. smime-private-key-container= # Certificate Authority certificates (in addition to the normal CACerts for the # system) are kept in files in this directory. The files are in PEM format. # Filenames should end with .crt. The default directory is .alpine-smime/ca. smime-cacert-directory= # If this option is set then CAcerts are kept in a single container # "file" similar to a remote configuration file instead of in the # ca-cert-directory. The value can be a remote or local folder # specification like for a non-standard pinerc value. The default # is that it is not set. smime-cacert-container= # LDAP servers for looking up addresses. ldap-servers= ================================================ FILE: packages/alpine/pw_stuff.c.patch ================================================ --- ../cache/alpine-2.20/pith/osdep/pw_stuff.c 2015-01-12 05:12:25.588178837 +0000 +++ ./pith/osdep/pw_stuff.c 2016-12-11 21:24:31.283700286 +0000 @@ -103,12 +103,6 @@ len = strlen(fname_to_utf8(unix_pwd->pw_name)); ui->login = (char *) malloc((len+1) * sizeof(char)); snprintf(ui->login, len+1, "%s", fname_to_utf8(unix_pwd->pw_name)); - - if((s = gcos_name(unix_pwd->pw_gecos, unix_pwd->pw_name)) != NULL){ - len = strlen(fname_to_utf8(s)); - ui->fullname = (char *) malloc((len+1) * sizeof(char)); - snprintf(ui->fullname, len+1, "%s", fname_to_utf8(s)); - } } #else /* _WINDOWS */ @@ -190,12 +184,6 @@ if(pw != NULL){ char *gn, *s = NULL; size_t l; - - if((gn = gcos_name(pw->pw_gecos, name)) != NULL - && (s = (char *) malloc(l = ((strlen(gn) + 1) * sizeof(char)))) != NULL) - snprintf(s, l, "%s", gn); - - return(s); } else return((char *) NULL); ================================================ FILE: packages/antiword/Makefile.Linux.patch ================================================ diff -uNr antiword-0.37/Makefile.Linux antiword-0.37.mod/Makefile.Linux --- antiword-0.37/Makefile.Linux 2005-10-29 20:13:15.000000000 +0300 +++ antiword-0.37.mod/Makefile.Linux 2019-02-25 22:05:02.764208927 +0200 @@ -2,8 +2,8 @@ # Makefile for antiword (Linux version) # -CC = gcc -LD = gcc +CC ?= gcc +LD = $(CC) INSTALL = cp -f INSTALL_PROGRAM = $(INSTALL) @@ -12,12 +12,11 @@ # must be equal to DEBUG or NDEBUG DB = NDEBUG # Optimization: -O or debugging: -g -OPT = -O2 +OPT = LDLIBS = -CFLAGS = -Wall -pedantic $(OPT) -D$(DB) -LDFLAGS = +CFLAGS += -Wall -pedantic $(OPT) -D$(DB) OBJS =\ main_u.o asc85enc.o blocklist.o chartrans.o datalist.o depot.o\ @@ -36,8 +36,8 @@ LOCAL_INSTALL_DIR = $(HOME)/bin LOCAL_RESOURCES_DIR = $(HOME)/.antiword -GLOBAL_INSTALL_DIR = /usr/local/bin -GLOBAL_RESOURCES_DIR = /usr/share/antiword +GLOBAL_INSTALL_DIR = @TERMUX_PREFIX@/bin +GLOBAL_RESOURCES_DIR = @TERMUX_PREFIX@/share/antiword all: $(PROGS) ================================================ FILE: packages/antiword/antiword.h.patch ================================================ diff -uNr antiword-0.37/antiword.h antiword-0.37.mod/antiword.h --- antiword-0.37/antiword.h 2005-07-06 20:46:22.000000000 +0300 +++ antiword-0.37.mod/antiword.h 2019-03-05 19:51:12.173846939 +0200 @@ -204,7 +204,7 @@ #define ANTIWORD_DIR "antiword" #define FONTNAMES_FILE "fontname.txt" #elif defined(__vms) -#define GLOBAL_ANTIWORD_DIR "/usr/share/antiword" +#define GLOBAL_ANTIWORD_DIR "@TERMUX_PREFIX@/share/antiword" #define ANTIWORD_DIR "antiword" #define FONTNAMES_FILE "fontnames" #elif defined(__BEOS__) @@ -224,7 +224,7 @@ #define ANTIWORD_DIR ".antiword" #define FONTNAMES_FILE "fontnames" #else /* All others */ -#define GLOBAL_ANTIWORD_DIR "/usr/share/antiword" +#define GLOBAL_ANTIWORD_DIR "@TERMUX_PREFIX@/share/antiword" #define ANTIWORD_DIR ".antiword" #define FONTNAMES_FILE "fontnames" #endif /* __dos */ ================================================ FILE: packages/antiword/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.winfield.demon.nl/ TERMUX_PKG_DESCRIPTION="A free MS Word reader" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.37 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=http://www.winfield.demon.nl/linux/antiword-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=8e2c000fcbc6d641b0e6ff95e13c846da3ff31097801e86702124a206888f5ac TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_MAKE_INSTALL_TARGET="global_install" TERMUX_PKG_RM_AFTER_INSTALL="bin/kantiword" ================================================ FILE: packages/apache2/Termux.layout ================================================ # Termux layout prefix: exec_prefix: ${prefix} bindir: ${exec_prefix}/bin sbindir: ${exec_prefix}/bin libdir: ${exec_prefix}/lib libexecdir: ${exec_prefix}/libexec/apache2 mandir: ${exec_prefix}/share/man sysconfdir: ${prefix}/etc/apache2 datadir: ${exec_prefix}/share/apache2 iconsdir: ${datadir}/icons htdocsdir: ${prefix}/share/apache2/default-site/htdocs manualdir: ${htdocsdir}/manual cgidir: ${prefix}/lib/cgi-bin includedir: ${exec_prefix}/include/apache2 localstatedir: ${prefix}/var/lock/apache2 runtimedir: ${prefix}/var/run/apache2 logfiledir: ${prefix}/var/log/apache2 proxycachedir: ${prefix}/var/cache/apache2/proxy infodir: ${exec_prefix}/share/info installbuilddir: ${prefix}/share/apache2/build errordir: ${datadir}/error ================================================ FILE: packages/apache2/build-instdso.sh.patch ================================================ diff -u -r ../httpd-2.4.38/build/instdso.sh ./build/instdso.sh --- ../httpd-2.4.38/build/instdso.sh 2011-03-04 18:58:38.000000000 +0000 +++ ./build/instdso.sh 2019-03-17 23:43:43.407027928 +0000 @@ -59,6 +59,12 @@ esac CMD="$SH_LIBTOOL --mode=install $INSTALL_CMD $DSOARCHIVE $TARGETDIR/" +# Prefixing with bash below simplifies cross compiling setup where +# $SH_LIBTOOL may have wrong shebang: +case "$SH_LIBTOOL" in + bash*) ;; + *) CMD="bash $CMD" ;; +esac echo $CMD $CMD || exit $? ================================================ FILE: packages/apache2/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://httpd.apache.org TERMUX_PKG_DESCRIPTION="Apache Web Server" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_VERSION=2.4.41 TERMUX_PKG_SHA256=133d48298fe5315ae9366a0ec66282fa4040efa5d566174481077ade7d18ea40 TERMUX_PKG_SRCURL=https://www.apache.org/dist/httpd/httpd-$TERMUX_PKG_VERSION.tar.bz2 TERMUX_PKG_DEPENDS="apr, apr-util, pcre, openssl, libcrypt, libandroid-support, libnghttp2, libexpat, libuuid, zlib" TERMUX_PKG_BREAKS="apache2-dev" TERMUX_PKG_REPLACES="apache2-dev" TERMUX_PKG_CONFFILES=" etc/apache2/httpd.conf etc/apache2/extra/httpd-autoindex.conf etc/apache2/extra/httpd-dav.conf etc/apache2/extra/httpd-default.conf etc/apache2/extra/httpd-info.conf etc/apache2/extra/httpd-languages.conf etc/apache2/extra/httpd-manual.conf etc/apache2/extra/httpd-mpm.conf etc/apache2/extra/httpd-multilang-errordoc.conf etc/apache2/extra/httpd-ssl.conf etc/apache2/extra/httpd-userdir.conf etc/apache2/extra/httpd-vhosts.conf etc/apache2/extra/proxy-html.conf etc/apache2/mime.types etc/apache2/magic " TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas" # providing manual paths to libs because it picks up host libs on some systems TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --with-apr=$TERMUX_PREFIX --with-apr-util=$TERMUX_PREFIX --with-pcre=$TERMUX_PREFIX --enable-suexec --enable-layout=Termux --enable-so --enable-authnz-fcgi --enable-cache --enable-disk-cache --enable-mem-cache --enable-file-cache --enable-ssl --with-ssl --enable-deflate --enable-cgi --enable-cgid --enable-proxy --enable-proxy-connect --enable-proxy-http --enable-proxy-ftp --enable-dbd --enable-imagemap --enable-ident --enable-cern-meta --enable-http2 --enable-mpms-shared=all --enable-modules=all --enable-mods-shared=all --disable-brotli --disable-lua --disable-mods-static --disable-md --with-port=8080 --with-sslport=8443 --enable-unixd --without-libxml2 --libexecdir=$TERMUX_PREFIX/libexec/apache2 ac_cv_func_getpwnam=yes ac_cv_have_threadsafe_pollset=no " TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_RM_AFTER_INSTALL="share/apache2/manual etc/apache2/original share/man/man8/suexec.8 libexec/httpd.exp" TERMUX_PKG_EXTRA_MAKE_ARGS="-s" termux_step_pre_configure() { # Certain packages are not safe to build on device because their # build.sh script deletes specific files in $TERMUX_PREFIX. if $TERMUX_ON_DEVICE_BUILD; then termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds." fi # remove old files rm -rf "$TERMUX_PREFIX"/{libexec,share,etc}/apache2 rm -rf "$TERMUX_PREFIX"/lib/cgi-bin if [ $TERMUX_ARCH_BITS -eq 32 ]; then export ap_cv_void_ptr_lt_long=4 else export ap_cv_void_ptr_lt_long=8 fi LDFLAGS="$LDFLAGS -llog -lapr-1 -laprutil-1" # use custom layout cat $TERMUX_PKG_BUILDER_DIR/Termux.layout > $TERMUX_PKG_SRCDIR/config.layout } termux_step_post_configure() { # thanks to @JetBalsa gcc -O2 -DCROSS_COMPILE $TERMUX_PKG_SRCDIR/server/gen_test_char.c -o $TERMUX_PKG_BUILDDIR/server/gen_test_char touch -d "1 hour" $TERMUX_PKG_BUILDDIR/server/gen_test_char } termux_step_post_make_install() { sed -e "s#/$TERMUX_PREFIX/libexec/apache2/#modules/#" \ -e 's|#\(LoadModule negotiation_module \)|\1|' \ -e 's|#\(LoadModule include_module \)|\1|' \ -e 's|#\(LoadModule userdir_module \)|\1|' \ -e 's|#\(LoadModule slotmem_shm_module \)|\1|' \ -e 's|#\(Include extra/httpd-multilang-errordoc.conf\)|\1|' \ -e 's|#\(Include extra/httpd-autoindex.conf\)|\1|' \ -e 's|#\(Include extra/httpd-languages.conf\)|\1|' \ -e 's|#\(Include extra/httpd-userdir.conf\)|\1|' \ -e 's|#\(Include extra/httpd-default.conf\)|\1|' \ -e 's|#\(Include extra/httpd-mpm.conf\)|\1|' \ -e 's|User daemon|#User daemon|' \ -e 's|Group daemon|#Group daemon|' \ -i "$TERMUX_PREFIX/etc/apache2/httpd.conf" } termux_step_post_massage() { # sometimes it creates a $TERMUX_PREFIX/bin/sh -> /bin/sh rm ${TERMUX_PKG_MASSAGEDIR}${TERMUX_PREFIX}/bin/sh || true mkdir -p ${TERMUX_PKG_MASSAGEDIR}${TERMUX_PREFIX}/var/run/apache2 mkdir -p ${TERMUX_PKG_MASSAGEDIR}${TERMUX_PREFIX}/var/log/apache2 } ================================================ FILE: packages/apache2/configure.patch ================================================ diff -u -r ../httpd-2.4.38/configure ./configure --- ../httpd-2.4.38/configure 2019-01-17 18:46:19.000000000 +0000 +++ ./configure 2019-03-17 23:05:48.786527661 +0000 @@ -6401,7 +6401,7 @@ LTFLAGS='--silent' fi my_libtool=`$apr_config --apr-libtool` - LIBTOOL="$my_libtool \$(LTFLAGS)" + LIBTOOL="bash $my_libtool \$(LTFLAGS)" - libtoolversion=`$my_libtool --version` + libtoolversion=`bash $my_libtool --version` case $libtoolversion in *1.[45]* | *[2-9].[0-9]*) ================================================ FILE: packages/apg/Makefile.patch ================================================ diff -uNr apg-2.3.0b/Makefile apg-2.3.0b.mod/Makefile --- apg-2.3.0b/Makefile 2003-08-07 18:40:39.000000000 +0300 +++ apg-2.3.0b.mod/Makefile 2019-05-20 02:04:28.641201031 +0300 @@ -1,19 +1,19 @@ ################################################################## # Directories # Install dirs -INSTALL_PREFIX = /usr/local +INSTALL_PREFIX = @TERMUX_PREFIX@ # Full default path is /usr/local/bin APG_BIN_DIR = /bin # Full default path is /usr/local/man/man1 -APG_MAN_DIR = /man/man1 +APG_MAN_DIR = /share/man/man1 # Full default path is /usr/local/sbin -APGD_BIN_DIR = /sbin +APGD_BIN_DIR = $(APG_BIN_DIR) # Full default path is /usr/local/man/man8 -APGD_MAN_DIR = /man/man8 +APGD_MAN_DIR = /share/man/man8 # You should not edit 2 lines below APGBFM_CLIBS = -lm @@ -35,7 +35,7 @@ # This works on MacOS X # STANDALONE_OPTIONS += -DAPG_USE_CRYPT -APG_CLIBS += -lcrypt +APG_CLIBS += -L@TERMUX_PREFIX@/lib -lcrypt ################################################################## # Support for cracklib @@ -60,12 +60,12 @@ ################################################################## # You can modify CC variable if you have compiler other than GCC # But the code was designed and tested with GCC -CC = gcc +CC ?= gcc ################################################################## # Compilation flags # You should comment the line below for AIX+native cc -CFLAGS = -Wall +CFLAGS = -Wall -I@TERMUX_PREFIX@/include -Wl,-rpath=@TERMUX_PREFIX@/lib -Wl,--enable-new-dtags #################################################################### # If you plan to install APG daemon you should look at lines below # ================================================ FILE: packages/apg/build.sh ================================================ ## Note: APG project seems dead. Official homepage & src urls ## disappeared. TERMUX_PKG_HOMEPAGE=http://www.adel.nursat.kz/apg/index.shtml TERMUX_PKG_DESCRIPTION="Automated Password Generator" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=2.3.0b TERMUX_PKG_REVISION=4 TERMUX_PKG_SRCURL=https://dl.bintray.com/termux/upstream/apg-2.3.0b.tar.gz TERMUX_PKG_SHA256=d1e52029709e2d7f9cb99bedce3e02ee7a63cff7b8e2b4c2bc55b3dc03c28b92 TERMUX_PKG_DEPENDS="libcrypt" TERMUX_PKG_BUILD_IN_SRC=true termux_step_post_extract_package() { # Fix permissions. find "$TERMUX_PKG_SRCDIR" -type d -exec chmod 700 "{}" \; find "$TERMUX_PKG_SRCDIR" -type f -executable -exec chmod 700 "{}" \; find "$TERMUX_PKG_SRCDIR" -type f ! -executable -exec chmod 600 "{}" \; } ================================================ FILE: packages/apg/install-sh.patch ================================================ diff -uNr apg-2.2.3/install-sh apg-2.2.3.mod/install-sh --- apg-2.2.3/install-sh 2003-08-07 18:40:30.000000000 +0300 +++ apg-2.2.3.mod/install-sh 2019-01-28 21:07:56.823960998 +0200 @@ -35,9 +35,9 @@ mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" +chownprog="${CHOWNPROG-true}" +chgrpprog="${CHGRPPROG-true}" +stripprog="${STRIPPROG-true}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" ================================================ FILE: packages/apksigner/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/fornwall/apksigner TERMUX_PKG_DESCRIPTION="APK signing tool" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_VERSION=0.7 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=340560c4f75af3501f037452bcf184fa48fd18bc877a4cce9a51a3fa047b4b38 TERMUX_PKG_SRCURL=https://github.com/fornwall/apksigner/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_PLATFORM_INDEPENDENT=true termux_step_make() { mkdir -p $TERMUX_PREFIX/share/{dex,man/man1} cp apksigner.1 $TERMUX_PREFIX/share/man/man1/ GRADLE_OPTS=" -Dorg.gradle.daemon=false" ./gradlew $TERMUX_D8 \ --classpath $ANDROID_HOME/platforms/android-$TERMUX_PKG_API_LEVEL/android.jar \ --release \ --min-api $TERMUX_PKG_API_LEVEL \ --output $TERMUX_PKG_TMPDIR \ ./build/libs/src-all.jar cd $TERMUX_PKG_TMPDIR jar cf apksigner.jar classes.dex mv apksigner.jar $TERMUX_PREFIX/share/dex/apksigner.jar echo '#!/bin/sh' > $TERMUX_PREFIX/bin/apksigner echo "dalvikvm -cp $TERMUX_PREFIX/share/dex/apksigner.jar net.fornwall.apksigner.Main \$@" >> $TERMUX_PREFIX/bin/apksigner chmod +x $TERMUX_PREFIX/bin/apksigner } ================================================ FILE: packages/apr/Makefile.in.patch ================================================ diff -u -r ../apr-1.5.2/Makefile.in ./Makefile.in --- ../apr-1.5.2/Makefile.in 2014-04-25 06:51:11.000000000 -0400 +++ ./Makefile.in 2015-05-03 19:04:44.159616097 -0400 @@ -134,8 +134,9 @@ $(APR_MKDIR) tools $(LT_COMPILE) -tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char) - $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS) +tools/gen_test_char@EXEEXT@: tools/gen_test_char.c + $(CC_FOR_BUILD) -DCROSS_COMPILE -o $@ $< + include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@ $(APR_MKDIR) include/private ================================================ FILE: packages/apr/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://apr.apache.org/ TERMUX_PKG_DESCRIPTION="Apache Portable Runtime Library" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_VERSION=1.7.0 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=http://apache.mirrors.spacedump.net/apr/apr-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SHA256=e2e148f0b2e99b8e5c6caa09f6d4fb4dd3e83f744aa72a952f94f5a14436f7ea TERMUX_PKG_DEPENDS="libuuid" TERMUX_PKG_BREAKS="apr-dev" TERMUX_PKG_REPLACES="apr-dev" TERMUX_PKG_BUILD_IN_SRC=true # "ac_cv_search_crypt=" to avoid needlessly linking to libcrypt. TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --with-installbuilddir=$TERMUX_PREFIX/share/apr-1/build ac_cv_func_getrandom=no ac_cv_have_decl_SYS_getrandom=no ac_cv_file__dev_zero=yes ac_cv_func_setpgrp_void=yes apr_cv_process_shared_works=no apr_cv_tcp_nodelay_with_cork=yes ac_cv_sizeof_struct_iovec=$(( TERMUX_ARCH_BITS==32 ? 8 : 16 )) ac_cv_search_crypt=" TERMUX_PKG_RM_AFTER_INSTALL="lib/apr.exp" termux_step_post_make_install() { sed -i "s%NM=\".*%NM=\"${TERMUX_HOST_PLATFORM}-nm -B\"%g" $TERMUX_PREFIX/share/apr-1/build/libtool } ================================================ FILE: packages/apr-util/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://apr.apache.org/ TERMUX_PKG_DESCRIPTION="Apache Portable Runtime Utility Library" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_VERSION=1.6.1 TERMUX_PKG_REVISION=2 TERMUX_PKG_SHA256=d3e12f7b6ad12687572a3a39475545a072608f4ba03a6ce8a3778f607dd0035b TERMUX_PKG_SRCURL=http://apache.mirrors.spacedump.net/apr/apr-util-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_DEPENDS="apr, libcrypt, libexpat, libiconv, libuuid" TERMUX_PKG_BREAKS="apr-util-dev" TERMUX_PKG_REPLACES="apr-util-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" ac_cv_lib_pq_PQsendQueryPrepared=no --with-apr=$TERMUX_PREFIX --without-sqlite3 " TERMUX_PKG_RM_AFTER_INSTALL="lib/aprutil.exp" ================================================ FILE: packages/apt/0000-cmake-fix.patch ================================================ diff -uNr apt-1.4.9/apt-pkg/CMakeLists.txt apt-1.4.9.mod/apt-pkg/CMakeLists.txt --- apt-1.4.9/apt-pkg/CMakeLists.txt 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/apt-pkg/CMakeLists.txt 2019-11-12 22:32:19.117227283 +0200 @@ -48,13 +48,12 @@ ) target_link_libraries(apt-pkg - PRIVATE -lutil ${CMAKE_DL_LIBS} ${RESOLV_LIBRARIES} + PRIVATE ${CMAKE_DL_LIBS} ${RESOLV_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} ${LZMA_LIBRARIES} ${LZ4_LIBRARIES} - ${ICONV_LIBRARIES} ) set_target_properties(apt-pkg PROPERTIES VERSION ${MAJOR}.${MINOR}) set_target_properties(apt-pkg PROPERTIES SOVERSION ${MAJOR}) diff -uNr apt-1.4.9/CMakeLists.txt apt-1.4.9.mod/CMakeLists.txt --- apt-1.4.9/CMakeLists.txt 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/CMakeLists.txt 2019-11-12 22:32:24.393914821 +0200 @@ -4,6 +4,7 @@ # set minimum version project(apt) cmake_minimum_required(VERSION 3.4.0) +include(CheckSymbolExists) # Generic header locations include_directories(${PROJECT_BINARY_DIR}/include) @@ -33,7 +34,6 @@ include(GNUInstallDirs) include(TestBigEndian) find_package(Threads) -find_package(LFS REQUIRED) find_package(Iconv REQUIRED) find_package(Perl REQUIRED) @@ -44,11 +44,6 @@ include_directories(${Intl_INCLUDE_DIRS}) endif() -# Add large file support -add_compile_options(${LFS_COMPILE_OPTIONS}) -add_definitions(${LFS_DEFINITIONS}) -link_libraries(${LFS_LIBRARIES}) - # Set compiler flags set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -89,21 +77,12 @@ endif() -find_package(BZip2) -if (BZIP2_FOUND) - set(HAVE_BZ2 1) -endif() - find_package(LZMA) if (LZMA_FOUND) set(HAVE_LZMA 1) endif() -find_package(LZ4) -if (LZ4_FOUND) - set(HAVE_LZ4 1) -endif() # Mount()ing and stat()ing and friends check_symbol_exists(statfs sys/vfs.h HAVE_VFS_H) @@ -180,10 +159,10 @@ message(STATUS "Found dpkg data dir: ${DPKG_DATADIR_CMD}") set(DPKG_DATADIR "${DPKG_DATADIR_CMD}" CACHE PATH "dpkg data directory") endif() -if (NOT DEFINED COMMON_ARCH) - execute_process(COMMAND dpkg-architecture -qDEB_HOST_ARCH - OUTPUT_VARIABLE COMMON_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) -endif() +# if (NOT DEFINED COMMON_ARCH) +# execute_process(COMMAND dpkg-architecture -qDEB_HOST_ARCH + #OUTPUT_VARIABLE COMMON_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) +# endif() if (NOT DEFINED ROOT_GROUP) execute_process(COMMAND id -gn root OUTPUT_VARIABLE ROOT_GROUP OUTPUT_STRIP_TRAILING_WHITESPACE) @@ -211,11 +190,8 @@ add_subdirectory(apt-inst) add_subdirectory(cmdline) add_subdirectory(completions) -add_subdirectory(doc) add_subdirectory(dselect) -add_subdirectory(ftparchive) add_subdirectory(methods) -add_subdirectory(test) if (USE_NLS) add_subdirectory(po) diff -uNr apt-1.4.9/methods/CMakeLists.txt apt-1.4.9.mod/methods/CMakeLists.txt --- apt-1.4.9/methods/CMakeLists.txt 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/methods/CMakeLists.txt 2019-11-12 22:32:30.553939187 +0200 @@ -7,7 +7,7 @@ add_executable(http http.cc http_main.cc rfc2553emu.cc connect.cc basehttp.cc) add_executable(mirror mirror.cc http.cc rfc2553emu.cc connect.cc basehttp.cc) add_executable(https https.cc basehttp.cc) -add_executable(ftp ftp.cc rfc2553emu.cc connect.cc) +# add_executable(ftp ftp.cc rfc2553emu.cc connect.cc) add_executable(rred rred.cc) add_executable(rsh rsh.cc) @@ -23,12 +23,12 @@ target_link_libraries(http apt-pkg) target_link_libraries(mirror apt-pkg ${RESOLV_LIBRARIES}) target_link_libraries(https apt-pkg ${CURL_LIBRARIES}) -target_link_libraries(ftp apt-pkg) +#target_link_libraries(ftp apt-pkg) target_link_libraries(rred apt-pkg) target_link_libraries(rsh apt-pkg) # Install the library -install(TARGETS file copy store gpgv cdrom http https ftp rred rsh mirror +install(TARGETS file copy store gpgv cdrom http https rred rsh mirror RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/apt/methods) add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods store gzip lzma bzip2 xz) ================================================ FILE: packages/apt/0001-hardcoded-paths-fix.patch ================================================ diff -uNr apt-1.4.9/apt-pkg/aptconfiguration.cc apt-1.4.9.mod/apt-pkg/aptconfiguration.cc --- apt-1.4.9/apt-pkg/aptconfiguration.cc 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/apt-pkg/aptconfiguration.cc 2019-11-12 22:10:28.531994919 +0200 @@ -35,10 +35,10 @@ // setDefaultConfigurationForCompressors /*{{{*/ static void setDefaultConfigurationForCompressors() { // Set default application paths to check for optional compression types - _config->CndSet("Dir::Bin::gzip", "/bin/gzip"); - _config->CndSet("Dir::Bin::bzip2", "/bin/bzip2"); - _config->CndSet("Dir::Bin::xz", "/usr/bin/xz"); - _config->CndSet("Dir::Bin::lz4", "/usr/bin/lz4"); + _config->CndSet("Dir::Bin::gzip", "@TERMUX_PREFIX@/bin/gzip"); + _config->CndSet("Dir::Bin::bzip2", "@TERMUX_PREFIX@/bin/bzip2"); + _config->CndSet("Dir::Bin::xz", "@TERMUX_PREFIX@/bin/xz"); + _config->CndSet("Dir::Bin::lz4", "@TERMUX_PREFIX@/bin/lz4"); if (FileExists(_config->Find("Dir::Bin::xz")) == true) { _config->Set("Dir::Bin::lzma", _config->Find("Dir::Bin::xz")); _config->Set("APT::Compressor::lzma::Binary", "xz"); @@ -51,7 +51,7 @@ _config->Set("APT::Compressor::lzma::UncompressArg::", "-d"); } } else { - _config->CndSet("Dir::Bin::lzma", "/usr/bin/lzma"); + _config->CndSet("Dir::Bin::lzma", "@TERMUX_PREFIX@/bin/lzma"); if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) { _config->Set("APT::Compressor::lzma::CompressArg::", "--suffix="); _config->Set("APT::Compressor::lzma::CompressArg::", "-6"); diff -uNr apt-1.4.9/apt-pkg/contrib/cdromutl.cc apt-1.4.9.mod/apt-pkg/contrib/cdromutl.cc --- apt-1.4.9/apt-pkg/contrib/cdromutl.cc 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/apt-pkg/contrib/cdromutl.cc 2019-11-12 22:10:38.788703372 +0200 @@ -268,7 +268,7 @@ string FindMountPointForDevice(const char *devnode) { // this is the order that mount uses as well - std::vector const mounts = _config->FindVector("Dir::state::MountPoints", "/etc/mtab,/proc/mount"); + std::vector const mounts = _config->FindVector("Dir::state::MountPoints", "@TERMUX_PREFIX@/etc/mtab,/proc/mount"); for (std::vector::const_iterator m = mounts.begin(); m != mounts.end(); ++m) if (FileExists(*m) == true) diff -uNr apt-1.4.9/apt-pkg/contrib/fileutl.cc apt-1.4.9.mod/apt-pkg/contrib/fileutl.cc --- apt-1.4.9/apt-pkg/contrib/fileutl.cc 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/apt-pkg/contrib/fileutl.cc 2019-11-12 22:12:25.625803839 +0200 @@ -106,7 +106,7 @@ _exit(100); } - if (chdir("/tmp/") != 0) + if (chdir("@TERMUX_PREFIX@/tmp/") != 0) _exit(100); unsigned int Count = 1; @@ -2790,10 +2790,10 @@ struct stat st; if (!tmpdir || strlen(tmpdir) == 0 || // tmpdir is set stat(tmpdir, &st) != 0 || (st.st_mode & S_IFDIR) == 0) // exists and is directory - tmpdir = "/tmp"; + tmpdir = "@TERMUX_PREFIX@/tmp"; else if (geteuid() != 0 && // root can do everything anyway faccessat(AT_FDCWD, tmpdir, R_OK | W_OK | X_OK, AT_EACCESS) != 0) // current user has rwx access to directory - tmpdir = "/tmp"; + tmpdir = "@TERMUX_PREFIX@/tmp"; return string(tmpdir); } @@ -3064,7 +3064,7 @@ setenv("LOGNAME", pw->pw_name, 1); auto const shell = flNotDir(pw->pw_shell); if (shell == "false" || shell == "nologin") - setenv("SHELL", "/bin/sh", 1); + setenv("SHELL", "@TERMUX_PREFIX@/bin/sh", 1); else setenv("SHELL", pw->pw_shell, 1); auto const apt_setenv_tmp = [](char const * const env) { diff -uNr apt-1.4.9/apt-pkg/deb/dpkgpm.cc apt-1.4.9.mod/apt-pkg/deb/dpkgpm.cc --- apt-1.4.9/apt-pkg/deb/dpkgpm.cc 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/apt-pkg/deb/dpkgpm.cc 2019-11-12 22:18:36.777295457 +0200 @@ -179,7 +179,7 @@ so we use the binary from util-linux */ static bool ionice(int PID) { - if (!FileExists("/usr/bin/ionice")) + if (!FileExists("@TERMUX_PREFIX@/bin/ionice")) return false; pid_t Process = ExecFork(); if (Process == 0) @@ -187,7 +187,7 @@ char buf[32]; snprintf(buf, sizeof(buf), "-p%d", PID); const char *Args[4]; - Args[0] = "/usr/bin/ionice"; + Args[0] = "@TERMUX_PREFIX@/bin/ionice"; Args[1] = "-c3"; Args[2] = buf; Args[3] = 0; @@ -483,7 +483,7 @@ debSystem::DpkgChrootDirectory(); const char *Args[4]; - Args[0] = "/bin/sh"; + Args[0] = "@TERMUX_PREFIX@/bin/sh"; Args[1] = "-c"; Args[2] = Opts->Value.c_str(); Args[3] = 0; @@ -2403,11 +2403,13 @@ fprintf(report, " %s: %s\n", pkgname.c_str(), opstr); } +// Android doesn't allow to use dmesg without root. +#ifndef __ANDROID__ // attach dmesg log (to learn about segfaults) - if (FileExists("/bin/dmesg")) + if (FileExists("@TERMUX_PREFIX@/bin/dmesg")) { fprintf(report, "Dmesg:\n"); - FILE *log = popen("/bin/dmesg","r"); + FILE *log = popen("@TERMUX_PREFIX@/bin/dmesg","r"); if(log != NULL) { char buf[1024]; @@ -2416,13 +2418,13 @@ pclose(log); } } +#endif - // attach df -l log (to learn about filesystem status) - if (FileExists("/bin/df")) + // attach df log (to learn about filesystem status) + if (FileExists("@TERMUX_PREFIX@/bin/df")) { - fprintf(report, "Df:\n"); - FILE *log = popen("/bin/df -l","r"); + FILE *log = popen("@TERMUX_PREFIX@/bin/df","r"); if(log != NULL) { char buf[1024]; diff -uNr apt-1.4.9/cmdline/apt-key.in apt-1.4.9.mod/cmdline/apt-key.in --- apt-1.4.9/cmdline/apt-key.in 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/cmdline/apt-key.in 2019-11-12 22:27:00.015963736 +0200 @@ -260,7 +260,7 @@ if accessible_file_exists "$TRUSTEDFILE"; then $ACTION "$TRUSTEDFILE" "$@" fi - local TRUSTEDPARTS="/etc/apt/trusted.gpg.d" + local TRUSTEDPARTS="@TERMUX_PREFIX@/etc/apt/trusted.gpg.d" eval "$(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)" if [ -d "$TRUSTEDPARTS" ]; then TRUSTEDPARTS="$(readlink -f "$TRUSTEDPARTS")" @@ -439,7 +439,7 @@ merge_all_trusted_keyrings_into_pubring FORCED_KEYRING="${GPGHOMEDIR}/forcedkeyid.gpg" TRUSTEDFILE="${FORCED_KEYRING}" - echo "#!/bin/sh + echo "#!@TERMUX_PREFIX@/bin/sh exec sh '($(escape_shell "${GPG}")' --keyring '$(escape_shell "${TRUSTEDFILE}")' \"\$@\"" > "${GPGHOMEDIR}/gpg.1.sh" GPG="${GPGHOMEDIR}/gpg.1.sh" # ignore error as this "just" means we haven't found the forced keyid and the keyring will be empty @@ -451,13 +451,13 @@ else touch "${GPGHOMEDIR}/pubring.gpg" "${GPGHOMEDIR}/pubring.orig.gpg" fi - echo "#!/bin/sh + echo "#!@TERMUX_PREFIX@/bin/sh exec sh '$(escape_shell "${GPG}")' --keyring '$(escape_shell "${GPGHOMEDIR}/pubring.gpg")' \"\$@\"" > "${GPGHOMEDIR}/gpg.1.sh" GPG="${GPGHOMEDIR}/gpg.1.sh" else TRUSTEDFILE="$(dearmor_filename "$FORCED_KEYRING")" create_new_keyring "$TRUSTEDFILE" - echo "#!/bin/sh + echo "#!@TERMUX_PREFIX@/bin/sh exec sh '$(escape_shell "${GPG}")' --keyring '$(escape_shell "${TRUSTEDFILE}")' \"\$@\"" > "${GPGHOMEDIR}/gpg.1.sh" GPG="${GPGHOMEDIR}/gpg.1.sh" fi @@ -542,7 +542,7 @@ done if [ -z "$TRUSTEDFILE" ]; then - TRUSTEDFILE="/etc/apt/trusted.gpg" + TRUSTEDFILE="@TERMUX_PREFIX@/etc/apt/trusted.gpg" eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring) eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f) fi @@ -612,7 +612,7 @@ unset TMPDIR fi fi - GPGHOMEDIR="$(mktemp --directory --tmpdir 'apt-key-gpghome.XXXXXXXXXX')" + GPGHOMEDIR="$(mktemp -d -t 'apt-key-gpghome.XXXXXXXXXX')" CURRENTTRAP="${CURRENTTRAP} cleanup_gpg_home;" trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM if [ -z "$GPGHOMEDIR" ]; then @@ -654,7 +654,7 @@ create_gpg_home # now tell gpg that it shouldn't try to maintain this trustdb file - echo "#!/bin/sh + echo "#!@TERMUX_PREFIX@/bin/sh exec '$(escape_shell "${GPG_EXE}")' --ignore-time-conflict --no-options --no-default-keyring \\ --homedir '$(escape_shell "${GPGHOMEDIR}")' --no-auto-check-trustdb --trust-model always \"\$@\"" > "${GPGHOMEDIR}/gpg.0.sh" GPG_SH="${GPGHOMEDIR}/gpg.0.sh" ================================================ FILE: packages/apt/0002-glob.patch ================================================ diff -uNr apt-1.4.9/apt-pkg/contrib/fileutl.cc apt-1.4.9.mod/apt-pkg/contrib/fileutl.cc --- apt-1.4.9/apt-pkg/contrib/fileutl.cc 2019-11-12 22:12:25.625803839 +0200 +++ apt-1.4.9.mod/apt-pkg/contrib/fileutl.cc 2019-11-12 22:36:46.021615823 +0200 @@ -46,7 +46,9 @@ #include #include #include +#ifndef __ANDROID__ #include +#endif #include #include @@ -2752,6 +2754,7 @@ } /*}}}*/ +#ifndef __ANDROID__ // Glob - wrapper around "glob()" /*{{{*/ std::vector Glob(std::string const &pattern, int flags) { @@ -2777,6 +2780,7 @@ globfree(&globbuf); return result; } +#endif /*}}}*/ static std::string APT_NONNULL(1) GetTempDirEnv(char const * const env) /*{{{*/ { diff -uNr apt-1.4.9/apt-pkg/contrib/fileutl.h apt-1.4.9.mod/apt-pkg/contrib/fileutl.h --- apt-1.4.9/apt-pkg/contrib/fileutl.h 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/apt-pkg/contrib/fileutl.h 2019-11-12 22:36:46.021615823 +0200 @@ -239,7 +239,9 @@ APT_HIDDEN std::string flNormalize(std::string file); // simple c++ glob +#ifndef __ANDROID__ std::vector Glob(std::string const &pattern, int flags=0); +#endif /** \brief Popen() implementation that execv() instead of using a shell * ================================================ FILE: packages/apt/0003-langinfo-and-codeset.patch ================================================ diff -uNr apt-1.4.9/apt-pkg/contrib/strutl.cc apt-1.4.9.mod/apt-pkg/contrib/strutl.cc --- apt-1.4.9/apt-pkg/contrib/strutl.cc 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/apt-pkg/contrib/strutl.cc 2019-11-12 22:39:32.592335551 +0200 @@ -100,6 +100,7 @@ } } /*}}}*/ +#ifndef __ANDROID__ // UTF8ToCodeset - Convert some UTF-8 string for some codeset /*{{{*/ // --------------------------------------------------------------------- /* This is handy to use before display some information for enduser */ @@ -169,6 +170,7 @@ return true; } +#endif /*}}}*/ // strstrip - Remove white space from the front and back of a string /*{{{*/ // --------------------------------------------------------------------- diff -uNr apt-1.4.9/apt-pkg/deb/debrecords.cc apt-1.4.9.mod/apt-pkg/deb/debrecords.cc --- apt-1.4.9/apt-pkg/deb/debrecords.cc 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/apt-pkg/deb/debrecords.cc 2019-11-12 22:39:37.975693094 +0200 @@ -25,7 +25,9 @@ #include #include #include +#ifndef __ANDROID__ #include +#endif #include /*}}}*/ @@ -152,12 +154,14 @@ orig = Section.FindS("Description"); } +#ifndef __ANDROID__ char const * const codeset = nl_langinfo(CODESET); if (strcmp(codeset,"UTF-8") != 0) { string dest; UTF8ToCodeset(codeset, orig, &dest); return dest; } +#endif return orig; } diff -uNr apt-1.4.9/apt-private/private-output.cc apt-1.4.9.mod/apt-private/private-output.cc --- apt-1.4.9/apt-private/private-output.cc 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/apt-private/private-output.cc 2019-11-12 22:39:43.812385978 +0200 @@ -20,7 +20,11 @@ #include #include #include -#include +#ifdef __ANDROID__ +# include +# else +# include +#endif #include #include #include @@ -717,7 +721,7 @@ regex_t Pattern; int Res; - Res = regcomp(&Pattern, nl_langinfo(YESEXPR), + Res = regcomp(&Pattern, "^[yY]", REG_EXTENDED|REG_ICASE|REG_NOSUB); if (Res != 0) { ================================================ FILE: packages/apt/0004-srv-records.patch ================================================ diff -uNr apt-1.4.9/apt-pkg/contrib/srvrec.cc apt-1.4.9.mod/apt-pkg/contrib/srvrec.cc --- apt-1.4.9/apt-pkg/contrib/srvrec.cc 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/apt-pkg/contrib/srvrec.cc 2019-11-12 22:41:25.142836445 +0200 @@ -40,14 +40,24 @@ struct servent *s_ent = nullptr; std::vector buf(1024); +#ifdef __ANDROID__ + s_ent = getservbyport(htons(port), "tcp"); + if (s_ent == nullptr) return false; +#else res = getservbyport_r(htons(port), "tcp", &s_ent_buf, buf.data(), buf.size(), &s_ent); if (res != 0 || s_ent == nullptr) return false; +#endif strprintf(target, "_%s._tcp.%s", s_ent->s_name, host.c_str()); return GetSrvRecords(target, Result); } +#ifdef __ANDROID__ +extern "C" int __dn_skipname(const unsigned char* comp_dn, const unsigned char* eom); +static inline int dn_skipname(const unsigned char* a, const unsigned char* b) { return __dn_skipname(a,b); } +#endif + bool GetSrvRecords(std::string name, std::vector &Result) { unsigned char answer[PACKETSZ]; diff -uNr apt-1.4.9/methods/connect.cc apt-1.4.9.mod/methods/connect.cc --- apt-1.4.9/methods/connect.cc 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/methods/connect.cc 2019-11-12 22:41:29.396188505 +0200 @@ -129,7 +129,7 @@ // Check the socket for an error condition unsigned int Err; - unsigned int Len = sizeof(Err); + socklen_t Len = sizeof(Err); if (getsockopt(Fd,SOL_SOCKET,SO_ERROR,&Err,&Len) != 0) return _error->Errno("getsockopt",_("Failed")); @@ -301,7 +301,10 @@ if(LastHost != Host || LastPort != Port) { SrvRecords.clear(); - if (_config->FindB("Acquire::EnableSrvRecords", true) == true) + /* Disable by default in Termux due to it breaking on (some) HTC + devices (https://github.com/termux/termux-packages/issues/99). */ + + if (_config->FindB("Acquire::EnableSrvRecords", false) == true) { GetSrvRecords(Host, DefPort, SrvRecords); // RFC2782 defines that a lonely '.' target is an abort reason ================================================ FILE: packages/apt/0005-http2-fix.patch ================================================ diff -uNr apt-1.4.9/methods/basehttp.cc apt-1.4.9.mod/methods/basehttp.cc --- apt-1.4.9/methods/basehttp.cc 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/methods/basehttp.cc 2019-11-12 22:43:18.109996205 +0200 @@ -90,7 +90,12 @@ // Evil servers return no version if (Line[4] == '/') { - int const elements = sscanf(Line.c_str(),"HTTP/%3u.%3u %3u%359[^\n]",&Major,&Minor,&Result,Code); + int elements = sscanf(Line.c_str(),"HTTP/%3u %3u[^\n]",&Major,&Result); + if (elements == 2 && Major == 2) { + Minor = 0; + Code[0] = '\0'; + } else { + elements = sscanf(Line.c_str(),"HTTP/%3u.%3u %3u%359[^\n]",&Major,&Minor,&Result,Code); if (elements == 3) { Code[0] = '\0'; @@ -99,6 +104,7 @@ } else if (elements != 4) return _error->Error(_("The HTTP server sent an invalid reply header")); + } } else { ================================================ FILE: packages/apt/0006-apt-key-nonroot.patch ================================================ diff -uNr apt-1.4.9/cmdline/apt-key.in apt-1.4.9.mod/cmdline/apt-key.in --- apt-1.4.9/cmdline/apt-key.in 2019-11-12 22:27:00.015963736 +0200 +++ apt-1.4.9.mod/cmdline/apt-key.in 2019-11-12 22:46:00.284024293 +0200 @@ -16,10 +16,7 @@ aptkey_echo() { echo "$@"; } requires_root() { - if [ "$(id -u)" -ne 0 ]; then - apt_error "This command can only be used by root." - exit 1 - fi + : } command_available() { ================================================ FILE: packages/apt/0007-termux-apt-vendor.patch ================================================ diff -uNr apt-1.4.9/vendor/ubuntu/apt-vendor.ent apt-1.4.9.mod/vendor/ubuntu/apt-vendor.ent --- apt-1.4.9/vendor/ubuntu/apt-vendor.ent 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/vendor/ubuntu/apt-vendor.ent 2019-11-12 22:53:10.802486744 +0200 @@ -1,9 +1,9 @@ - -ubuntu-keyring"> -/usr/share/keyrings/ubuntu-archive-keyring.gpg"> -/usr/share/keyrings/ubuntu-archive-removed-keys.gpg"> - + +termux-keyring"> +@TERMUX_PREFIX@/share/keyrings/termux-archive-keyring.gpg"> +@TERMUX_PREFIX@/share/keyrings/termux-archive-removed-keys.gpg"> + Error(_("Unable to determine a suitable packaging system type")); } - if (pkgInitArchTupleMap() == false) - return false; return Sys->Initialize(Cnf); } ================================================ FILE: packages/apt/0009-fix-macro-redefinition.patch ================================================ diff -uNr apt-1.4.9/apt-private/private-download.cc apt-1.4.9.mod/apt-private/private-download.cc --- apt-1.4.9/apt-private/private-download.cc 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/apt-private/private-download.cc 2019-11-13 14:22:40.305931068 +0200 @@ -127,7 +127,6 @@ /*}}}*/ bool CheckFreeSpaceBeforeDownload(std::string const &Dir, unsigned long long FetchBytes)/*{{{*/ { - uint32_t const RAMFS_MAGIC = 0x858458f6; /* Check for enough free space, but only if we are actually going to download */ if (_config->FindB("APT::Get::Print-URIs", false) == true || ================================================ FILE: packages/apt/0010-prevent-usage-as-root.patch ================================================ diff -uNr apt-1.4.9/cmdline/apt.cc apt-1.4.9.mod/cmdline/apt.cc --- apt-1.4.9/cmdline/apt.cc 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/cmdline/apt.cc 2019-11-13 14:55:50.954692940 +0200 @@ -97,6 +97,12 @@ /*}}}*/ int main(int argc, const char *argv[]) /*{{{*/ { + if (getuid() == 0) { + std::cout << "You should not use command 'apt' as root." << std::endl; + std::cout << "This is dangerous as may damage your Termux installation and data." << std::endl; + return 1; + } + CommandLine CmdL; auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT, &_config, &_system, argc, argv, &ShowHelp, &GetCommands); diff -uNr apt-1.4.9/cmdline/apt-get.cc apt-1.4.9.mod/cmdline/apt-get.cc --- apt-1.4.9/cmdline/apt-get.cc 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/cmdline/apt-get.cc 2019-11-13 14:55:50.954692940 +0200 @@ -432,6 +432,12 @@ /*}}}*/ int main(int argc,const char *argv[]) /*{{{*/ { + if (getuid() == 0) { + std::cout << "You should not use command 'apt-get' as root." << std::endl; + std::cout << "This is dangerous as may damage your Termux installation and data." << std::endl; + return 1; + } + // Parse the command line and initialize the package library CommandLine CmdL; auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT_GET, &_config, &_system, argc, argv, &ShowHelp, &GetCommands); diff -uNr apt-1.4.9/cmdline/apt-key.in apt-1.4.9.mod/cmdline/apt-key.in --- apt-1.4.9/cmdline/apt-key.in 2019-11-13 14:55:25.431240010 +0200 +++ apt-1.4.9.mod/cmdline/apt-key.in 2019-11-13 15:04:25.853655116 +0200 @@ -15,8 +15,11 @@ aptkey_echo() { echo "$@"; } -requires_root() { - : +assert_no_root() { + if [ "$(id -u)" = "0" ]; then + apt_error "Refusing to run 'apt-key' as root to prevent damage to your Termux installation." + exit 1 + fi } command_available() { @@ -510,7 +513,6 @@ create_new_keyring() { if [ ! -r "$FORCED_KEYRING" ]; then TRUSTEDFILE='/dev/null'; FORCED_KEYRING="$TRUSTEDFILE"; fi; } ;; --fakeroot) - requires_root() { true; } ;; --quiet) aptkey_echo() { true; } @@ -706,7 +708,7 @@ case "$command" in add) warn_on_script_usage - requires_root + assert_no_root setup_merged_keyring aptkey_execute "$GPG" --quiet --batch --import "$@" merge_back_changes @@ -714,19 +716,19 @@ ;; del|rm|remove) # no script warning here as removing 'add' usage needs 'del' for cleanup - requires_root + assert_no_root foreach_keyring_do 'remove_key_from_keyring' "$@" aptkey_echo "OK" ;; update) warn_on_script_usage - requires_root + assert_no_root setup_merged_keyring update merge_back_changes ;; net-update) - requires_root + assert_no_root setup_merged_keyring net_update merge_back_changes diff -uNr apt-1.4.9/cmdline/apt-mark.cc apt-1.4.9.mod/cmdline/apt-mark.cc --- apt-1.4.9/cmdline/apt-mark.cc 2019-01-18 12:42:07.000000000 +0200 +++ apt-1.4.9.mod/cmdline/apt-mark.cc 2019-11-13 14:55:50.958026289 +0200 @@ -316,6 +316,12 @@ /*}}}*/ int main(int argc,const char *argv[]) /*{{{*/ { + if (getuid() == 0) { + std::cout << "You should not use command 'apt-mark' as root." << std::endl; + std::cout << "This is dangerous as may damage your Termux installation and data." << std::endl; + return 1; + } + CommandLine CmdL; auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT_MARK, &_config, &_system, argc, argv, &ShowHelp, &GetCommands); ================================================ FILE: packages/apt/apt-ftparchive.subpackage.sh ================================================ TERMUX_SUBPKG_DESCRIPTION="apt-ftparchive is the command line tool that generates the index files that APT uses to access a distribution source" TERMUX_SUBPKG_DEPENDS="libdb" TERMUX_SUBPKG_INCLUDE=" bin/apt-ftparchive " ================================================ FILE: packages/apt/apt-transport-tor.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE=" lib/apt/methods/tor lib/apt/methods/tor+http lib/apt/methods/tor+https " TERMUX_SUBPKG_DESCRIPTION="APT transport for anonymous package downloads via Tor" TERMUX_SUBPKG_DEPENDS="tor" TERMUX_SUBPKG_PLATFORM_INDEPENDENT=true ================================================ FILE: packages/apt/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://packages.debian.org/apt TERMUX_PKG_DESCRIPTION="Front-end for the dpkg package manager" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.4.9 TERMUX_PKG_REVISION=24 TERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/a/apt/apt_${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=d4d65e7c84da86f3e6dcc933bba46a08db429c9d933b667c864f5c0e880bac0d # apt-key requires utilities from coreutils, findutils, gpgv, grep, sed. TERMUX_PKG_DEPENDS="coreutils, dpkg, findutils, gpgv, grep, libc++, libcurl, liblzma, sed, termux-licenses, zlib" TERMUX_PKG_CONFLICTS="apt-transport-https, libapt-pkg" TERMUX_PKG_REPLACES="apt-transport-https, libapt-pkg" TERMUX_PKG_RECOMMENDS="game-repo, science-repo" TERMUX_PKG_SUGGESTS="gnupg, unstable-repo, x11-repo" TERMUX_PKG_ESSENTIAL=true TERMUX_PKG_CONFFILES=" etc/apt/sources.list etc/apt/trusted.gpg " TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DPERL_EXECUTABLE=$(which perl) -DCMAKE_INSTALL_FULL_LOCALSTATEDIR=$TERMUX_PREFIX -DCOMMON_ARCH=$TERMUX_ARCH -DDPKG_DATADIR=$TERMUX_PREFIX/share/dpkg -DUSE_NLS=OFF -DWITH_DOC=OFF " # ubuntu uses instead $PREFIX/lib instead of $PREFIX/libexec to # "Work around bug in GNUInstallDirs" (from apt 1.4.8 CMakeLists.txt). # Archlinux uses $PREFIX/libexec though, so let's force libexec->lib to # get same build result on ubuntu and archlinux. TERMUX_PKG_EXTRA_CONFIGURE_ARGS+="-DCMAKE_INSTALL_LIBEXECDIR=lib" TERMUX_PKG_RM_AFTER_INSTALL=" bin/apt-cdrom bin/apt-extracttemplates bin/apt-sortpkgs etc/apt/apt.conf.d lib/apt/methods/bzip2 lib/apt/methods/cdrom lib/apt/methods/mirror lib/apt/methods/rred lib/apt/planners/ lib/apt/solvers/ lib/dpkg/ " termux_step_pre_configure() { # Certain packages are not safe to build on device because their # build.sh script deletes specific files in $TERMUX_PREFIX. if $TERMUX_ON_DEVICE_BUILD; then termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds." fi } termux_step_post_make_install() { printf "# The main termux repository:\ndeb https://dl.bintray.com/andronixapp/termux-packages-24 stable main\n" > $TERMUX_PREFIX/etc/apt/sources.list cp $TERMUX_PKG_BUILDER_DIR/trusted.gpg $TERMUX_PREFIX/etc/apt/ # apt-transport-tor ln -sfr $TERMUX_PREFIX/lib/apt/methods/http $TERMUX_PREFIX/lib/apt/methods/tor ln -sfr $TERMUX_PREFIX/lib/apt/methods/http $TERMUX_PREFIX/lib/apt/methods/tor+http ln -sfr $TERMUX_PREFIX/lib/apt/methods/https $TERMUX_PREFIX/lib/apt/methods/tor+https # man pages mkdir -p $TERMUX_PREFIX/share/man/ cp -Rf $TERMUX_PKG_BUILDER_DIR/man/* $TERMUX_PREFIX/share/man/ } ================================================ FILE: packages/apt/man/man5/apt.conf.5 ================================================ '\" t .\" Title: apt.conf .\" Author: Jason Gunthorpe .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 25\ \&November\ \&2016 .\" Manual: APT .\" Source: APT 1.4.9 .\" Language: English .\" .TH "APT\&.CONF" "5" "25\ \&November\ \&2016" "APT 1.4.9" "APT" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" apt.conf \- Configuration file for APT .SH "DESCRIPTION" .PP /etc/apt/apt\&.conf is the main configuration file shared by all the tools in the APT suite of tools, though it is by no means the only place options can be set\&. The suite also shares a common command line parser to provide a uniform environment\&. .PP When an APT tool starts up it will read the configuration files in the following order: .sp .RS 4 .ie n \{\ \h'-04' 1.\h'+01'\c .\} .el \{\ .sp -1 .IP " 1." 4.2 .\} the file specified by the \fBAPT_CONFIG\fR environment variable (if any) .RE .sp .RS 4 .ie n \{\ \h'-04' 2.\h'+01'\c .\} .el \{\ .sp -1 .IP " 2." 4.2 .\} all files in Dir::Etc::Parts in alphanumeric ascending order which have either no or "conf" as filename extension and which only contain alphanumeric, hyphen (\-), underscore (_) and period (\&.) characters\&. Otherwise APT will print a notice that it has ignored a file, unless that file matches a pattern in the Dir::Ignore\-Files\-Silently configuration list \- in which case it will be silently ignored\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 3.\h'+01'\c .\} .el \{\ .sp -1 .IP " 3." 4.2 .\} the main configuration file specified by Dir::Etc::main .RE .sp .RS 4 .ie n \{\ \h'-04' 4.\h'+01'\c .\} .el \{\ .sp -1 .IP " 4." 4.2 .\} all options set in the binary specific configuration subtree are moved into the root of the tree\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 5.\h'+01'\c .\} .el \{\ .sp -1 .IP " 5." 4.2 .\} the command line options are applied to override the configuration directives or to load even more configuration files\&. .RE .SH "SYNTAX" .PP The configuration file is organized in a tree with options organized into functional groups\&. Option specification is given with a double colon notation; for instance APT::Get::Assume\-Yes is an option within the APT tool group, for the Get tool\&. Options do not inherit from their parent groups\&. .PP Syntactically the configuration language is modeled after what the ISC tools such as bind and dhcp use\&. Lines starting with // are treated as comments (ignored), as well as all text between /* and */, just like C/C++ comments\&. Each line is of the form APT::Get::Assume\-Yes "true";\&. The quotation marks and trailing semicolon are required\&. The value must be on one line, and there is no kind of string concatenation\&. Values must not include backslashes or extra quotation marks\&. Option names are made up of alphanumeric characters and the characters "/\-:\&._+"\&. A new scope can be opened with curly braces, like this: .sp .if n \{\ .RS 4 .\} .nf APT { Get { Assume\-Yes "true"; Fix\-Broken "true"; }; }; .fi .if n \{\ .RE .\} .PP with newlines placed to make it more readable\&. Lists can be created by opening a scope and including a single string enclosed in quotes followed by a semicolon\&. Multiple entries can be included, separated by a semicolon\&. .sp .if n \{\ .RS 4 .\} .nf DPkg::Pre\-Install\-Pkgs {"/usr/sbin/dpkg\-preconfigure \-\-apt";}; .fi .if n \{\ .RE .\} .PP In general the sample configuration file /usr/share/doc/apt/examples/configure\-index\&.gz is a good guide for how it should look\&. .PP Case is not significant in names of configuration items, so in the previous example you could use dpkg::pre\-install\-pkgs\&. .PP Names for the configuration items are optional if a list is defined as can be seen in the DPkg::Pre\-Install\-Pkgs example above\&. If you don\*(Aqt specify a name a new entry will simply add a new option to the list\&. If you specify a name you can override the option in the same way as any other option by reassigning a new value to the option\&. .PP Two special commands are defined: #include (which is deprecated and not supported by alternative implementations) and #clear\&. #include will include the given file, unless the filename ends in a slash, in which case the whole directory is included\&. #clear is used to erase a part of the configuration tree\&. The specified element and all its descendants are erased\&. (Note that these lines also need to end with a semicolon\&.) .PP The #clear command is the only way to delete a list or a complete scope\&. Reopening a scope (or using the syntax described below with an appended ::) will \fInot\fR override previously written entries\&. Options can only be overridden by addressing a new value to them \- lists and scopes can\*(Aqt be overridden, only cleared\&. .PP All of the APT tools take an \-o option which allows an arbitrary configuration directive to be specified on the command line\&. The syntax is a full option name (APT::Get::Assume\-Yes for instance) followed by an equals sign then the new value of the option\&. To append a new element to a list, add a trailing :: to the name of the list\&. (As you might suspect, the scope syntax can\*(Aqt be used on the command line\&.) .PP Note that appending items to a list using :: only works for one item per line, and that you should not use it in combination with the scope syntax (which adds :: implicitly)\&. Using both syntaxes together will trigger a bug which some users unfortunately depend on: an option with the unusual name "::" which acts like every other option with a name\&. This introduces many problems; for one thing, users who write multiple lines in this \fIwrong\fR syntax in the hope of appending to a list will achieve the opposite, as only the last assignment for this option "::" will be used\&. Future versions of APT will raise errors and stop working if they encounter this misuse, so please correct such statements now while APT doesn\*(Aqt explicitly complain about them\&. .SH "THE APT GROUP" .PP This group of options controls general APT behavior as well as holding the options for all of the tools\&. .PP \fBArchitecture\fR .RS 4 System Architecture; sets the architecture to use when fetching files and parsing package lists\&. The internal default is the architecture apt was compiled for\&. .RE .PP \fBArchitectures\fR .RS 4 All Architectures the system supports\&. For instance, CPUs implementing the amd64 (also called x86\-64) instruction set are also able to execute binaries compiled for the i386 (x86) instruction set\&. This list is used when fetching files and parsing package lists\&. The initial default is always the system\*(Aqs native architecture (APT::Architecture), and foreign architectures are added to the default list when they are registered via \fBdpkg \-\-add\-architecture\fR\&. .RE .PP \fBCompressor\fR .RS 4 This scope defines which compression formats are supported, how compression and decompression can be performed if support for this format isn\*(Aqt built into apt directly and a cost\-value indicating how costly it is to compress something in this format\&. As an example the following configuration stanza would allow apt to download and uncompress as well as create and store files with the low\-cost \&.reversed file extension which it will pass to the command \fBrev\fR without additional commandline parameters for compression and uncompression: .sp .if n \{\ .RS 4 .\} .nf APT::Compressor::rev { Name "rev"; Extension "\&.reversed"; Binary "rev"; CompressArg {}; UncompressArg {}; Cost "10"; }; .fi .if n \{\ .RE .\} .RE .PP \fBBuild\-Profiles\fR .RS 4 List of all build profiles enabled for build\-dependency resolution, without the "profile\&." namespace prefix\&. By default this list is empty\&. The \fBDEB_BUILD_PROFILES\fR as used by \fBdpkg-buildpackage\fR(1) overrides the list notation\&. .RE .PP \fBDefault\-Release\fR .RS 4 Default release to install packages from if more than one version is available\&. Contains release name, codename or release version\&. Examples: \*(Aqstable\*(Aq, \*(Aqtesting\*(Aq, \*(Aqunstable\*(Aq, \*(Aqstretch\*(Aq, \*(Aqbuster\*(Aq, \*(Aq4\&.0\*(Aq, \*(Aq5\&.0*\*(Aq\&. See also \fBapt_preferences\fR(5)\&. .RE .PP \fBIgnore\-Hold\fR .RS 4 Ignore held packages; this global option causes the problem resolver to ignore held packages in its decision making\&. .RE .PP \fBClean\-Installed\fR .RS 4 Defaults to on\&. When turned on the autoclean feature will remove any packages which can no longer be downloaded from the cache\&. If turned off then packages that are locally installed are also excluded from cleaning \- but note that APT provides no direct means to reinstall them\&. .RE .PP \fBImmediate\-Configure\fR .RS 4 Defaults to on, which will cause APT to install essential and important packages as soon as possible in an install/upgrade operation, in order to limit the effect of a failing \fBdpkg\fR(1) call\&. If this option is disabled, APT treats an important package in the same way as an extra package: between the unpacking of the package A and its configuration there can be many other unpack or configuration calls for other unrelated packages B, C etc\&. If these cause the \fBdpkg\fR(1) call to fail (e\&.g\&. because package B\*(Aqs maintainer scripts generate an error), this results in a system state in which package A is unpacked but unconfigured \- so any package depending on A is now no longer guaranteed to work, as its dependency on A is no longer satisfied\&. .sp The immediate configuration marker is also applied in the potentially problematic case of circular dependencies, since a dependency with the immediate flag is equivalent to a Pre\-Dependency\&. In theory this allows APT to recognise a situation in which it is unable to perform immediate configuration, abort, and suggest to the user that the option should be temporarily deactivated in order to allow the operation to proceed\&. Note the use of the word "theory" here; in the real world this problem has rarely been encountered, in non\-stable distribution versions, and was caused by wrong dependencies of the package in question or by a system in an already broken state; so you should not blindly disable this option, as the scenario mentioned above is not the only problem it can help to prevent in the first place\&. .sp Before a big operation like dist\-upgrade is run with this option disabled you should try to explicitly install the package APT is unable to configure immediately; but please make sure you also report your problem to your distribution and to the APT team with the buglink below, so they can work on improving or correcting the upgrade process\&. .RE .PP \fBForce\-LoopBreak\fR .RS 4 Never enable this option unless you \fIreally\fR know what you are doing\&. It permits APT to temporarily remove an essential package to break a Conflicts/Conflicts or Conflicts/Pre\-Depends loop between two essential packages\&. \fISuch a loop should never exist and is a grave bug\fR\&. This option will work if the essential packages are not \fBtar\fR, \fBgzip\fR, \fBlibc\fR, \fBdpkg\fR, \fBdash\fR or anything that those packages depend on\&. .RE .PP \fBCache\-Start\fR, \fBCache\-Grow\fR, \fBCache\-Limit\fR .RS 4 APT uses since version 0\&.7\&.26 a resizable memory mapped cache file to store the available information\&. Cache\-Start acts as a hint of the size the cache will grow to, and is therefore the amount of memory APT will request at startup\&. The default value is 20971520 bytes (~20 MB)\&. Note that this amount of space needs to be available for APT; otherwise it will likely fail ungracefully, so for memory restricted devices this value should be lowered while on systems with a lot of configured sources it should be increased\&. Cache\-Grow defines in bytes with the default of 1048576 (~1 MB) how much the cache size will be increased in the event the space defined by Cache\-Start is not enough\&. This value will be applied again and again until either the cache is big enough to store all information or the size of the cache reaches the Cache\-Limit\&. The default of Cache\-Limit is 0 which stands for no limit\&. If Cache\-Grow is set to 0 the automatic growth of the cache is disabled\&. .RE .PP \fBBuild\-Essential\fR .RS 4 Defines which packages are considered essential build dependencies\&. .RE .PP \fBGet\fR .RS 4 The Get subsection controls the \fBapt-get\fR(8) tool; please see its documentation for more information about the options here\&. .RE .PP \fBCache\fR .RS 4 The Cache subsection controls the \fBapt-cache\fR(8) tool; please see its documentation for more information about the options here\&. .RE .PP \fBCDROM\fR .RS 4 The CDROM subsection controls the \fBapt-cdrom\fR(8) tool; please see its documentation for more information about the options here\&. .RE .SH "THE ACQUIRE GROUP" .PP The Acquire group of options controls the download of packages as well as the various "acquire methods" responsible for the download itself (see also \fBsources.list\fR(5))\&. .PP \fBCheck\-Valid\-Until\fR .RS 4 Security related option defaulting to true, as giving a Release file\*(Aqs validation an expiration date prevents replay attacks over a long timescale, and can also for example help users to identify mirrors that are no longer updated \- but the feature depends on the correctness of the clock on the user system\&. Archive maintainers are encouraged to create Release files with the Valid\-Until header, but if they don\*(Aqt or a stricter value is desired the Max\-ValidTime option below can be used\&. The \fBCheck\-Valid\-Until\fR option of \fBsources.list\fR(5) entries should be preferred to disable the check selectively instead of using this global override\&. .RE .PP \fBMax\-ValidTime\fR .RS 4 Maximum time (in seconds) after its creation (as indicated by the Date header) that the Release file should be considered valid\&. If the Release file itself includes a Valid\-Until header the earlier date of the two is used as the expiration date\&. The default value is 0 which stands for "valid forever"\&. Archive specific settings can be made by appending the label of the archive to the option name\&. Preferably, the same can be achieved for specific \fBsources.list\fR(5) entries by using the \fBValid\-Until\-Max\fR option there\&. .RE .PP \fBMin\-ValidTime\fR .RS 4 Minimum time (in seconds) after its creation (as indicated by the Date header) that the Release file should be considered valid\&. Use this if you need to use a seldom updated (local) mirror of a more frequently updated archive with a Valid\-Until header instead of completely disabling the expiration date checking\&. Archive specific settings can and should be used by appending the label of the archive to the option name\&. Preferably, the same can be achieved for specific \fBsources.list\fR(5) entries by using the \fBValid\-Until\-Min\fR option there\&. .RE .PP \fBPDiffs\fR .RS 4 Try to download deltas called PDiffs for indexes (like Packages files) instead of downloading whole ones\&. True by default\&. Preferably, this can be set for specific \fBsources.list\fR(5) entries or index files by using the \fBPDiffs\fR option there\&. .sp Two sub\-options to limit the use of PDiffs are also available: FileLimit can be used to specify a maximum number of PDiff files should be downloaded to update a file\&. SizeLimit on the other hand is the maximum percentage of the size of all patches compared to the size of the targeted file\&. If one of these limits is exceeded the complete file is downloaded instead of the patches\&. .RE .PP \fBBy\-Hash\fR .RS 4 Try to download indexes via an URI constructed from a hashsum of the expected file rather than downloaded via a well\-known stable filename\&. True by default, but automatically disabled if the source indicates no support for it\&. Usage can be forced with the special value "force"\&. Preferably, this can be set for specific \fBsources.list\fR(5) entries or index files by using the \fBBy\-Hash\fR option there\&. .RE .PP \fBQueue\-Mode\fR .RS 4 Queuing mode; Queue\-Mode can be one of host or access which determines how APT parallelizes outgoing connections\&. host means that one connection per target host will be opened, access means that one connection per URI type will be opened\&. .RE .PP \fBRetries\fR .RS 4 Number of retries to perform\&. If this is non\-zero APT will retry failed files the given number of times\&. .RE .PP \fBSource\-Symlinks\fR .RS 4 Use symlinks for source archives\&. If set to true then source archives will be symlinked when possible instead of copying\&. True is the default\&. .RE .PP \fBhttp\fR .RS 4 http::Proxy sets the default proxy to use for HTTP URIs\&. It is in the standard form of http://[[user][:pass]@]host[:port]/\&. Per host proxies can also be specified by using the form http::Proxy:: with the special keyword DIRECT meaning to use no proxies\&. If no one of the above settings is specified, \fBhttp_proxy\fR environment variable will be used\&. .sp Three settings are provided for cache control with HTTP/1\&.1 compliant proxy caches\&. No\-Cache tells the proxy not to use its cached response under any circumstances\&. Max\-Age sets the allowed maximum age (in seconds) of an index file in the cache of the proxy\&. No\-Store specifies that the proxy should not store the requested archive files in its cache, which can be used to prevent the proxy from polluting its cache with (big) \&.deb files\&. .sp The option timeout sets the timeout timer used by the method; this value applies to the connection as well as the data timeout\&. .sp The setting Acquire::http::Pipeline\-Depth can be used to enable HTTP pipelining (RFC 2616 section 8\&.1\&.2\&.2) which can be beneficial e\&.g\&. on high\-latency connections\&. It specifies how many requests are sent in a pipeline\&. APT tries to detect and workaround misbehaving webservers and proxies at runtime, but if you know that yours does not conform to the HTTP/1\&.1 specification pipelining can be disabled by setting the value to 0\&. It is enabled by default with the value 10\&. .sp Acquire::http::AllowRedirect controls whether APT will follow redirects, which is enabled by default\&. .sp The used bandwidth can be limited with Acquire::http::Dl\-Limit which accepts integer values in kilobytes per second\&. The default value is 0 which deactivates the limit and tries to use all available bandwidth\&. Note that this option implicitly disables downloading from multiple servers at the same time\&. .sp Acquire::http::User\-Agent can be used to set a different User\-Agent for the http download method as some proxies allow access for clients only if the client uses a known identifier\&. .sp Acquire::http::Proxy\-Auto\-Detect can be used to specify an external command to discover the http proxy to use\&. The first and only parameter is an URI denoting the host to be contacted to allow for host\-specific configuration\&. APT expects the command to output the proxy on stdout as a single line in the style http://proxy:port/ or the word DIRECT if no proxy should be used\&. No output indicates that the generic proxy settings should be used\&. Note that auto\-detection will not be used for a host if a host\-specific proxy configuration is already set via Acquire::http::Proxy::\fIHOST\fR\&. See the \fBsquid-deb-proxy-client\fR(1) package for an example implementation that uses avahi\&. This option takes precedence over the legacy option name ProxyAutoDetect\&. .RE .PP \fBhttps\fR .RS 4 The Cache\-control, Timeout, AllowRedirect, Dl\-Limit and proxy options work for HTTPS URIs in the same way as for the http method, and default to the same values if they are not explicitly set\&. The Pipeline\-Depth option is not yet supported\&. .sp CaInfo suboption specifies place of file that holds info about trusted certificates\&. ::CaInfo is the corresponding per\-host option\&. Verify\-Peer boolean suboption determines whether or not the server\*(Aqs host certificate should be verified against trusted certificates\&. ::Verify\-Peer is the corresponding per\-host option\&. Verify\-Host boolean suboption determines whether or not the server\*(Aqs hostname should be verified\&. ::Verify\-Host is the corresponding per\-host option\&. SslCert determines what certificate to use for client authentication\&. ::SslCert is the corresponding per\-host option\&. SslKey determines what private key to use for client authentication\&. ::SslKey is the corresponding per\-host option\&. SslForceVersion overrides default SSL version to use\&. It can contain either of the strings \*(AqTLSv1\*(Aq or \*(AqSSLv3\*(Aq\&. ::SslForceVersion is the corresponding per\-host option\&. .RE .PP \fBftp\fR .RS 4 ftp::Proxy sets the default proxy to use for FTP URIs\&. It is in the standard form of ftp://[[user][:pass]@]host[:port]/\&. Per host proxies can also be specified by using the form ftp::Proxy:: with the special keyword DIRECT meaning to use no proxies\&. If no one of the above settings is specified, \fBftp_proxy\fR environment variable will be used\&. To use an FTP proxy you will have to set the ftp::ProxyLogin script in the configuration file\&. This entry specifies the commands to send to tell the proxy server what to connect to\&. Please see /usr/share/doc/apt/examples/configure\-index\&.gz for an example of how to do this\&. The substitution variables representing the corresponding URI component are $(PROXY_USER), $(PROXY_PASS), $(SITE_USER), $(SITE_PASS), $(SITE) and $(SITE_PORT)\&. .sp The option timeout sets the timeout timer used by the method; this value applies to the connection as well as the data timeout\&. .sp Several settings are provided to control passive mode\&. Generally it is safe to leave passive mode on; it works in nearly every environment\&. However, some situations require that passive mode be disabled and port mode FTP used instead\&. This can be done globally or for connections that go through a proxy or for a specific host (see the sample config file for examples)\&. .sp It is possible to proxy FTP over HTTP by setting the \fBftp_proxy\fR environment variable to an HTTP URL \- see the discussion of the http method above for syntax\&. You cannot set this in the configuration file and it is not recommended to use FTP over HTTP due to its low efficiency\&. .sp The setting ForceExtended controls the use of RFC2428 EPSV and EPRT commands\&. The default is false, which means these commands are only used if the control connection is IPv6\&. Setting this to true forces their use even on IPv4 connections\&. Note that most FTP servers do not support RFC2428\&. .RE .PP \fBcdrom\fR .RS 4 For URIs using the cdrom method, the only configurable option is the mount point, cdrom::Mount, which must be the mount point for the CD\-ROM (or DVD, or whatever) drive as specified in /etc/fstab\&. It is possible to provide alternate mount and unmount commands if your mount point cannot be listed in the fstab\&. The syntax is to put .sp .if n \{\ .RS 4 .\} .nf /cdrom/::Mount "foo"; .fi .if n \{\ .RE .\} .sp within the cdrom block\&. It is important to have the trailing slash\&. Unmount commands can be specified using UMount\&. .RE .PP \fBgpgv\fR .RS 4 For GPGV URIs the only configurable option is gpgv::Options, which passes additional parameters to gpgv\&. .RE .PP \fBCompressionTypes\fR .RS 4 List of compression types which are understood by the acquire methods\&. Files like Packages can be available in various compression formats\&. By default the acquire methods can decompress and recompress many common formats like \fBxz\fR and \fBgzip\fR; with this scope the supported formats can be queried, modified as well as support for more formats added (see also \fBAPT::Compressor\fR)\&. The syntax for this is: .sp .if n \{\ .RS 4 .\} .nf Acquire::CompressionTypes::\fIFileExtension\fR "\fIMethodname\fR"; .fi .if n \{\ .RE .\} .sp Also, the Order subgroup can be used to define in which order the acquire system will try to download the compressed files\&. The acquire system will try the first and proceed with the next compression type in this list on error, so to prefer one over the other type simply add the preferred type first \- types not already added will be implicitly appended to the end of the list, so e\&.g\&. .sp .if n \{\ .RS 4 .\} .nf Acquire::CompressionTypes::Order:: "gz"; .fi .if n \{\ .RE .\} .sp can be used to prefer \fBgzip\fR compressed files over all other compression formats\&. If \fBxz\fR should be preferred over \fBgzip\fR and \fBbzip2\fR the configure setting should look like this: .sp .if n \{\ .RS 4 .\} .nf Acquire::CompressionTypes::Order { "xz"; "gz"; }; .fi .if n \{\ .RE .\} .sp It is not needed to add bz2 to the list explicitly as it will be added automatically\&. .sp Note that the Dir::Bin::\fIMethodname\fR will be checked at run time\&. If this option has been set and support for this format isn\*(Aqt directly built into apt, the method will only be used if this file exists; e\&.g\&. for the bzip2 method (the inbuilt) setting is: .sp .if n \{\ .RS 4 .\} .nf Dir::Bin::bzip2 "/bin/bzip2"; .fi .if n \{\ .RE .\} .sp Note also that list entries specified on the command line will be added at the end of the list specified in the configuration files, but before the default entries\&. To prefer a type in this case over the ones specified in the configuration files you can set the option direct \- not in list style\&. This will not override the defined list; it will only prefix the list with this type\&. .sp The special type uncompressed can be used to give uncompressed files a preference, but note that most archives don\*(Aqt provide uncompressed files so this is mostly only useable for local mirrors\&. .RE .PP \fBGzipIndexes\fR .RS 4 When downloading gzip compressed indexes (Packages, Sources, or Translations), keep them gzip compressed locally instead of unpacking them\&. This saves quite a lot of disk space at the expense of more CPU requirements when building the local package caches\&. False by default\&. .RE .PP \fBLanguages\fR .RS 4 The Languages subsection controls which Translation files are downloaded and in which order APT tries to display the description\-translations\&. APT will try to display the first available description in the language which is listed first\&. Languages can be defined with their short or long language codes\&. Note that not all archives provide Translation files for every language \- the long language codes are especially rare\&. .sp The default list includes "environment" and "en"\&. "environment" has a special meaning here: it will be replaced at runtime with the language codes extracted from the LC_MESSAGES environment variable\&. It will also ensure that these codes are not included twice in the list\&. If LC_MESSAGES is set to "C" only the Translation\-en file (if available) will be used\&. To force APT to use no Translation file use the setting Acquire::Languages=none\&. "none" is another special meaning code which will stop the search for a suitable Translation file\&. This tells APT to download these translations too, without actually using them unless the environment specifies the languages\&. So the following example configuration will result in the order "en, de" in an English locale or "de, en" in a German one\&. Note that "fr" is downloaded, but not used unless APT is used in a French locale (where the order would be "fr, de, en")\&. .sp .if n \{\ .RS 4 .\} .nf Acquire::Languages { "environment"; "de"; "en"; "none"; "fr"; }; .fi .if n \{\ .RE .\} .sp Note: To prevent problems resulting from APT being executed in different environments (e\&.g\&. by different users or by other programs) all Translation files which are found in /var/lib/apt/lists/ will be added to the end of the list (after an implicit "none")\&. .RE .PP \fBForceIPv4\fR .RS 4 When downloading, force to use only the IPv4 protocol\&. .RE .PP \fBForceIPv6\fR .RS 4 When downloading, force to use only the IPv6 protocol\&. .RE .PP \fBMaxReleaseFileSize\fR .RS 4 The maximum file size of Release/Release\&.gpg/InRelease files\&. The default is 10MB\&. .RE .PP \fBEnableSrvRecords\fR .RS 4 This option controls if apt will use the DNS SRV server record as specified in RFC 2782 to select an alternative server to connect to\&. The default is "true"\&. .RE .PP \fBAllowInsecureRepositories\fR .RS 4 Allow update operations to load data files from repositories without sufficient security information\&. The default value is "false"\&. Concept, implications as well as alternatives are detailed in \fBapt-secure\fR(8)\&. .RE .PP \fBAllowWeakRepositories\fR .RS 4 Allow update operations to load data files from repositories which provide security information, but these are deemed no longer cryptographically strong enough\&. The default value is "false"\&. Concept, implications as well as alternatives are detailed in \fBapt-secure\fR(8)\&. .RE .PP \fBAllowDowngradeToInsecureRepositories\fR .RS 4 Allow that a repository that was previously gpg signed to become unsigned during an update operation\&. When there is no valid signature for a previously trusted repository apt will refuse the update\&. This option can be used to override this protection\&. You almost certainly never want to enable this\&. The default is false\&. Concept, implications as well as alternatives are detailed in \fBapt-secure\fR(8)\&. .RE .PP \fBChangelogs::URI\fR scope .RS 4 Acquiring changelogs can only be done if an URI is known from where to get them\&. Preferable the Release file indicates this in a \*(AqChangelogs\*(Aq field\&. If this isn\*(Aqt available the Label/Origin field of the Release file is used to check if a Acquire::Changelogs::URI::Label::\fILABEL\fR or Acquire::Changelogs::URI::Origin::\fIORIGIN\fR option exists and if so this value is taken\&. The value in the Release file can be overridden with Acquire::Changelogs::URI::Override::Label::\fILABEL\fR or Acquire::Changelogs::URI::Override::Origin::\fIORIGIN\fR\&. The value should be a normal URI to a text file, except that package specific data is replaced with the placeholder @CHANGEPATH@\&. The value for it is: 1\&. if the package is from a component (e\&.g\&. main) this is the first part otherwise it is omitted, 2\&. the first letter of source package name, except if the source package name starts with \*(Aqlib\*(Aq in which case it will be the first four letters\&. 3\&. The complete source package name\&. 4\&. the complete name again and 5\&. the source version\&. The first (if present), second, third and fourth part are separated by a slash (\*(Aq/\*(Aq) and between the fourth and fifth part is an underscore (\*(Aq_\*(Aq)\&. The special value \*(Aqno\*(Aq is available for this option indicating that this source can\*(Aqt be used to acquire changelog files from\&. Another source will be tried if available in this case\&. .RE .SH "BINARY SPECIFIC CONFIGURATION" .PP Especially with the introduction of the \fBapt\fR binary it can be useful to set certain options only for a specific binary as even options which look like they would effect only a certain binary like \fBAPT::Get::Show\-Versions\fR effect \fBapt\-get\fR as well as \fBapt\fR\&. .PP Setting an option for a specific binary only can be achieved by setting the option inside the \fBBinary::\fR\fB\fIspecific\-binary\fR\fR scope\&. Setting the option \fBAPT::Get::Show\-Versions\fR for the \fBapt\fR only can e\&.g\&. by done by setting \fBBinary::apt::APT::Get::Show\-Versions\fR instead\&. .PP Note that as seen in the DESCRIPTION section further above you can\*(Aqt set binary\-specific options on the commandline itself nor in configuration files loaded via the commandline\&. .SH "DIRECTORIES" .PP The Dir::State section has directories that pertain to local state information\&. lists is the directory to place downloaded package lists in and status is the name of the \fBdpkg\fR(1) status file\&. preferences is the name of the APT preferences file\&. Dir::State contains the default directory to prefix on all sub\-items if they do not start with / or \&./\&. .PP Dir::Cache contains locations pertaining to local cache information, such as the two package caches srcpkgcache and pkgcache as well as the location to place downloaded archives, Dir::Cache::archives\&. Generation of caches can be turned off by setting pkgcache or srcpkgcache to ""\&. This will slow down startup but save disk space\&. It is probably preferable to turn off the pkgcache rather than the srcpkgcache\&. Like Dir::State the default directory is contained in Dir::Cache .PP Dir::Etc contains the location of configuration files, sourcelist gives the location of the sourcelist and main is the default configuration file (setting has no effect, unless it is done from the config file specified by \fBAPT_CONFIG\fR)\&. .PP The Dir::Parts setting reads in all the config fragments in lexical order from the directory specified\&. After this is done then the main config file is loaded\&. .PP Binary programs are pointed to by Dir::Bin\&. Dir::Bin::Methods specifies the location of the method handlers and gzip, bzip2, lzma, dpkg, apt\-get dpkg\-source dpkg\-buildpackage and apt\-cache specify the location of the respective programs\&. .PP The configuration item RootDir has a special meaning\&. If set, all paths will be relative to RootDir, \fIeven paths that are specified absolutely\fR\&. So, for instance, if RootDir is set to /tmp/staging and Dir::State::status is set to /var/lib/dpkg/status, then the status file will be looked up in /tmp/staging/var/lib/dpkg/status\&. If you want to prefix only relative paths, set Dir instead\&. .PP The Ignore\-Files\-Silently list can be used to specify which files APT should silently ignore while parsing the files in the fragment directories\&. Per default a file which end with \&.disabled, ~, \&.bak or \&.dpkg\-[a\-z]+ is silently ignored\&. As seen in the last default value these patterns can use regular expression syntax\&. .SH "APT IN DSELECT" .PP When APT is used as a \fBdselect\fR(1) method several configuration directives control the default behavior\&. These are in the DSelect section\&. .PP \fBClean\fR .RS 4 Cache Clean mode; this value may be one of always, prompt, auto, pre\-auto and never\&. always and prompt will remove all packages from the cache after upgrading, prompt (the default) does so conditionally\&. auto removes only those packages which are no longer downloadable (replaced with a new version for instance)\&. pre\-auto performs this action before downloading new packages\&. .RE .PP \fBoptions\fR .RS 4 The contents of this variable are passed to \fBapt-get\fR(8) as command line options when it is run for the install phase\&. .RE .PP \fBUpdateoptions\fR .RS 4 The contents of this variable are passed to \fBapt-get\fR(8) as command line options when it is run for the update phase\&. .RE .PP \fBPromptAfterUpdate\fR .RS 4 If true the [U]pdate operation in \fBdselect\fR(1) will always prompt to continue\&. The default is to prompt only on error\&. .RE .SH "HOW APT CALLS DPKG(1)" .PP Several configuration directives control how APT invokes \fBdpkg\fR(1)\&. These are in the DPkg section\&. .PP \fBoptions\fR .RS 4 This is a list of options to pass to \fBdpkg\fR(1)\&. The options must be specified using the list notation and each list item is passed as a single argument to \fBdpkg\fR(1)\&. .RE .PP \fBPre\-Invoke\fR, \fBPost\-Invoke\fR .RS 4 This is a list of shell commands to run before/after invoking \fBdpkg\fR(1)\&. Like options this must be specified in list notation\&. The commands are invoked in order using /bin/sh; should any fail APT will abort\&. .RE .PP \fBPre\-Install\-Pkgs\fR .RS 4 This is a list of shell commands to run before invoking \fBdpkg\fR(1)\&. Like options this must be specified in list notation\&. The commands are invoked in order using /bin/sh; should any fail APT will abort\&. APT will pass the filenames of all \&.deb files it is going to install to the commands, one per line on the requested file descriptor, defaulting to standard input\&. .sp Version 2 of this protocol sends more information through the requested file descriptor: a line with the text VERSION 2, the APT configuration space, and a list of package actions with filename and version information\&. .sp Each configuration directive line has the form key=value\&. Special characters (equal signs, newlines, nonprintable characters, quotation marks, and percent signs in key and newlines, nonprintable characters, and percent signs in value) are %\-encoded\&. Lists are represented by multiple key::=value lines with the same key\&. The configuration section ends with a blank line\&. .sp Package action lines consist of five fields in Version 2: package name (without architecture qualification even if foreign), old version, direction of version change (< for upgrades, > for downgrades, = for no change), new version, action\&. The version fields are "\-" for no version at all (for example when installing a package for the first time; no version is treated as earlier than any real version, so that is an upgrade, indicated as \- < 1\&.23\&.4)\&. The action field is "**CONFIGURE**" if the package is being configured, "**REMOVE**" if it is being removed, or the filename of a \&.deb file if it is being unpacked\&. .sp In Version 3 after each version field follows the architecture of this version, which is "\-" if there is no version, and a field showing the MultiArch type "same", "foreign", "allowed" or "none"\&. Note that "none" is an incorrect typename which is just kept to remain compatible, it should be read as "no" and users are encouraged to support both\&. .sp The version of the protocol to be used for the command \fIcmd\fR can be chosen by setting DPkg::Tools::options::\fIcmd\fR::Version accordingly, the default being version 1\&. If APT isn\*(Aqt supporting the requested version it will send the information in the highest version it has support for instead\&. .sp The file descriptor to be used to send the information can be requested with DPkg::Tools::options::\fIcmd\fR::InfoFD which defaults to 0 for standard input and is available since version 0\&.9\&.11\&. Support for the option can be detected by looking for the environment variable \fBAPT_HOOK_INFO_FD\fR which contains the number of the used file descriptor as a confirmation\&. .RE .PP \fBRun\-Directory\fR .RS 4 APT chdirs to this directory before invoking \fBdpkg\fR(1), the default is /\&. .RE .PP \fBBuild\-options\fR .RS 4 These options are passed to \fBdpkg-buildpackage\fR(1) when compiling packages; the default is to disable signing and produce all binaries\&. .RE .PP \fBDPkg::ConfigurePending\fR .RS 4 If this option is set APT will call \fBdpkg \-\-configure \-\-pending\fR to let \fBdpkg\fR(1) handle all required configurations and triggers\&. This option is activated by default, but deactivating it could be useful if you want to run APT multiple times in a row \- e\&.g\&. in an installer\&. In this scenario you could deactivate this option in all but the last run\&. .RE .SH "PERIODIC AND ARCHIVES OPTIONS" .PP APT::Periodic and APT::Archives groups of options configure behavior of apt periodic updates, which is done by the /usr/lib/apt/apt\&.systemd\&.daily script\&. See the top of this script for the brief documentation of these options\&. .SH "DEBUG OPTIONS" .PP Enabling options in the Debug:: section will cause debugging information to be sent to the standard error stream of the program utilizing the apt libraries, or enable special program modes that are primarily useful for debugging the behavior of apt\&. Most of these options are not interesting to a normal user, but a few may be: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Debug::pkgProblemResolver enables output about the decisions made by dist\-upgrade, upgrade, install, remove, purge\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Debug::NoLocking disables all file locking\&. This can be used to run some operations (for instance, apt\-get \-s install) as a non\-root user\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Debug::pkgDPkgPM prints out the actual command line each time that apt invokes \fBdpkg\fR(1)\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Debug::IdentCdrom disables the inclusion of statfs data in CD\-ROM IDs\&. .RE .PP A full list of debugging options to apt follows\&. .PP \fBDebug::Acquire::cdrom\fR .RS 4 Print information related to accessing cdrom:// sources\&. .RE .PP \fBDebug::Acquire::ftp\fR .RS 4 Print information related to downloading packages using FTP\&. .RE .PP \fBDebug::Acquire::http\fR .RS 4 Print information related to downloading packages using HTTP\&. .RE .PP \fBDebug::Acquire::https\fR .RS 4 Print information related to downloading packages using HTTPS\&. .RE .PP \fBDebug::Acquire::gpgv\fR .RS 4 Print information related to verifying cryptographic signatures using gpg\&. .RE .PP \fBDebug::aptcdrom\fR .RS 4 Output information about the process of accessing collections of packages stored on CD\-ROMs\&. .RE .PP \fBDebug::BuildDeps\fR .RS 4 Describes the process of resolving build\-dependencies in \fBapt-get\fR(8)\&. .RE .PP \fBDebug::Hashes\fR .RS 4 Output each cryptographic hash that is generated by the apt libraries\&. .RE .PP \fBDebug::IdentCDROM\fR .RS 4 Do not include information from statfs, namely the number of used and free blocks on the CD\-ROM filesystem, when generating an ID for a CD\-ROM\&. .RE .PP \fBDebug::NoLocking\fR .RS 4 Disable all file locking\&. For instance, this will allow two instances of \(lqapt\-get update\(rq to run at the same time\&. .RE .PP \fBDebug::pkgAcquire\fR .RS 4 Log when items are added to or removed from the global download queue\&. .RE .PP \fBDebug::pkgAcquire::Auth\fR .RS 4 Output status messages and errors related to verifying checksums and cryptographic signatures of downloaded files\&. .RE .PP \fBDebug::pkgAcquire::Diffs\fR .RS 4 Output information about downloading and applying package index list diffs, and errors relating to package index list diffs\&. .RE .PP \fBDebug::pkgAcquire::RRed\fR .RS 4 Output information related to patching apt package lists when downloading index diffs instead of full indices\&. .RE .PP \fBDebug::pkgAcquire::Worker\fR .RS 4 Log all interactions with the sub\-processes that actually perform downloads\&. .RE .PP \fBDebug::pkgAutoRemove\fR .RS 4 Log events related to the automatically\-installed status of packages and to the removal of unused packages\&. .RE .PP \fBDebug::pkgDepCache::AutoInstall\fR .RS 4 Generate debug messages describing which packages are being automatically installed to resolve dependencies\&. This corresponds to the initial auto\-install pass performed in, e\&.g\&., apt\-get install, and not to the full apt dependency resolver; see Debug::pkgProblemResolver for that\&. .RE .PP \fBDebug::pkgDepCache::Marker\fR .RS 4 Generate debug messages describing which packages are marked as keep/install/remove while the ProblemResolver does his work\&. Each addition or deletion may trigger additional actions; they are shown indented two additional spaces under the original entry\&. The format for each line is MarkKeep, MarkDelete or MarkInstall followed by package\-name d\&.e\&.f | x\&.y\&.z> (section) where a\&.b\&.c is the current version of the package, d\&.e\&.f is the version considered for installation and x\&.y\&.z is a newer version, but not considered for installation (because of a low pin score)\&. The later two can be omitted if there is none or if it is the same as the installed version\&. section is the name of the section the package appears in\&. .RE .PP \fBDebug::pkgDPkgPM\fR .RS 4 When invoking \fBdpkg\fR(1), output the precise command line with which it is being invoked, with arguments separated by a single space character\&. .RE .PP \fBDebug::pkgDPkgProgressReporting\fR .RS 4 Output all the data received from \fBdpkg\fR(1) on the status file descriptor and any errors encountered while parsing it\&. .RE .PP \fBDebug::pkgOrderList\fR .RS 4 Generate a trace of the algorithm that decides the order in which apt should pass packages to \fBdpkg\fR(1)\&. .RE .PP \fBDebug::pkgPackageManager\fR .RS 4 Output status messages tracing the steps performed when invoking \fBdpkg\fR(1)\&. .RE .PP \fBDebug::pkgPolicy\fR .RS 4 Output the priority of each package list on startup\&. .RE .PP \fBDebug::pkgProblemResolver\fR .RS 4 Trace the execution of the dependency resolver (this applies only to what happens when a complex dependency problem is encountered)\&. .RE .PP \fBDebug::pkgProblemResolver::ShowScores\fR .RS 4 Display a list of all installed packages with their calculated score used by the pkgProblemResolver\&. The description of the package is the same as described in Debug::pkgDepCache::Marker .RE .PP \fBDebug::sourceList\fR .RS 4 Print information about the vendors read from /etc/apt/vendors\&.list\&. .RE .PP \fBDebug::RunScripts\fR .RS 4 Display the external commands that are called by apt hooks\&. This includes e\&.g\&. the config options DPkg::{Pre,Post}\-Invoke or APT::Update::{Pre,Post}\-Invoke\&. .RE .SH "EXAMPLES" .PP /usr/share/doc/apt/examples/configure\-index\&.gz is a configuration file showing example values for all possible options\&. .SH "FILES" .PP /etc/apt/apt\&.conf .RS 4 APT configuration file\&. Configuration Item: Dir::Etc::Main\&. .RE .PP /etc/apt/apt\&.conf\&.d/ .RS 4 APT configuration file fragments\&. Configuration Item: Dir::Etc::Parts\&. .RE .SH "SEE ALSO" .PP \fBapt-cache\fR(8), \fBapt-config\fR(8), \fBapt_preferences\fR(5)\&. .SH "BUGS" .PP \m[blue]\fBAPT bug page\fR\m[]\&\s-2\u[1]\d\s+2\&. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug\-reporting\&.txt or the \fBreportbug\fR(1) command\&. .SH "AUTHORS" .PP \fBJason Gunthorpe\fR .RS 4 .RE .PP \fBAPT team\fR .RS 4 .RE .PP \fBDaniel Burrows\fR <\&dburrows@debian\&.org\&> .RS 4 Initial documentation of Debug::*\&. .RE .SH "NOTES" .IP " 1." 4 APT bug page .RS 4 \%http://bugs.debian.org/src:apt .RE ================================================ FILE: packages/apt/man/man5/apt_preferences.5 ================================================ '\" t .\" Title: apt_preferences .\" Author: APT team .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 15\ \&August\ \&2015 .\" Manual: APT .\" Source: APT 1.4.9 .\" Language: English .\" .TH "APT_PREFERENCES" "5" "15\ \&August\ \&2015" "APT 1.4.9" "APT" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" apt_preferences \- Preference control file for APT .SH "DESCRIPTION" .PP The APT preferences file /etc/apt/preferences and the fragment files in the /etc/apt/preferences\&.d/ folder can be used to control which versions of packages will be selected for installation\&. .PP Several versions of a package may be available for installation when the \fBsources.list\fR(5) file contains references to more than one distribution (for example, stable and testing)\&. APT assigns a priority to each version that is available\&. Subject to dependency constraints, \fBapt\-get\fR selects the version with the highest priority for installation\&. The APT preferences override the priorities that APT assigns to package versions by default, thus giving the user control over which one is selected for installation\&. .PP Several instances of the same version of a package may be available when the \fBsources.list\fR(5) file contains references to more than one source\&. In this case \fBapt\-get\fR downloads the instance listed earliest in the \fBsources.list\fR(5) file\&. The APT preferences do not affect the choice of instance, only the choice of version\&. .PP Preferences are a strong power in the hands of a system administrator but they can become also their biggest nightmare if used without care! APT will not question the preferences, so wrong settings can lead to uninstallable packages or wrong decisions while upgrading packages\&. Even more problems will arise if multiple distribution releases are mixed without a good understanding of the following paragraphs\&. Packages included in a specific release aren\*(Aqt tested in (and therefore don\*(Aqt always work as expected in) older or newer releases, or together with other packages from different releases\&. You have been warned\&. .PP Note that the files in the /etc/apt/preferences\&.d directory are parsed in alphanumeric ascending order and need to obey the following naming convention: The files have either no or "pref" as filename extension and only contain alphanumeric, hyphen (\-), underscore (_) and period (\&.) characters\&. Otherwise APT will print a notice that it has ignored a file, unless that file matches a pattern in the Dir::Ignore\-Files\-Silently configuration list \- in which case it will be silently ignored\&. .SS "APT\*(Aqs Default Priority Assignments" .PP If there is no preferences file or if there is no entry in the file that applies to a particular version then the priority assigned to that version is the priority of the distribution to which that version belongs\&. It is possible to single out a distribution, "the target release", which receives a higher priority than other distributions do by default\&. The target release can be set on the \fBapt\-get\fR command line or in the APT configuration file /etc/apt/apt\&.conf\&. Note that this has precedence over any general priority you set in the /etc/apt/preferences file described later, but not over specifically pinned packages\&. For example, .sp .if n \{\ .RS 4 .\} .nf \fBapt\-get install \-t testing \fR\fB\fIsome\-package\fR\fR .fi .if n \{\ .RE .\} .sp .sp .if n \{\ .RS 4 .\} .nf APT::Default\-Release "stable"; .fi .if n \{\ .RE .\} .PP If the target release has been specified then APT uses the following algorithm to set the priorities of the versions of a package\&. Assign: .PP priority 1 .RS 4 to the versions coming from archives which in their Release files are marked as "NotAutomatic: yes" but \fInot\fR as "ButAutomaticUpgrades: yes" like the Debian experimental archive\&. .RE .PP priority 100 .RS 4 to the version that is already installed (if any) and to the versions coming from archives which in their Release files are marked as "NotAutomatic: yes" and "ButAutomaticUpgrades: yes" like the Debian backports archive since squeeze\-backports\&. .RE .PP priority 500 .RS 4 to the versions that do not belong to the target release\&. .RE .PP priority 990 .RS 4 to the versions that belong to the target release\&. .RE The highest of those priorities whose description matches the version is assigned to the version\&. .PP If the target release has not been specified then APT simply assigns priority 100 to all installed package versions and priority 500 to all uninstalled package versions, except versions coming from archives which in their Release files are marked as "NotAutomatic: yes" \- these versions get the priority 1 or priority 100 if it is additionally marked as "ButAutomaticUpgrades: yes"\&. .PP APT then applies the following rules, listed in order of precedence, to determine which version of a package to install\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Never downgrade unless the priority of an available version exceeds 1000\&. ("Downgrading" is installing a less recent version of a package in place of a more recent version\&. Note that none of APT\*(Aqs default priorities exceeds 1000; such high priorities can only be set in the preferences file\&. Note also that downgrading a package can be risky\&.) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Install the highest priority version\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If two or more versions have the same priority, install the most recent one (that is, the one with the higher version number)\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If two or more versions have the same priority and version number but either the packages differ in some of their metadata or the \-\-reinstall option is given, install the uninstalled one\&. .RE .PP In a typical situation, the installed version of a package (priority 100) is not as recent as one of the versions available from the sources listed in the \fBsources.list\fR(5) file (priority 500 or 990)\&. Then the package will be upgraded when \fBapt\-get install \fR\fB\fIsome\-package\fR\fR or \fBapt\-get upgrade\fR is executed\&. .PP More rarely, the installed version of a package is \fImore\fR recent than any of the other available versions\&. The package will not be downgraded when \fBapt\-get install \fR\fB\fIsome\-package\fR\fR or \fBapt\-get upgrade\fR is executed\&. .PP Sometimes the installed version of a package is more recent than the version belonging to the target release, but not as recent as a version belonging to some other distribution\&. Such a package will indeed be upgraded when \fBapt\-get install \fR\fB\fIsome\-package\fR\fR or \fBapt\-get upgrade\fR is executed, because at least \fIone\fR of the available versions has a higher priority than the installed version\&. .SS "The Effect of APT Preferences" .PP The APT preferences file allows the system administrator to control the assignment of priorities\&. The file consists of one or more multi\-line records separated by blank lines\&. Records can have one of two forms, a specific form and a general form\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The specific form assigns a priority (a "Pin\-Priority") to one or more specified packages with a specified version or version range\&. For example, the following record assigns a high priority to all versions of the perl package whose version number begins with "5\&.20"\&. Multiple packages can be separated by spaces\&. .sp .if n \{\ .RS 4 .\} .nf Package: perl Pin: version 5\&.20* Pin\-Priority: 1001 .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The general form assigns a priority to all of the package versions in a given distribution (that is, to all the versions of packages that are listed in a certain Release file) or to all of the package versions coming from a particular Internet site, as identified by the site\*(Aqs fully qualified domain name\&. .sp This general\-form entry in the APT preferences file applies only to groups of packages\&. For example, the following record assigns a high priority to all package versions available from the local site\&. .sp .if n \{\ .RS 4 .\} .nf Package: * Pin: origin "" Pin\-Priority: 999 .fi .if n \{\ .RE .\} .sp A note of caution: the keyword used here is "origin" which can be used to match a hostname\&. The following record will assign a high priority to all versions available from the server identified by the hostname "ftp\&.de\&.debian\&.org" .sp .if n \{\ .RS 4 .\} .nf Package: * Pin: origin "ftp\&.de\&.debian\&.org" Pin\-Priority: 999 .fi .if n \{\ .RE .\} .sp This should \fInot\fR be confused with the Origin of a distribution as specified in a Release file\&. What follows the "Origin:" tag in a Release file is not an Internet address but an author or vendor name, such as "Debian" or "Ximian"\&. .sp The following record assigns a low priority to all package versions belonging to any distribution whose Archive name is "unstable"\&. .sp .if n \{\ .RS 4 .\} .nf Package: * Pin: release a=unstable Pin\-Priority: 50 .fi .if n \{\ .RE .\} .sp The following record assigns a high priority to all package versions belonging to any distribution whose Codename is "buster"\&. .sp .if n \{\ .RS 4 .\} .nf Package: * Pin: release n=buster Pin\-Priority: 900 .fi .if n \{\ .RE .\} .sp The following record assigns a high priority to all package versions belonging to any release whose Archive name is "stable" and whose release Version number is "9"\&. .sp .if n \{\ .RS 4 .\} .nf Package: * Pin: release a=stable, v=9 Pin\-Priority: 500 .fi .if n \{\ .RE .\} .RE .sp The effect of the comma operator is similar to an "and" in logic: All conditions must be satisfied for the pin to match\&. There is one exception: For any type of condition (such as two "a" conditions), only the last such condition is checked\&. .SS "Regular expressions and glob(7) syntax" .PP APT also supports pinning by \fBglob\fR(7) expressions, and regular expressions surrounded by slashes\&. For example, the following example assigns the priority 500 to all packages from experimental where the name starts with gnome (as a \fBglob\fR(7)\-like expression) or contains the word kde (as a POSIX extended regular expression surrounded by slashes)\&. .sp .if n \{\ .RS 4 .\} .nf Package: gnome* /kde/ Pin: release a=experimental Pin\-Priority: 500 .fi .if n \{\ .RE .\} .PP The rule for those expressions is that they can occur anywhere where a string can occur\&. Thus, the following pin assigns the priority 990 to all packages from a release starting with xenial\&. .sp .if n \{\ .RS 4 .\} .nf Package: * Pin: release n=xenial* Pin\-Priority: 990 .fi .if n \{\ .RE .\} .PP If a regular expression occurs in a Package field, the behavior is the same as if this regular expression were replaced with a list of all package names it matches\&. It is undecided whether this will change in the future; thus you should always list wild\-card pins first, so later specific pins override it\&. The pattern "*" in a Package field is not considered a \fBglob\fR(7) expression in itself\&. .SS "How APT Interprets Priorities" .PP Priorities (P) assigned in the APT preferences file must be positive or negative integers\&. They are interpreted as follows (roughly speaking): .PP P >= 1000 .RS 4 causes a version to be installed even if this constitutes a downgrade of the package .RE .PP 990 <= P < 1000 .RS 4 causes a version to be installed even if it does not come from the target release, unless the installed version is more recent .RE .PP 500 <= P < 990 .RS 4 causes a version to be installed unless there is a version available belonging to the target release or the installed version is more recent .RE .PP 100 <= P < 500 .RS 4 causes a version to be installed unless there is a version available belonging to some other distribution or the installed version is more recent .RE .PP 0 < P < 100 .RS 4 causes a version to be installed only if there is no installed version of the package .RE .PP P < 0 .RS 4 prevents the version from being installed .RE .PP P = 0 .RS 4 has undefined behaviour, do not use it\&. .RE .PP The first specific\-form record matching an available package version determines the priority of the package version\&. Failing that, the priority of the package is defined as the maximum of all priorities defined by generic\-form records matching the version\&. Records defined using patterns in the Pin field other than "*" are treated like specific\-form records\&. .PP For example, suppose the APT preferences file contains the three records presented earlier: .sp .if n \{\ .RS 4 .\} .nf Package: perl Pin: version 5\&.20* Pin\-Priority: 1001 Package: * Pin: origin "" Pin\-Priority: 999 Package: * Pin: release unstable Pin\-Priority: 50 .fi .if n \{\ .RE .\} .PP Then: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The most recent available version of the perl package will be installed, so long as that version\*(Aqs version number begins with "5\&.20"\&. If \fIany\fR 5\&.20* version of perl is available and the installed version is 5\&.24*, then perl will be downgraded\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} A version of any package other than perl that is available from the local system has priority over other versions, even versions belonging to the target release\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} A version of a package whose origin is not the local system but some other site listed in \fBsources.list\fR(5) and which belongs to an unstable distribution is only installed if it is selected for installation and no version of the package is already installed\&. .RE .sp .SS "Determination of Package Version and Distribution Properties" .PP The locations listed in the \fBsources.list\fR(5) file should provide Packages and Release files to describe the packages available at that location\&. .PP The Packages file is normally found in the directory \&.\&.\&./dists/\fIdist\-name\fR/\fIcomponent\fR/\fIarch\fR: for example, \&.\&.\&./dists/stable/main/binary\-i386/Packages\&. It consists of a series of multi\-line records, one for each package available in that directory\&. Only two lines in each record are relevant for setting APT priorities: .PP the Package: line .RS 4 gives the package name .RE .PP the Version: line .RS 4 gives the version number for the named package .RE .PP The Release file is normally found in the directory \&.\&.\&./dists/\fIdist\-name\fR: for example, \&.\&.\&./dists/stable/Release, or \&.\&.\&./dists/stretch/Release\&. It consists of a single multi\-line record which applies to \fIall\fR of the packages in the directory tree below its parent\&. Unlike the Packages file, nearly all of the lines in a Release file are relevant for setting APT priorities: .PP the Archive: or Suite: line .RS 4 names the archive to which all the packages in the directory tree belong\&. For example, the line "Archive: stable" or "Suite: stable" specifies that all of the packages in the directory tree below the parent of the Release file are in a stable archive\&. Specifying this value in the APT preferences file would require the line: .sp .if n \{\ .RS 4 .\} .nf Pin: release a=stable .fi .if n \{\ .RE .\} .RE .PP the Codename: line .RS 4 names the codename to which all the packages in the directory tree belong\&. For example, the line "Codename: buster" specifies that all of the packages in the directory tree below the parent of the Release file belong to a version named buster\&. Specifying this value in the APT preferences file would require the line: .sp .if n \{\ .RS 4 .\} .nf Pin: release n=buster .fi .if n \{\ .RE .\} .RE .PP the Version: line .RS 4 names the release version\&. For example, the packages in the tree might belong to Debian release version 9\&. Note that there is normally no version number for the testing and unstable distributions because they have not been released yet\&. Specifying this in the APT preferences file would require one of the following lines\&. .sp .if n \{\ .RS 4 .\} .nf Pin: release v=9 Pin: release a=stable, v=9 Pin: release 9 .fi .if n \{\ .RE .\} .RE .PP the Component: line .RS 4 names the licensing component associated with the packages in the directory tree of the Release file\&. For example, the line "Component: main" specifies that all the packages in the directory tree are from the main component, which entails that they are licensed under terms listed in the Debian Free Software Guidelines\&. Specifying this component in the APT preferences file would require the line: .sp .if n \{\ .RS 4 .\} .nf Pin: release c=main .fi .if n \{\ .RE .\} .RE .PP the Origin: line .RS 4 names the originator of the packages in the directory tree of the Release file\&. Most commonly, this is Debian\&. Specifying this origin in the APT preferences file would require the line: .sp .if n \{\ .RS 4 .\} .nf Pin: release o=Debian .fi .if n \{\ .RE .\} .RE .PP the Label: line .RS 4 names the label of the packages in the directory tree of the Release file\&. Most commonly, this is Debian\&. Specifying this label in the APT preferences file would require the line: .sp .if n \{\ .RS 4 .\} .nf Pin: release l=Debian .fi .if n \{\ .RE .\} .RE .PP All of the Packages and Release files retrieved from locations listed in the \fBsources.list\fR(5) file are stored in the directory /var/lib/apt/lists, or in the file named by the variable Dir::State::Lists in the apt\&.conf file\&. For example, the file debian\&.lcs\&.mit\&.edu_debian_dists_unstable_contrib_binary\-i386_Release contains the Release file retrieved from the site debian\&.lcs\&.mit\&.edu for binary\-i386 architecture files from the contrib component of the unstable distribution\&. .SS "Optional Lines in an APT Preferences Record" .PP Each record in the APT preferences file can optionally begin with one or more lines beginning with the word Explanation:\&. This provides a place for comments\&. .SH "EXAMPLES" .SS "Tracking Stable" .PP The following APT preferences file will cause APT to assign a priority higher than the default (500) to all package versions belonging to a stable distribution and a prohibitively low priority to package versions belonging to other Debian distributions\&. .sp .if n \{\ .RS 4 .\} .nf Explanation: Uninstall or do not install any Debian\-originated Explanation: package versions other than those in the stable distro Package: * Pin: release a=stable Pin\-Priority: 900 Package: * Pin: release o=Debian Pin\-Priority: \-10 .fi .if n \{\ .RE .\} .PP With a suitable \fBsources.list\fR(5) file and the above preferences file, any of the following commands will cause APT to upgrade to the latest stable version(s)\&. .sp .if n \{\ .RS 4 .\} .nf apt\-get install \fIpackage\-name\fR apt\-get upgrade apt\-get dist\-upgrade .fi .if n \{\ .RE .\} .PP The following command will cause APT to upgrade the specified package to the latest version from the testing distribution; the package will not be upgraded again unless this command is given again\&. .sp .if n \{\ .RS 4 .\} .nf apt\-get install \fIpackage\fR/testing .fi .if n \{\ .RE .\} .sp .SS "Tracking Testing or Unstable" .PP The following APT preferences file will cause APT to assign a high priority to package versions from the testing distribution, a lower priority to package versions from the unstable distribution, and a prohibitively low priority to package versions from other Debian distributions\&. .sp .if n \{\ .RS 4 .\} .nf Package: * Pin: release a=testing Pin\-Priority: 900 Package: * Pin: release a=unstable Pin\-Priority: 800 Package: * Pin: release o=Debian Pin\-Priority: \-10 .fi .if n \{\ .RE .\} .PP With a suitable \fBsources.list\fR(5) file and the above preferences file, any of the following commands will cause APT to upgrade to the latest testing version(s)\&. .sp .if n \{\ .RS 4 .\} .nf apt\-get install \fIpackage\-name\fR apt\-get upgrade apt\-get dist\-upgrade .fi .if n \{\ .RE .\} .PP The following command will cause APT to upgrade the specified package to the latest version from the unstable distribution\&. Thereafter, \fBapt\-get upgrade\fR will upgrade the package to the most recent testing version if that is more recent than the installed version, otherwise, to the most recent unstable version if that is more recent than the installed version\&. .sp .if n \{\ .RS 4 .\} .nf apt\-get install \fIpackage\fR/unstable .fi .if n \{\ .RE .\} .sp .SS "Tracking the evolution of a codename release" .PP The following APT preferences file will cause APT to assign a priority higher than the default (500) to all package versions belonging to a specified codename of a distribution and a prohibitively low priority to package versions belonging to other Debian distributions, codenames and archives\&. Note that with this APT preference APT will follow the migration of a release from the archive testing to stable and later oldstable\&. If you want to follow for example the progress in testing notwithstanding the codename changes you should use the example configurations above\&. .sp .if n \{\ .RS 4 .\} .nf Explanation: Uninstall or do not install any Debian\-originated package versions Explanation: other than those in the distribution codenamed with buster or sid Package: * Pin: release n=buster Pin\-Priority: 900 Explanation: Debian unstable is always codenamed with sid Package: * Pin: release n=sid Pin\-Priority: 800 Package: * Pin: release o=Debian Pin\-Priority: \-10 .fi .if n \{\ .RE .\} .PP With a suitable \fBsources.list\fR(5) file and the above preferences file, any of the following commands will cause APT to upgrade to the latest version(s) in the release codenamed with buster\&. .sp .if n \{\ .RS 4 .\} .nf apt\-get install \fIpackage\-name\fR apt\-get upgrade apt\-get dist\-upgrade .fi .if n \{\ .RE .\} .PP The following command will cause APT to upgrade the specified package to the latest version from the sid distribution\&. Thereafter, \fBapt\-get upgrade\fR will upgrade the package to the most recent buster version if that is more recent than the installed version, otherwise, to the most recent sid version if that is more recent than the installed version\&. .sp .if n \{\ .RS 4 .\} .nf apt\-get install \fIpackage\fR/sid .fi .if n \{\ .RE .\} .sp .SH "FILES" .PP /etc/apt/preferences .RS 4 Version preferences file\&. This is where you would specify "pinning", i\&.e\&. a preference to get certain packages from a separate source or from a different version of a distribution\&. Configuration Item: Dir::Etc::Preferences\&. .RE .PP /etc/apt/preferences\&.d/ .RS 4 File fragments for the version preferences\&. Configuration Item: Dir::Etc::PreferencesParts\&. .RE .SH "SEE ALSO" .PP \fBapt-get\fR(8) \fBapt-cache\fR(8) \fBapt.conf\fR(5) \fBsources.list\fR(5) .SH "BUGS" .PP \m[blue]\fBAPT bug page\fR\m[]\&\s-2\u[1]\d\s+2\&. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug\-reporting\&.txt or the \fBreportbug\fR(1) command\&. .SH "AUTHOR" .PP \fBAPT team\fR .RS 4 .RE .SH "NOTES" .IP " 1." 4 APT bug page .RS 4 \%http://bugs.debian.org/src:apt .RE ================================================ FILE: packages/apt/man/man5/sources.list.5 ================================================ '\" t .\" Title: sources.list .\" Author: Jason Gunthorpe .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 25\ \&November\ \&2016 .\" Manual: APT .\" Source: APT 1.4.9 .\" Language: English .\" .TH "SOURCES\&.LIST" "5" "25\ \&November\ \&2016" "APT 1.4.9" "APT" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" sources.list \- List of configured APT data sources .SH "DESCRIPTION" .PP The source list /etc/apt/sources\&.list and the files contained in /etc/apt/sources\&.list\&.d/ are designed to support any number of active sources and a variety of source media\&. The files list one source per line (one\-line style) or contain multiline stanzas defining one or more sources per stanza (deb822 style), with the most preferred source listed first (in case a single version is available from more than one source)\&. The information available from the configured sources is acquired by \fBapt\-get update\fR (or by an equivalent command from another APT front\-end)\&. .SH "SOURCES\&.LIST\&.D" .PP The /etc/apt/sources\&.list\&.d directory provides a way to add sources\&.list entries in separate files\&. Two different file formats are allowed as described in the next two sections\&. Filenames need to have either the extension \&.list or \&.sources depending on the contained format\&. The filenames may only contain letters (a\-z and A\-Z), digits (0\-9), underscore (_), hyphen (\-) and period (\&.) characters\&. Otherwise APT will print a notice that it has ignored a file, unless that file matches a pattern in the Dir::Ignore\-Files\-Silently configuration list \- in which case it will be silently ignored\&. .SH "ONE\-LINE\-STYLE FORMAT" .PP Files in this format have the extension \&.list\&. Each line specifying a source starts with a type (e\&.g\&. deb\-src) followed by options and arguments for this type\&. Individual entries cannot be continued onto a following line\&. Empty lines are ignored, and a # character anywhere on a line marks the remainder of that line as a comment\&. Consequently an entry can be disabled by commenting out the entire line\&. If options should be provided they are separated by spaces and all of them together are enclosed by square brackets ([]) included in the line after the type separated from it with a space\&. If an option allows multiple values these are separated from each other with a comma (,)\&. An option name is separated from its value(s) by an equals sign (=)\&. Multivalue options also have \-= and += as separators, which instead of replacing the default with the given value(s) modify the default value(s) to remove or include the given values\&. .PP This is the traditional format and supported by all apt versions\&. Note that not all options as described below are supported by all apt versions\&. Note also that some older applications parsing this format on their own might not expect to encounter options as they were uncommon before the introduction of multi\-architecture support\&. .SH "DEB822\-STYLE FORMAT" .PP Files in this format have the extension \&.sources\&. The format is similar in syntax to other files used by Debian and its derivatives, such as the metadata files that apt will download from the configured sources or the debian/control file in a Debian source package\&. Individual entries are separated by an empty line; additional empty lines are ignored, and a # character at the start of the line marks the entire line as a comment\&. An entry can hence be disabled by commenting out each line belonging to the stanza, but it is usually easier to add the field "Enabled: no" to the stanza to disable the entry\&. Removing the field or setting it to yes reenables it\&. Options have the same syntax as every other field: A fieldname separated by a colon (:) and optionally spaces from its value(s)\&. Note especially that multiple values are separated by spaces, not by commas as in the one\-line format\&. Multivalue fields like Architectures also have Architectures\-Add and Architectures\-Remove to modify the default value rather than replacing it\&. .PP This is a new format supported by apt itself since version 1\&.1\&. Previous versions ignore such files with a notice message as described earlier\&. It is intended to make this format gradually the default format, deprecating the previously described one\-line\-style format, as it is easier to create, extend and modify for humans and machines alike especially if a lot of sources and/or options are involved\&. Developers who are working with and/or parsing apt sources are highly encouraged to add support for this format and to contact the APT team to coordinate and share this work\&. Users can freely adopt this format already, but may encounter problems with software not supporting the format yet\&. .SH "THE DEB AND DEB\-SRC TYPES: GENERAL FORMAT" .PP The deb type references a typical two\-level Debian archive, distribution/component\&. The distribution is generally a suite name like stable or testing or a codename like stretch or buster while component is one of main, contrib or non\-free\&. The deb\-src type references a Debian distribution\*(Aqs source code in the same form as the deb type\&. A deb\-src line is required to fetch source indexes\&. .PP The format for two one\-line\-style entries using the deb and deb\-src types is: .sp .if n \{\ .RS 4 .\} .nf deb [ option1=value1 option2=value2 ] uri suite [component1] [component2] [\&.\&.\&.] deb\-src [ option1=value1 option2=value2 ] uri suite [component1] [component2] [\&.\&.\&.] .fi .if n \{\ .RE .\} .PP Alternatively the equivalent entry in deb822 style looks like this: .sp .if n \{\ .RS 4 .\} .nf Types: deb deb\-src URIs: uri Suites: suite Components: [component1] [component2] [\&.\&.\&.] option1: value1 option2: value2 .fi .if n \{\ .RE .\} .PP The URI for the deb type must specify the base of the Debian distribution, from which APT will find the information it needs\&. suite can specify an exact path, in which case the components must be omitted and suite must end with a slash (/)\&. This is useful for the case when only a particular sub\-directory of the archive denoted by the URI is of interest\&. If suite does not specify an exact path, at least one component must be present\&. .PP suite may also contain a variable, $(ARCH) which expands to the Debian architecture (such as amd64 or armel) used on the system\&. This permits architecture\-independent sources\&.list files to be used\&. In general this is only of interest when specifying an exact path; APT will automatically generate a URI with the current architecture otherwise\&. .PP Especially in the one\-line\-style format since only one distribution can be specified per line it may be necessary to have multiple lines for the same URI, if a subset of all available distributions or components at that location is desired\&. APT will sort the URI list after it has generated a complete set internally, and will collapse multiple references to the same Internet host, for instance, into a single connection, so that it does not inefficiently establish a connection, close it, do something else, and then re\-establish a connection to that same host\&. APT also parallelizes connections to different hosts to more effectively deal with sites with low bandwidth\&. .PP It is important to list sources in order of preference, with the most preferred source listed first\&. Typically this will result in sorting by speed from fastest to slowest (CD\-ROM followed by hosts on a local network, followed by distant Internet hosts, for example)\&. .PP As an example, the sources for your distribution could look like this in one\-line\-style format: .sp .if n \{\ .RS 4 .\} .nf deb http://deb\&.debian\&.org/debian stretch main contrib non\-free deb http://security\&.debian\&.org stretch/updates main contrib non\-free .fi .if n \{\ .RE .\} .sp or like this in deb822 style format: .sp .if n \{\ .RS 4 .\} .nf Types: deb URIs: http://deb\&.debian\&.org/debian Suites: stretch Components: main contrib non\-free Types: deb URIs: http://security\&.debian\&.org Suites: stretch/updates Components: main contrib non\-free .fi .if n \{\ .RE .\} .SH "THE DEB AND DEB\-SRC TYPES: OPTIONS" .PP Each source entry can have options specified to modify which source is accessed and how data is acquired from it\&. Format, syntax and names of the options vary between the one\-line\-style and deb822\-style formats as described, but they both have the same options available\&. For simplicity we list the deb822 fieldname and provide the one\-line name in brackets\&. Remember that besides setting multivalue options explicitly, there is also the option to modify them based on the default, but we aren\*(Aqt listing those names explicitly here\&. Unsupported options are silently ignored by all APT versions\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBArchitectures\fR (\fBarch\fR) is a multivalue option defining for which architectures information should be downloaded\&. If this option isn\*(Aqt set the default is all architectures as defined by the \fBAPT::Architectures\fR config option\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBLanguages\fR (\fBlang\fR) is a multivalue option defining for which languages information such as translated package descriptions should be downloaded\&. If this option isn\*(Aqt set the default is all languages as defined by the \fBAcquire::Languages\fR config option\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBTargets\fR (\fBtarget\fR) is a multivalue option defining which download targets apt will try to acquire from this source\&. If not specified, the default set is defined by the \fBAcquire::IndexTargets\fR configuration scope (targets are specified by their name in the Created\-By field)\&. Additionally, targets can be enabled or disabled by using the Identifier field as an option with a boolean value instead of using this multivalue option\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBPDiffs\fR (\fBpdiffs\fR) is a yes/no value which controls if APT should try to use PDiffs to update old indexes instead of downloading the new indexes entirely\&. The value of this option is ignored if the repository doesn\*(Aqt announce the availability of PDiffs\&. Defaults to the value of the option with the same name for a specific index file defined in the \fBAcquire::IndexTargets\fR scope, which itself defaults to the value of configuration option \fBAcquire::PDiffs\fR which defaults to yes\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBBy\-Hash\fR (\fBby\-hash\fR) can have the value yes, no or force and controls if APT should try to acquire indexes via a URI constructed from a hashsum of the expected file instead of using the well\-known stable filename of the index\&. Using this can avoid hashsum mismatches, but requires a supporting mirror\&. A yes or no value activates/disables the use of this feature if this source indicates support for it, while force will enable the feature regardless of what the source indicates\&. Defaults to the value of the option of the same name for a specific index file defined in the \fBAcquire::IndexTargets\fR scope, which itself defaults to the value of configuration option \fBAcquire::By\-Hash\fR which defaults to yes\&. .RE .sp Furthermore, there are options which if set affect \fIall\fR sources with the same URI and Suite, so they have to be set on all such entries and can not be varied between different components\&. APT will try to detect and error out on such anomalies\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBAllow\-Insecure\fR (\fBallow\-insecure\fR), \fBAllow\-Weak\fR (\fBallow\-weak\fR) and \fBAllow\-Downgrade\-To\-Insecure\fR (\fBallow\-downgrade\-to\-insecure\fR) are boolean values which all default to no\&. If set to yes they circumvent parts of \fBapt-secure\fR(8) and should therefore not be used lightly! .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBTrusted\fR (\fBtrusted\fR) is a tri\-state value which defaults to APT deciding if a source is considered trusted or if warnings should be raised before e\&.g\&. packages are installed from this source\&. This option can be used to override that decision\&. The value yes tells APT always to consider this source as trusted, even if it doesn\*(Aqt pass authentication checks\&. It disables parts of \fBapt-secure\fR(8), and should therefore only be used in a local and trusted context (if at all) as otherwise security is breached\&. The value no does the opposite, causing the source to be handled as untrusted even if the authentication checks passed successfully\&. The default value can\*(Aqt be set explicitly\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBSigned\-By\fR (\fBsigned\-by\fR) is either an absolute path to a keyring file (has to be accessible and readable for the _apt user, so ensure everyone has read\-permissions on the file) or one or more fingerprints of keys either in the trusted\&.gpg keyring or in the keyrings in the trusted\&.gpg\&.d/ directory (see \fBapt\-key fingerprint\fR)\&. If the option is set, only the key(s) in this keyring or only the keys with these fingerprints are used for the \fBapt-secure\fR(8) verification of this repository\&. Defaults to the value of the option with the same name if set in the previously acquired Release file\&. Otherwise all keys in the trusted keyrings are considered valid signers for this repository\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBCheck\-Valid\-Until\fR (\fBcheck\-valid\-until\fR) is a yes/no value which controls if APT should try to detect replay attacks\&. A repository creator can declare a time until which the data provided in the repository should be considered valid, and if this time is reached, but no new data is provided, the data is considered expired and an error is raised\&. Besides increasing security, as a malicious attacker can\*(Aqt send old data forever to prevent a user from upgrading to a new version, this also helps users identify mirrors which are no longer updated\&. However, some repositories such as historic archives are not updated any more by design, so this check can be disabled by setting this option to no\&. Defaults to the value of configuration option \fBAcquire::Check\-Valid\-Until\fR which itself defaults to yes\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBValid\-Until\-Min\fR (\fBvalid\-until\-min\fR) and \fBValid\-Until\-Max\fR (\fBvalid\-until\-max\fR) can be used to raise or lower the time period in seconds in which the data from this repository is considered valid\&. \-Max can be especially useful if the repository provides no Valid\-Until field on its Release file to set your own value, while \-Min can be used to increase the valid time on seldom updated (local) mirrors of a more frequently updated but less accessible archive (which is in the sources\&.list as well) instead of disabling the check entirely\&. Default to the value of the configuration options \fBAcquire::Min\-ValidTime\fR and \fBAcquire::Max\-ValidTime\fR which are both unset by default\&. .RE .sp .SH "URI SPECIFICATION" .PP The currently recognized URI types are: .PP \fBfile\fR .RS 4 The file scheme allows an arbitrary directory in the file system to be considered an archive\&. This is useful for NFS mounts and local mirrors or archives\&. .RE .PP \fBcdrom\fR .RS 4 The cdrom scheme allows APT to use a local CD\-ROM drive with media swapping\&. Use the \fBapt-cdrom\fR(8) program to create cdrom entries in the source list\&. .RE .PP \fBhttp\fR .RS 4 The http scheme specifies an HTTP server for the archive\&. If an environment variable \fBhttp_proxy\fR is set with the format http://server:port/, the proxy server specified in \fBhttp_proxy\fR will be used\&. Users of authenticated HTTP/1\&.1 proxies may use a string of the format http://user:pass@server:port/\&. Note that this is an insecure method of authentication\&. .RE .PP \fBftp\fR .RS 4 The ftp scheme specifies an FTP server for the archive\&. APT\*(Aqs FTP behavior is highly configurable; for more information see the \fBapt.conf\fR(5) manual page\&. Please note that an FTP proxy can be specified by using the \fBftp_proxy\fR environment variable\&. It is possible to specify an HTTP proxy (HTTP proxy servers often understand FTP URLs) using this environment variable and \fIonly\fR this environment variable\&. Proxies using HTTP specified in the configuration file will be ignored\&. .RE .PP \fBcopy\fR .RS 4 The copy scheme is identical to the file scheme except that packages are copied into the cache directory instead of used directly at their location\&. This is useful for people using removable media to copy files around with APT\&. .RE .PP \fBrsh\fR, \fBssh\fR .RS 4 The rsh/ssh method invokes RSH/SSH to connect to a remote host and access the files as a given user\&. Prior configuration of rhosts or RSA keys is recommended\&. The standard \fBfind\fR and \fBdd\fR commands are used to perform the file transfers from the remote host\&. .RE .PP adding more recognizable URI types .RS 4 APT can be extended with more methods shipped in other optional packages, which should follow the naming scheme apt\-transport\-\fImethod\fR\&. For instance, the APT team also maintains the package apt\-transport\-https, which provides access methods for HTTPS URIs with features similar to the http method\&. Methods for using e\&.g\&. debtorrent are also available \- see \fBapt-transport-debtorrent\fR(1)\&. .RE .SH "EXAMPLES" .PP Uses the archive stored locally (or NFS mounted) at /home/apt/debian for stable/main, stable/contrib, and stable/non\-free\&. .sp .if n \{\ .RS 4 .\} .nf deb file:/home/apt/debian stable main contrib non\-free .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf Types: deb URIs: file:/home/apt/debian Suites: stable Components: main contrib non\-free .fi .if n \{\ .RE .\} .PP As above, except this uses the unstable (development) distribution\&. .sp .if n \{\ .RS 4 .\} .nf deb file:/home/apt/debian unstable main contrib non\-free .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf Types: deb URIs: file:/home/apt/debian Suites: unstable Components: main contrib non\-free .fi .if n \{\ .RE .\} .PP Sources specification for the above\&. .sp .if n \{\ .RS 4 .\} .nf deb\-src file:/home/apt/debian unstable main contrib non\-free .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf Types: deb\-src URIs: file:/home/apt/debian Suites: unstable Components: main contrib non\-free .fi .if n \{\ .RE .\} .PP The first line gets package information for the architectures in APT::Architectures while the second always retrieves amd64 and armel\&. .sp .if n \{\ .RS 4 .\} .nf deb http://deb\&.debian\&.org/debian stretch main deb [ arch=amd64,armel ] http://deb\&.debian\&.org/debian stretch main .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf Types: deb URIs: http://deb\&.debian\&.org/debian Suites: stretch Components: main Types: deb URIs: http://deb\&.debian\&.org/debian Suites: stretch Components: main Architectures: amd64 armel .fi .if n \{\ .RE .\} .PP Uses HTTP to access the archive at archive\&.debian\&.org, and uses only the hamm/main area\&. .sp .if n \{\ .RS 4 .\} .nf deb http://archive\&.debian\&.org/debian\-archive hamm main .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf Types: deb URIs: http://archive\&.debian\&.org/debian\-archive Suites: hamm Components: main .fi .if n \{\ .RE .\} .PP Uses FTP to access the archive at ftp\&.debian\&.org, under the debian directory, and uses only the stretch/contrib area\&. .sp .if n \{\ .RS 4 .\} .nf deb ftp://ftp\&.debian\&.org/debian stretch contrib .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf Types: deb URIs: ftp://ftp\&.debian\&.org/debian Suites: stretch Components: contrib .fi .if n \{\ .RE .\} .PP Uses FTP to access the archive at ftp\&.debian\&.org, under the debian directory, and uses only the unstable/contrib area\&. If this line appears as well as the one in the previous example in sources\&.list a single FTP session will be used for both resource lines\&. .sp .if n \{\ .RS 4 .\} .nf deb ftp://ftp\&.debian\&.org/debian unstable contrib .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf Types: deb URIs: ftp://ftp\&.debian\&.org/debian Suites: unstable Components: contrib .fi .if n \{\ .RE .\} .PP Uses HTTP to access the archive at ftp\&.tlh\&.debian\&.org, under the universe directory, and uses only files found under unstable/binary\-i386 on i386 machines, unstable/binary\-amd64 on amd64, and so forth for other supported architectures\&. [Note this example only illustrates how to use the substitution variable; official debian archives are not structured like this] .sp .if n \{\ .RS 4 .\} .nf deb http://ftp\&.tlh\&.debian\&.org/universe unstable/binary\-$(ARCH)/ .fi .if n \{\ .RE .\} .sp .sp .if n \{\ .RS 4 .\} .nf Types: deb URIs: http://ftp\&.tlh\&.debian\&.org/universe Suites: unstable/binary\-$(ARCH)/ .fi .if n \{\ .RE .\} .PP Uses HTTP to get binary packages as well as sources from the stable, testing and unstable suites and the components main and contrib\&. .sp .if n \{\ .RS 4 .\} .nf deb http://deb\&.debian\&.org/debian stable main contrib deb\-src http://deb\&.debian\&.org/debian stable main contrib deb http://deb\&.debian\&.org/debian testing main contrib deb\-src http://deb\&.debian\&.org/debian testing main contrib deb http://deb\&.debian\&.org/debian unstable main contrib deb\-src http://deb\&.debian\&.org/debian unstable main contrib .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf Types: deb deb\-src URIs: http://deb\&.debian\&.org/debian Suites: stable testing unstable Components: main contrib .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP \fBapt-get\fR(8), \fBapt.conf\fR(5), /usr/share/doc/apt\-doc/acquire\-additional\-files\&.txt .SH "BUGS" .PP \m[blue]\fBAPT bug page\fR\m[]\&\s-2\u[1]\d\s+2\&. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug\-reporting\&.txt or the \fBreportbug\fR(1) command\&. .SH "AUTHORS" .PP \fBJason Gunthorpe\fR .RS 4 .RE .PP \fBAPT team\fR .RS 4 .RE .SH "NOTES" .IP " 1." 4 APT bug page .RS 4 \%http://bugs.debian.org/src:apt .RE ================================================ FILE: packages/apt/man/man8/apt-cache.8 ================================================ '\" t .\" Title: apt-cache .\" Author: Jason Gunthorpe .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 25\ \&November\ \&2016 .\" Manual: APT .\" Source: APT 1.4.9 .\" Language: English .\" .TH "APT\-CACHE" "8" "25\ \&November\ \&2016" "APT 1.4.9" "APT" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" apt-cache \- query the APT cache .SH "SYNOPSIS" .HP \w'\fBapt\-cache\fR\ 'u \fBapt\-cache\fR [\fB\-agipns\fR] [\fB\-o=\fR\fB\fIconfig_string\fR\fR] [\fB\-c=\fR\fB\fIconfig_file\fR\fR] {gencaches | showpkg\ \fIpkg\fR... | showsrc\ \fIpkg\fR... | stats | dump | dumpavail | unmet | search\ \fIregex\fR... | show\ \fIpkg\fR\ [{=\fIpkg_version_number\fR\ |\ /\fItarget_release\fR}]... | depends\ \fIpkg\fR\ [{=\fIpkg_version_number\fR\ |\ /\fItarget_release\fR}]... | rdepends\ \fIpkg\fR\ [{=\fIpkg_version_number\fR\ |\ /\fItarget_release\fR}]... | pkgnames\ [\fIprefix\fR] | dotty\ \fIpkg\fR\ [{=\fIpkg_version_number\fR\ |\ /\fItarget_release\fR}]... | xvcg\ \fIpkg\fR\ [{=\fIpkg_version_number\fR\ |\ /\fItarget_release\fR}]... | policy\ [\fIpkg\fR...] | madison\ \fIpkg\fR... | {\-v\ |\ \-\-version} | {\-h\ |\ \-\-help}} .SH "DESCRIPTION" .PP \fBapt\-cache\fR performs a variety of operations on APT\*(Aqs package cache\&. \fBapt\-cache\fR does not manipulate the state of the system but does provide operations to search and generate interesting output from the package metadata\&. The metadata is acquired and updated via the \*(Aqupdate\*(Aq command of e\&.g\&. \fBapt\-get\fR, so that it can be outdated if the last update is too long ago, but in exchange \fBapt\-cache\fR works independently of the availability of the configured sources (e\&.g\&. offline)\&. .PP Unless the \fB\-h\fR, or \fB\-\-help\fR option is given, one of the commands below must be present\&. .PP \fBgencaches\fR .RS 4 gencaches creates APT\*(Aqs package cache\&. This is done implicitly by all commands needing this cache if it is missing or outdated\&. .RE .PP \fBshowpkg\fR \fB\fIpkg\fR\fR\fB\&...\fR .RS 4 showpkg displays information about the packages listed on the command line\&. Remaining arguments are package names\&. The available versions and reverse dependencies of each package listed are listed, as well as forward dependencies for each version\&. Forward (normal) dependencies are those packages upon which the package in question depends; reverse dependencies are those packages that depend upon the package in question\&. Thus, forward dependencies must be satisfied for a package, but reverse dependencies need not be\&. For instance, \fBapt\-cache showpkg libreadline2\fR would produce output similar to the following: .sp .if n \{\ .RS 4 .\} .nf Package: libreadline2 Versions: 2\&.1\-12(/var/state/apt/lists/foo_Packages), Reverse Depends: libreadlineg2,libreadline2 libreadline2\-altdev,libreadline2 Dependencies: 2\&.1\-12 \- libc5 (2 5\&.4\&.0\-0) ncurses3\&.0 (0 (null)) Provides: 2\&.1\-12 \- Reverse Provides: .fi .if n \{\ .RE .\} Thus it may be seen that libreadline2, version 2\&.1\-12, depends on libc5 and ncurses3\&.0 which must be installed for libreadline2 to work\&. In turn, libreadlineg2 and libreadline2\-altdev depend on libreadline2\&. If libreadline2 is installed, libc5 and ncurses3\&.0 (and ldso) must also be installed; libreadlineg2 and libreadline2\-altdev do not have to be installed\&. For the specific meaning of the remainder of the output it is best to consult the apt source code\&. .RE .PP \fBstats\fR .RS 4 stats displays some statistics about the cache\&. No further arguments are expected\&. Statistics reported are: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Total package names is the number of package names found in the cache\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Normal packages is the number of regular, ordinary package names; these are packages that bear a one\-to\-one correspondence between their names and the names used by other packages for them in dependencies\&. The majority of packages fall into this category\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Pure virtual packages is the number of packages that exist only as a virtual package name; that is, packages only "provide" the virtual package name, and no package actually uses the name\&. For instance, "mail\-transport\-agent" in the Debian system is a pure virtual package; several packages provide "mail\-transport\-agent", but there is no package named "mail\-transport\-agent"\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Single virtual packages is the number of packages with only one package providing a particular virtual package\&. For example, in the Debian system, "X11\-text\-viewer" is a virtual package, but only one package, xless, provides "X11\-text\-viewer"\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Mixed virtual packages is the number of packages that either provide a particular virtual package or have the virtual package name as the package name\&. For instance, in the Debian system, "debconf" is both an actual package, and provided by the debconf\-tiny package\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Missing is the number of package names that were referenced in a dependency but were not provided by any package\&. Missing packages may be an evidence if a full distribution is not accessed, or if a package (real or virtual) has been dropped from the distribution\&. Usually they are referenced from Conflicts or Breaks statements\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Total distinct versions is the number of package versions found in the cache\&. If more than one distribution is being accessed (for instance, "stable" and "unstable"), this value can be considerably larger than the number of total package names\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Total dependencies is the number of dependency relationships claimed by all of the packages in the cache\&. .RE .sp .RE .PP \fBshowsrc\fR \fB\fIpkg\fR\fR\fB\&...\fR .RS 4 showsrc displays all the source package records that match the given package names\&. All versions are shown, as well as all records that declare the name to be a binary package\&. Use \fB\-\-only\-source\fR to display only source package names\&. .RE .PP \fBdump\fR .RS 4 dump shows a short listing of every package in the cache\&. It is primarily for debugging\&. .RE .PP \fBdumpavail\fR .RS 4 dumpavail prints out an available list to stdout\&. This is suitable for use with \fBdpkg\fR(1) and is used by the \fBdselect\fR(1) method\&. .RE .PP \fBunmet\fR .RS 4 unmet displays a summary of all unmet dependencies in the package cache\&. .RE .PP \fBshow\fR \fB\fIpkg\fR\fR\fB\&...\fR .RS 4 show performs a function similar to \fBdpkg \-\-print\-avail\fR; it displays the package records for the named packages\&. .RE .PP \fBsearch\fR \fB\fIregex\fR\fR\fB\&...\fR .RS 4 search performs a full text search on all available package lists for the POSIX regex pattern given, see \fBregex\fR(7)\&. It searches the package names and the descriptions for an occurrence of the regular expression and prints out the package name and the short description, including virtual package names\&. If \fB\-\-full\fR is given then output identical to show is produced for each matched package, and if \fB\-\-names\-only\fR is given then the long description is not searched, only the package name and provided packages are\&. .sp Separate arguments can be used to specify multiple search patterns that are and\*(Aqed together\&. .RE .PP \fBdepends\fR \fB\fIpkg\fR\fR\fB\&...\fR .RS 4 depends shows a listing of each dependency a package has and all the possible other packages that can fulfill that dependency\&. .RE .PP \fBrdepends\fR \fB\fIpkg\fR\fR\fB\&...\fR .RS 4 rdepends shows a listing of each reverse dependency a package has\&. .RE .PP \fBpkgnames\fR [\fIprefix\fR] .RS 4 This command prints the name of each package APT knows\&. The optional argument is a prefix match to filter the name list\&. The output is suitable for use in a shell tab complete function and the output is generated extremely quickly\&. This command is best used with the \fB\-\-generate\fR option\&. .sp Note that a package which APT knows of is not necessarily available to download, installable or installed, e\&.g\&. virtual packages are also listed in the generated list\&. .RE .PP \fBdotty\fR \fB\fIpkg\fR\fR\fB\&...\fR .RS 4 dotty takes a list of packages on the command line and generates output suitable for use by dotty from the \m[blue]\fBGraphViz\fR\m[]\&\s-2\u[1]\d\s+2 package\&. The result will be a set of nodes and edges representing the relationships between the packages\&. By default the given packages will trace out all dependent packages; this can produce a very large graph\&. To limit the output to only the packages listed on the command line, set the APT::Cache::GivenOnly option\&. .sp The resulting nodes will have several shapes; normal packages are boxes, pure virtual packages are triangles, mixed virtual packages are diamonds, missing packages are hexagons\&. Orange boxes mean recursion was stopped (leaf packages), blue lines are pre\-depends, green lines are conflicts\&. .sp Caution, dotty cannot graph larger sets of packages\&. .RE .PP \fBxvcg\fR \fB\fIpkg\fR\fR\fB\&...\fR .RS 4 The same as dotty, only for xvcg from the \m[blue]\fBVCG tool\fR\m[]\&\s-2\u[2]\d\s+2\&. .RE .PP \fBpolicy\fR [\fIpkg\fR\&...] .RS 4 policy is meant to help debug issues relating to the preferences file\&. With no arguments it will print out the priorities of each source\&. Otherwise it prints out detailed information about the priority selection of the named package\&. .RE .PP \fBmadison\fR \fB\fIpkg\fR\fR\fB\&...\fR .RS 4 apt\-cache\*(Aqs madison command attempts to mimic the output format and a subset of the functionality of the Debian archive management tool, madison\&. It displays available versions of a package in a tabular format\&. Unlike the original madison, it can only display information for the architecture for which APT has retrieved package lists (APT::Architecture)\&. .RE .SH "OPTIONS" .PP All command line options may be set using the configuration file, the descriptions indicate the configuration option to set\&. For boolean options you can override the config file by using something like \fB\-f\-\fR,\fB\-\-no\-f\fR, \fB\-f=no\fR or several other variations\&. .PP \fB\-p\fR, \fB\-\-pkg\-cache\fR .RS 4 Select the file to store the package cache\&. The package cache is the primary cache used by all operations\&. Configuration Item: Dir::Cache::pkgcache\&. .RE .PP \fB\-s\fR, \fB\-\-src\-cache\fR .RS 4 Select the file to store the source cache\&. The source is used only by gencaches and it stores a parsed version of the package information from remote sources\&. When building the package cache the source cache is used to avoid reparsing all of the package files\&. Configuration Item: Dir::Cache::srcpkgcache\&. .RE .PP \fB\-q\fR, \fB\-\-quiet\fR .RS 4 Quiet; produces output suitable for logging, omitting progress indicators\&. More q\*(Aqs will produce more quietness up to a maximum of 2\&. You can also use \fB\-q=#\fR to set the quietness level, overriding the configuration file\&. Configuration Item: quiet\&. .RE .PP \fB\-i\fR, \fB\-\-important\fR .RS 4 Print only important dependencies; for use with unmet and depends\&. Causes only Depends and Pre\-Depends relations to be printed\&. Configuration Item: APT::Cache::Important\&. .RE .PP \fB\-\-no\-pre\-depends\fR, \fB\-\-no\-depends\fR, \fB\-\-no\-recommends\fR, \fB\-\-no\-suggests\fR, \fB\-\-no\-conflicts\fR, \fB\-\-no\-breaks\fR, \fB\-\-no\-replaces\fR, \fB\-\-no\-enhances\fR .RS 4 Per default the \fBdepends\fR and \fBrdepends\fR print all dependencies\&. This can be tweaked with these flags which will omit the specified dependency type\&. Configuration Item: APT::Cache::Show\fIDependencyType\fR e\&.g\&. APT::Cache::ShowRecommends\&. .RE .PP \fB\-\-implicit\fR .RS 4 Per default \fBdepends\fR and \fBrdepends\fR print only dependencies explicitly expressed in the metadata\&. With this flag it will also show dependencies implicitly added based on the encountered data\&. A Conflicts: foo e\&.g\&. expresses implicitly that this package also conflicts with the package foo from any other architecture\&. Configuration Item: APT::Cache::ShowImplicit\&. .RE .PP \fB\-f\fR, \fB\-\-full\fR .RS 4 Print full package records when searching\&. Configuration Item: APT::Cache::ShowFull\&. .RE .PP \fB\-a\fR, \fB\-\-all\-versions\fR .RS 4 Print full records for all available versions\&. This is the default; to turn it off, use \fB\-\-no\-all\-versions\fR\&. If \fB\-\-no\-all\-versions\fR is specified, only the candidate version will be displayed (the one which would be selected for installation)\&. This option is only applicable to the show command\&. Configuration Item: APT::Cache::AllVersions\&. .RE .PP \fB\-g\fR, \fB\-\-generate\fR .RS 4 Perform automatic package cache regeneration, rather than use the cache as it is\&. This is the default; to turn it off, use \fB\-\-no\-generate\fR\&. Configuration Item: APT::Cache::Generate\&. .RE .PP \fB\-\-names\-only\fR, \fB\-n\fR .RS 4 Only search on the package and provided package names, not the long descriptions\&. Configuration Item: APT::Cache::NamesOnly\&. .RE .PP \fB\-\-all\-names\fR .RS 4 Make pkgnames print all names, including virtual packages and missing dependencies\&. Configuration Item: APT::Cache::AllNames\&. .RE .PP \fB\-\-recurse\fR .RS 4 Make depends and rdepends recursive so that all packages mentioned are printed once\&. Configuration Item: APT::Cache::RecurseDepends\&. .RE .PP \fB\-\-installed\fR .RS 4 Limit the output of depends and rdepends to packages which are currently installed\&. Configuration Item: APT::Cache::Installed\&. .RE .PP \fB\-\-with\-source\fR \fB\fIfilename\fR\fR .RS 4 Adds the given file as a source for metadata\&. Can be repeated to add multiple files\&. Supported are currently *\&.deb, *\&.dsc, *\&.changes, Sources and Packages files as well as source package directories\&. Files are matched based on their name only, not their content! .sp Sources and Packages can be compressed in any format apt supports as long as they have the correct extension\&. If you need to store multiple of these files in one directory you can prefix a name of your choice with the last character being an underscore ("_")\&. Example: my\&.example_Packages\&.xz .sp Note that these sources are treated as trusted (see \fBapt-secure\fR(8))\&. Configuration Item: APT::Sources::With\&. .RE .PP \fB\-h\fR, \fB\-\-help\fR .RS 4 Show a short usage summary\&. .RE .PP \fB\-v\fR, \fB\-\-version\fR .RS 4 Show the program version\&. .RE .PP \fB\-c\fR, \fB\-\-config\-file\fR .RS 4 Configuration File; Specify a configuration file to use\&. The program will read the default configuration file and then this configuration file\&. If configuration settings need to be set before the default configuration files are parsed specify a file with the \fBAPT_CONFIG\fR environment variable\&. See \fBapt.conf\fR(5) for syntax information\&. .RE .PP \fB\-o\fR, \fB\-\-option\fR .RS 4 Set a Configuration Option; This will set an arbitrary configuration option\&. The syntax is \fB\-o Foo::Bar=bar\fR\&. \fB\-o\fR and \fB\-\-option\fR can be used multiple times to set different options\&. .RE .SH "FILES" .PP /etc/apt/sources\&.list .RS 4 Locations to fetch packages from\&. Configuration Item: Dir::Etc::SourceList\&. .RE .PP /etc/apt/sources\&.list\&.d/ .RS 4 File fragments for locations to fetch packages from\&. Configuration Item: Dir::Etc::SourceParts\&. .RE .PP /var/lib/apt/lists/ .RS 4 Storage area for state information for each package resource specified in \fBsources.list\fR(5) Configuration Item: Dir::State::Lists\&. .RE .PP /var/lib/apt/lists/partial/ .RS 4 Storage area for state information in transit\&. Configuration Item: Dir::State::Lists (partial will be implicitly appended) .RE .SH "SEE ALSO" .PP \fBapt.conf\fR(5), \fBsources.list\fR(5), \fBapt-get\fR(8) .SH "DIAGNOSTICS" .PP \fBapt\-cache\fR returns zero on normal operation, decimal 100 on error\&. .SH "BUGS" .PP \m[blue]\fBAPT bug page\fR\m[]\&\s-2\u[3]\d\s+2\&. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug\-reporting\&.txt or the \fBreportbug\fR(1) command\&. .SH "AUTHORS" .PP \fBJason Gunthorpe\fR .RS 4 .RE .PP \fBAPT team\fR .RS 4 .RE .SH "NOTES" .IP " 1." 4 GraphViz .RS 4 \%http://www.research.att.com/sw/tools/graphviz/ .RE .IP " 2." 4 VCG tool .RS 4 \%http://rw4.cs.uni-sb.de/users/sander/html/gsvcg1.html .RE .IP " 3." 4 APT bug page .RS 4 \%http://bugs.debian.org/src:apt .RE ================================================ FILE: packages/apt/man/man8/apt-config.8 ================================================ '\" t .\" Title: apt-config .\" Author: Jason Gunthorpe .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 30\ \&November\ \&2013 .\" Manual: APT .\" Source: APT 1.4.9 .\" Language: English .\" .TH "APT\-CONFIG" "8" "30\ \&November\ \&2013" "APT 1.4.9" "APT" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" apt-config \- APT Configuration Query program .SH "SYNOPSIS" .HP \w'\fBapt\-config\fR\ 'u \fBapt\-config\fR [\fB\-\-empty\fR] [\fB\-\-format\ \*(Aq\fR\fB\fI%f\ "%v";%n\fR\fR\fB\*(Aq\fR] [\fB\-o=\fR\fB\fIconfig_string\fR\fR] [\fB\-c=\fR\fB\fIconfig_file\fR\fR] {shell | dump | {\-v\ |\ \-\-version} | {\-h\ |\ \-\-help}} .SH "DESCRIPTION" .PP \fBapt\-config\fR is an internal program used by various portions of the APT suite to provide consistent configurability\&. It accesses the main configuration file /etc/apt/apt\&.conf in a manner that is easy to use for scripted applications\&. .PP Unless the \fB\-h\fR, or \fB\-\-help\fR option is given, one of the commands below must be present\&. .PP \fBshell\fR .RS 4 shell is used to access the configuration information from a shell script\&. It is given pairs of arguments, the first being a shell variable and the second the configuration value to query\&. As output it lists shell assignment commands for each value present\&. In a shell script it should be used as follows: .sp .if n \{\ .RS 4 .\} .nf OPTS="\-f" RES=`apt\-config shell OPTS MyApp::options` eval $RES .fi .if n \{\ .RE .\} This will set the shell environment variable $OPTS to the value of MyApp::options with a default of \fB\-f\fR\&. .sp The configuration item may be postfixed with a /[fdbi]\&. f returns file names, d returns directories, b returns true or false and i returns an integer\&. Each of the returns is normalized and verified internally\&. .RE .PP \fBdump\fR .RS 4 Just show the contents of the configuration space\&. .RE .SH "OPTIONS" .PP All command line options may be set using the configuration file, the descriptions indicate the configuration option to set\&. For boolean options you can override the config file by using something like \fB\-f\-\fR,\fB\-\-no\-f\fR, \fB\-f=no\fR or several other variations\&. .PP \fB\-\-empty\fR .RS 4 Include options which have an empty value\&. This is the default, so use \-\-no\-empty to remove them from the output\&. .RE .PP \fB\-\-format \*(Aq\fR\fB\fI%f "%v";%n\fR\fR\fB\*(Aq\fR .RS 4 Defines the output of each config option\&. %t will be replaced with its individual name, %f with its full hierarchical name and %v with its value\&. Use uppercase letters and special characters in the value will be encoded to ensure that it can e\&.g\&. be safely used in a quoted\-string as defined by RFC822\&. Additionally %n will be replaced by a newline, and %N by a tab\&. A % can be printed by using %%\&. .RE .PP \fB\-h\fR, \fB\-\-help\fR .RS 4 Show a short usage summary\&. .RE .PP \fB\-v\fR, \fB\-\-version\fR .RS 4 Show the program version\&. .RE .PP \fB\-c\fR, \fB\-\-config\-file\fR .RS 4 Configuration File; Specify a configuration file to use\&. The program will read the default configuration file and then this configuration file\&. If configuration settings need to be set before the default configuration files are parsed specify a file with the \fBAPT_CONFIG\fR environment variable\&. See \fBapt.conf\fR(5) for syntax information\&. .RE .PP \fB\-o\fR, \fB\-\-option\fR .RS 4 Set a Configuration Option; This will set an arbitrary configuration option\&. The syntax is \fB\-o Foo::Bar=bar\fR\&. \fB\-o\fR and \fB\-\-option\fR can be used multiple times to set different options\&. .RE .SH "SEE ALSO" .PP \fBapt.conf\fR(5) .SH "DIAGNOSTICS" .PP \fBapt\-config\fR returns zero on normal operation, decimal 100 on error\&. .SH "BUGS" .PP \m[blue]\fBAPT bug page\fR\m[]\&\s-2\u[1]\d\s+2\&. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug\-reporting\&.txt or the \fBreportbug\fR(1) command\&. .SH "AUTHORS" .PP \fBJason Gunthorpe\fR .RS 4 .RE .PP \fBAPT team\fR .RS 4 .RE .SH "NOTES" .IP " 1." 4 APT bug page .RS 4 \%http://bugs.debian.org/src:apt .RE ================================================ FILE: packages/apt/man/man8/apt-get.8 ================================================ '\" t .\" Title: apt-get .\" Author: Jason Gunthorpe .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 22\ \&February\ \&2017 .\" Manual: APT .\" Source: APT 1.4.9 .\" Language: English .\" .TH "APT\-GET" "8" "22\ \&February\ \&2017" "APT 1.4.9" "APT" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" apt-get \- APT package handling utility \-\- command\-line interface .SH "SYNOPSIS" .HP \w'\fBapt\-get\fR\ 'u \fBapt\-get\fR [\fB\-asqdyfmubV\fR] [\fB\-o=\fR\fB\fIconfig_string\fR\fR] [\fB\-c=\fR\fB\fIconfig_file\fR\fR] [\fB\-t=\fR\fB\fItarget_release\fR\fR] [\fB\-a=\fR\fB\fIarchitecture\fR\fR] {update | upgrade | dselect\-upgrade | dist\-upgrade | install\ \fIpkg\fR\ [{=\fIpkg_version_number\fR\ |\ /\fItarget_release\fR}]... | remove\ \fIpkg\fR... | purge\ \fIpkg\fR... | source\ \fIpkg\fR\ [{=\fIpkg_version_number\fR\ |\ /\fItarget_release\fR}]... | build\-dep\ \fIpkg\fR\ [{=\fIpkg_version_number\fR\ |\ /\fItarget_release\fR}]... | download\ \fIpkg\fR\ [{=\fIpkg_version_number\fR\ |\ /\fItarget_release\fR}]... | check | clean | autoclean | autoremove | {\-v\ |\ \-\-version} | {\-h\ |\ \-\-help}} .SH "DESCRIPTION" .PP \fBapt\-get\fR is the command\-line tool for handling packages, and may be considered the user\*(Aqs "back\-end" to other tools using the APT library\&. Several "front\-end" interfaces exist, such as \fBaptitude\fR(8), \fBsynaptic\fR(8) and \fBwajig\fR(1)\&. .PP Unless the \fB\-h\fR, or \fB\-\-help\fR option is given, one of the commands below must be present\&. .PP \fBupdate\fR .RS 4 update is used to resynchronize the package index files from their sources\&. The indexes of available packages are fetched from the location(s) specified in /etc/apt/sources\&.list\&. For example, when using a Debian archive, this command retrieves and scans the Packages\&.gz files, so that information about new and updated packages is available\&. An update should always be performed before an upgrade or dist\-upgrade\&. Please be aware that the overall progress meter will be incorrect as the size of the package files cannot be known in advance\&. .RE .PP \fBupgrade\fR .RS 4 upgrade is used to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources\&.list\&. Packages currently installed with new versions available are retrieved and upgraded; under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed\&. New versions of currently installed packages that cannot be upgraded without changing the install status of another package will be left at their current version\&. An update must be performed first so that \fBapt\-get\fR knows that new versions of packages are available\&. .RE .PP \fBdist\-upgrade\fR .RS 4 dist\-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; \fBapt\-get\fR has a "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary\&. The dist\-upgrade command may therefore remove some packages\&. The /etc/apt/sources\&.list file contains a list of locations from which to retrieve desired package files\&. See also \fBapt_preferences\fR(5) for a mechanism for overriding the general settings for individual packages\&. .RE .PP \fBdselect\-upgrade\fR .RS 4 dselect\-upgrade is used in conjunction with the traditional Debian packaging front\-end, \fBdselect\fR(1)\&. dselect\-upgrade follows the changes made by \fBdselect\fR(1) to the Status field of available packages, and performs the actions necessary to realize that state (for instance, the removal of old and the installation of new packages)\&. .RE .PP \fBinstall\fR .RS 4 install is followed by one or more packages desired for installation or upgrading\&. Each package is a package name, not a fully qualified filename (for instance, in a Debian system, apt\-utils would be the argument provided, not apt\-utils_1\&.4\&.9_amd64\&.deb)\&. All packages required by the package(s) specified for installation will also be retrieved and installed\&. The /etc/apt/sources\&.list file is used to locate the desired packages\&. If a hyphen is appended to the package name (with no intervening space), the identified package will be removed if it is installed\&. Similarly a plus sign can be used to designate a package to install\&. These latter features may be used to override decisions made by apt\-get\*(Aqs conflict resolution system\&. .sp A specific version of a package can be selected for installation by following the package name with an equals and the version of the package to select\&. This will cause that version to be located and selected for install\&. Alternatively a specific distribution can be selected by following the package name with a slash and the version of the distribution or the Archive name (stable, testing, unstable)\&. .sp Both of the version selection mechanisms can downgrade packages and must be used with care\&. .sp This is also the target to use if you want to upgrade one or more already\-installed packages without upgrading every package you have on your system\&. Unlike the "upgrade" target, which installs the newest version of all currently installed packages, "install" will install the newest version of only the package(s) specified\&. Simply provide the name of the package(s) you wish to upgrade, and if a newer version is available, it (and its dependencies, as described above) will be downloaded and installed\&. .sp Finally, the \fBapt_preferences\fR(5) mechanism allows you to create an alternative installation policy for individual packages\&. .sp If no package matches the given expression and the expression contains one of \*(Aq\&.\*(Aq, \*(Aq?\*(Aq or \*(Aq*\*(Aq then it is assumed to be a POSIX regular expression, and it is applied to all package names in the database\&. Any matches are then installed (or removed)\&. Note that matching is done by substring so \*(Aqlo\&.*\*(Aq matches \*(Aqhow\-lo\*(Aq and \*(Aqlowest\*(Aq\&. If this is undesired, anchor the regular expression with a \*(Aq^\*(Aq or \*(Aq$\*(Aq character, or create a more specific regular expression\&. .RE .PP \fBremove\fR .RS 4 remove is identical to install except that packages are removed instead of installed\&. Note that removing a package leaves its configuration files on the system\&. If a plus sign is appended to the package name (with no intervening space), the identified package will be installed instead of removed\&. .RE .PP \fBpurge\fR .RS 4 purge is identical to remove except that packages are removed and purged (any configuration files are deleted too)\&. .RE .PP \fBsource\fR .RS 4 source causes \fBapt\-get\fR to fetch source packages\&. APT will examine the available packages to decide which source package to fetch\&. It will then find and download into the current directory the newest available version of that source package while respecting the default release, set with the option APT::Default\-Release, the \fB\-t\fR option or per package with the pkg/release syntax, if possible\&. .sp Source packages are tracked separately from binary packages via deb\-src lines in the \fBsources.list\fR(5) file\&. This means that you will need to add such a line for each repository you want to get sources from; otherwise you will probably get either the wrong (too old/too new) source versions or none at all\&. .sp If the \fB\-\-compile\fR option is specified then the package will be compiled to a binary \&.deb using \fBdpkg\-buildpackage\fR for the architecture as defined by the \fB\-\-host\-architecture\fR option\&. If \fB\-\-download\-only\fR is specified then the source package will not be unpacked\&. .sp A specific source version can be retrieved by postfixing the source name with an equals and then the version to fetch, similar to the mechanism used for the package files\&. This enables exact matching of the source package name and version, implicitly enabling the APT::Get::Only\-Source option\&. .sp Note that source packages are not installed and tracked in the \fBdpkg\fR database like binary packages; they are simply downloaded to the current directory, like source tarballs\&. .RE .PP \fBbuild\-dep\fR .RS 4 build\-dep causes apt\-get to install/remove packages in an attempt to satisfy the build dependencies for a source package\&. By default the dependencies are satisfied to build the package natively\&. If desired a host\-architecture can be specified with the \fB\-\-host\-architecture\fR option instead\&. .RE .PP \fBcheck\fR .RS 4 check is a diagnostic tool; it updates the package cache and checks for broken dependencies\&. .RE .PP \fBdownload\fR .RS 4 download will download the given binary package into the current directory\&. .RE .PP \fBclean\fR .RS 4 clean clears out the local repository of retrieved package files\&. It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/\&. .RE .PP \fBautoclean\fR (and the \fBauto\-clean\fR alias since 1\&.1) .RS 4 Like clean, autoclean clears out the local repository of retrieved package files\&. The difference is that it only removes package files that can no longer be downloaded, and are largely useless\&. This allows a cache to be maintained over a long period without it growing out of control\&. The configuration option APT::Clean\-Installed will prevent installed packages from being erased if it is set to off\&. .RE .PP \fBautoremove\fR (and the \fBauto\-remove\fR alias since 1\&.1) .RS 4 autoremove is used to remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed\&. .RE .PP \fBchangelog\fR .RS 4 changelog tries to download the changelog of a package and displays it through \fBsensible\-pager\fR\&. By default it displays the changelog for the version that is installed\&. However, you can specify the same options as for the \fBinstall\fR command\&. .RE .PP \fBindextargets\fR .RS 4 Displays by default a deb822 formatted listing of information about all data files (aka index targets) \fBapt\-get update\fR would download\&. Supports a \fB\-\-format\fR option to modify the output format as well as accepts lines of the default output to filter the records by\&. The command is mainly used as an interface for external tools working with APT to get information as well as filenames for downloaded files so they can use them as well instead of downloading them again on their own\&. Detailed documentation is omitted here and can instead be found in the file /usr/share/doc/apt\-doc/acquire\-additional\-files\&.txt shipped by the apt\-doc package\&. .RE .SH "OPTIONS" .PP All command line options may be set using the configuration file, the descriptions indicate the configuration option to set\&. For boolean options you can override the config file by using something like \fB\-f\-\fR,\fB\-\-no\-f\fR, \fB\-f=no\fR or several other variations\&. .PP \fB\-\-no\-install\-recommends\fR .RS 4 Do not consider recommended packages as a dependency for installing\&. Configuration Item: APT::Install\-Recommends\&. .RE .PP \fB\-\-install\-suggests\fR .RS 4 Consider suggested packages as a dependency for installing\&. Configuration Item: APT::Install\-Suggests\&. .RE .PP \fB\-d\fR, \fB\-\-download\-only\fR .RS 4 Download only; package files are only retrieved, not unpacked or installed\&. Configuration Item: APT::Get::Download\-Only\&. .RE .PP \fB\-f\fR, \fB\-\-fix\-broken\fR .RS 4 Fix; attempt to correct a system with broken dependencies in place\&. This option, when used with install/remove, can omit any packages to permit APT to deduce a likely solution\&. If packages are specified, these have to completely correct the problem\&. The option is sometimes necessary when running APT for the first time; APT itself does not allow broken package dependencies to exist on a system\&. It is possible that a system\*(Aqs dependency structure can be so corrupt as to require manual intervention (which usually means using \fBdpkg \-\-remove\fR to eliminate some of the offending packages)\&. Use of this option together with \fB\-m\fR may produce an error in some situations\&. Configuration Item: APT::Get::Fix\-Broken\&. .RE .PP \fB\-m\fR, \fB\-\-ignore\-missing\fR, \fB\-\-fix\-missing\fR .RS 4 Ignore missing packages; if packages cannot be retrieved or fail the integrity check after retrieval (corrupted package files), hold back those packages and handle the result\&. Use of this option together with \fB\-f\fR may produce an error in some situations\&. If a package is selected for installation (particularly if it is mentioned on the command line) and it could not be downloaded then it will be silently held back\&. Configuration Item: APT::Get::Fix\-Missing\&. .RE .PP \fB\-\-no\-download\fR .RS 4 Disables downloading of packages\&. This is best used with \fB\-\-ignore\-missing\fR to force APT to use only the \&.debs it has already downloaded\&. Configuration Item: APT::Get::Download\&. .RE .PP \fB\-q\fR, \fB\-\-quiet\fR .RS 4 Quiet; produces output suitable for logging, omitting progress indicators\&. More q\*(Aqs will produce more quiet up to a maximum of 2\&. You can also use \fB\-q=#\fR to set the quiet level, overriding the configuration file\&. Note that quiet level 2 implies \fB\-y\fR; you should never use \-qq without a no\-action modifier such as \-d, \-\-print\-uris or \-s as APT may decide to do something you did not expect\&. Configuration Item: quiet\&. .RE .PP \fB\-s\fR, \fB\-\-simulate\fR, \fB\-\-just\-print\fR, \fB\-\-dry\-run\fR, \fB\-\-recon\fR, \fB\-\-no\-act\fR .RS 4 No action; perform a simulation of events that would occur based on the current system state but do not actually change the system\&. Locking will be disabled (\fBDebug::NoLocking\fR) so the system state could change while \fBapt\-get\fR is running\&. Simulations can also be executed by non\-root users which might not have read access to all apt configuration distorting the simulation\&. A notice expressing this warning is also shown by default for non\-root users (\fBAPT::Get::Show\-User\-Simulation\-Note\fR)\&. Configuration Item: APT::Get::Simulate\&. .sp Simulated runs print out a series of lines, each representing a \fBdpkg\fR operation: configure (Conf), remove (Remv) or unpack (Inst)\&. Square brackets indicate broken packages, and empty square brackets indicate breaks that are of no consequence (rare)\&. .RE .PP \fB\-y\fR, \fB\-\-yes\fR, \fB\-\-assume\-yes\fR .RS 4 Automatic yes to prompts; assume "yes" as answer to all prompts and run non\-interactively\&. If an undesirable situation, such as changing a held package, trying to install a unauthenticated package or removing an essential package occurs then apt\-get will abort\&. Configuration Item: APT::Get::Assume\-Yes\&. .RE .PP \fB\-\-assume\-no\fR .RS 4 Automatic "no" to all prompts\&. Configuration Item: APT::Get::Assume\-No\&. .RE .PP \fB\-\-no\-show\-upgraded\fR .RS 4 Do not show a list of all packages that are to be upgraded\&. Configuration Item: APT::Get::Show\-Upgraded\&. .RE .PP \fB\-V\fR, \fB\-\-verbose\-versions\fR .RS 4 Show full versions for upgraded and installed packages\&. Configuration Item: APT::Get::Show\-Versions\&. .RE .PP \fB\-a\fR, \fB\-\-host\-architecture\fR .RS 4 This option controls the architecture packages are built for by \fBapt\-get source \-\-compile\fR and how cross\-builddependencies are satisfied\&. By default is it not set which means that the host architecture is the same as the build architecture (which is defined by APT::Architecture)\&. Configuration Item: APT::Get::Host\-Architecture\&. .RE .PP \fB\-P\fR, \fB\-\-build\-profiles\fR .RS 4 This option controls the activated build profiles for which a source package is built by \fBapt\-get source \-\-compile\fR and how build dependencies are satisfied\&. By default no build profile is active\&. More than one build profile can be activated at a time by concatenating them with a comma\&. Configuration Item: APT::Build\-Profiles\&. .RE .PP \fB\-b\fR, \fB\-\-compile\fR, \fB\-\-build\fR .RS 4 Compile source packages after downloading them\&. Configuration Item: APT::Get::Compile\&. .RE .PP \fB\-\-ignore\-hold\fR .RS 4 Ignore package holds; this causes \fBapt\-get\fR to ignore a hold placed on a package\&. This may be useful in conjunction with dist\-upgrade to override a large number of undesired holds\&. Configuration Item: APT::Ignore\-Hold\&. .RE .PP \fB\-\-with\-new\-pkgs\fR .RS 4 Allow installing new packages when used in conjunction with upgrade\&. This is useful if the update of a installed package requires new dependencies to be installed\&. Instead of holding the package back upgrade will upgrade the package and install the new dependencies\&. Note that upgrade with this option will never remove packages, only allow adding new ones\&. Configuration Item: APT::Get::Upgrade\-Allow\-New\&. .RE .PP \fB\-\-no\-upgrade\fR .RS 4 Do not upgrade packages; when used in conjunction with install, no\-upgrade will prevent packages on the command line from being upgraded if they are already installed\&. Configuration Item: APT::Get::Upgrade\&. .RE .PP \fB\-\-only\-upgrade\fR .RS 4 Do not install new packages; when used in conjunction with install, only\-upgrade will install upgrades for already installed packages only and ignore requests to install new packages\&. Configuration Item: APT::Get::Only\-Upgrade\&. .RE .PP \fB\-\-allow\-downgrades\fR .RS 4 This is a dangerous option that will cause apt to continue without prompting if it is doing downgrades\&. It should not be used except in very special situations\&. Using it can potentially destroy your system! Configuration Item: APT::Get::allow\-downgrades\&. Introduced in APT 1\&.1\&. .RE .PP \fB\-\-allow\-remove\-essential\fR .RS 4 Force yes; this is a dangerous option that will cause apt to continue without prompting if it is removing essentials\&. It should not be used except in very special situations\&. Using it can potentially destroy your system! Configuration Item: APT::Get::allow\-remove\-essential\&. Introduced in APT 1\&.1\&. .RE .PP \fB\-\-allow\-change\-held\-packages\fR .RS 4 Force yes; this is a dangerous option that will cause apt to continue without prompting if it is changing held packages\&. It should not be used except in very special situations\&. Using it can potentially destroy your system! Configuration Item: APT::Get::allow\-change\-held\-packages\&. Introduced in APT 1\&.1\&. .RE .PP \fB\-\-force\-yes\fR .RS 4 Force yes; this is a dangerous option that will cause apt to continue without prompting if it is doing something potentially harmful\&. It should not be used except in very special situations\&. Using force\-yes can potentially destroy your system! Configuration Item: APT::Get::force\-yes\&. This is deprecated and replaced by \fB\-\-allow\-downgrades\fR, \fB\-\-allow\-remove\-essential\fR, \fB\-\-allow\-change\-held\-packages\fR in 1\&.1\&. .RE .PP \fB\-\-print\-uris\fR .RS 4 Instead of fetching the files to install their URIs are printed\&. Each URI will have the path, the destination file name, the size and the expected MD5 hash\&. Note that the file name to write to will not always match the file name on the remote site! This also works with the source and update commands\&. When used with the update command the MD5 and size are not included, and it is up to the user to decompress any compressed files\&. Configuration Item: APT::Get::Print\-URIs\&. .RE .PP \fB\-\-purge\fR .RS 4 Use purge instead of remove for anything that would be removed\&. An asterisk ("*") will be displayed next to packages which are scheduled to be purged\&. \fBremove \-\-purge\fR is equivalent to the \fBpurge\fR command\&. Configuration Item: APT::Get::Purge\&. .RE .PP \fB\-\-reinstall\fR .RS 4 Re\-install packages that are already installed and at the newest version\&. Configuration Item: APT::Get::ReInstall\&. .RE .PP \fB\-\-list\-cleanup\fR .RS 4 This option is on by default; use \-\-no\-list\-cleanup to turn it off\&. When it is on, \fBapt\-get\fR will automatically manage the contents of /var/lib/apt/lists to ensure that obsolete files are erased\&. The only reason to turn it off is if you frequently change your sources list\&. Configuration Item: APT::Get::List\-Cleanup\&. .RE .PP \fB\-t\fR, \fB\-\-target\-release\fR, \fB\-\-default\-release\fR .RS 4 This option controls the default input to the policy engine; it creates a default pin at priority 990 using the specified release string\&. This overrides the general settings in /etc/apt/preferences\&. Specifically pinned packages are not affected by the value of this option\&. In short, this option lets you have simple control over which distribution packages will be retrieved from\&. Some common examples might be \fB\-t \*(Aq2\&.1*\*(Aq\fR, \fB\-t unstable\fR or \fB\-t sid\fR\&. Configuration Item: APT::Default\-Release; see also the \fBapt_preferences\fR(5) manual page\&. .RE .PP \fB\-\-trivial\-only\fR .RS 4 Only perform operations that are \*(Aqtrivial\*(Aq\&. Logically this can be considered related to \fB\-\-assume\-yes\fR; where \fB\-\-assume\-yes\fR will answer yes to any prompt, \fB\-\-trivial\-only\fR will answer no\&. Configuration Item: APT::Get::Trivial\-Only\&. .RE .PP \fB\-\-no\-remove\fR .RS 4 If any packages are to be removed apt\-get immediately aborts without prompting\&. Configuration Item: APT::Get::Remove\&. .RE .PP \fB\-\-auto\-remove\fR, \fB\-\-autoremove\fR .RS 4 If the command is either install or remove, then this option acts like running the autoremove command, removing unused dependency packages\&. Configuration Item: APT::Get::AutomaticRemove\&. .RE .PP \fB\-\-only\-source\fR .RS 4 Only has meaning for the source and build\-dep commands\&. Indicates that the given source names are not to be mapped through the binary table\&. This means that if this option is specified, these commands will only accept source package names as arguments, rather than accepting binary package names and looking up the corresponding source package\&. Configuration Item: APT::Get::Only\-Source\&. .RE .PP \fB\-\-diff\-only\fR, \fB\-\-dsc\-only\fR, \fB\-\-tar\-only\fR .RS 4 Download only the diff, dsc, or tar file of a source archive\&. Configuration Item: APT::Get::Diff\-Only, APT::Get::Dsc\-Only, and APT::Get::Tar\-Only\&. .RE .PP \fB\-\-arch\-only\fR .RS 4 Only process architecture\-dependent build\-dependencies\&. Configuration Item: APT::Get::Arch\-Only\&. .RE .PP \fB\-\-indep\-only\fR .RS 4 Only process architecture\-independent build\-dependencies\&. Configuration Item: APT::Get::Indep\-Only\&. .RE .PP \fB\-\-allow\-unauthenticated\fR .RS 4 Ignore if packages can\*(Aqt be authenticated and don\*(Aqt prompt about it\&. This can be useful while working with local repositories, but is a huge security risk if data authenticity isn\*(Aqt ensured in another way by the user itself\&. The usage of the \fBTrusted\fR option for \fBsources.list\fR(5) entries should usually be preferred over this global override\&. Configuration Item: APT::Get::AllowUnauthenticated\&. .RE .PP \fB\-\-no\-allow\-insecure\-repositories\fR .RS 4 Forbid the update command to acquire unverifiable data from configured sources\&. APT will fail at the update command for repositories without valid cryptographically signatures\&. See also \fBapt-secure\fR(8) for details on the concept and the implications\&. Configuration Item: Acquire::AllowInsecureRepositories\&. .RE .PP \fB\-\-show\-progress\fR .RS 4 Show user friendly progress information in the terminal window when packages are installed, upgraded or removed\&. For a machine parsable version of this data see README\&.progress\-reporting in the apt doc directory\&. Configuration Items: Dpkg::Progress and Dpkg::Progress\-Fancy\&. .RE .PP \fB\-\-with\-source\fR \fB\fIfilename\fR\fR .RS 4 Adds the given file as a source for metadata\&. Can be repeated to add multiple files\&. See \fB\-\-with\-source\fR description in \fBapt-cache\fR(8) for further details\&. .RE .PP \fB\-h\fR, \fB\-\-help\fR .RS 4 Show a short usage summary\&. .RE .PP \fB\-v\fR, \fB\-\-version\fR .RS 4 Show the program version\&. .RE .PP \fB\-c\fR, \fB\-\-config\-file\fR .RS 4 Configuration File; Specify a configuration file to use\&. The program will read the default configuration file and then this configuration file\&. If configuration settings need to be set before the default configuration files are parsed specify a file with the \fBAPT_CONFIG\fR environment variable\&. See \fBapt.conf\fR(5) for syntax information\&. .RE .PP \fB\-o\fR, \fB\-\-option\fR .RS 4 Set a Configuration Option; This will set an arbitrary configuration option\&. The syntax is \fB\-o Foo::Bar=bar\fR\&. \fB\-o\fR and \fB\-\-option\fR can be used multiple times to set different options\&. .RE .SH "FILES" .PP /etc/apt/sources\&.list .RS 4 Locations to fetch packages from\&. Configuration Item: Dir::Etc::SourceList\&. .RE .PP /etc/apt/sources\&.list\&.d/ .RS 4 File fragments for locations to fetch packages from\&. Configuration Item: Dir::Etc::SourceParts\&. .RE .PP /etc/apt/apt\&.conf .RS 4 APT configuration file\&. Configuration Item: Dir::Etc::Main\&. .RE .PP /etc/apt/apt\&.conf\&.d/ .RS 4 APT configuration file fragments\&. Configuration Item: Dir::Etc::Parts\&. .RE .PP /etc/apt/preferences .RS 4 Version preferences file\&. This is where you would specify "pinning", i\&.e\&. a preference to get certain packages from a separate source or from a different version of a distribution\&. Configuration Item: Dir::Etc::Preferences\&. .RE .PP /etc/apt/preferences\&.d/ .RS 4 File fragments for the version preferences\&. Configuration Item: Dir::Etc::PreferencesParts\&. .RE .PP /var/cache/apt/archives/ .RS 4 Storage area for retrieved package files\&. Configuration Item: Dir::Cache::Archives\&. .RE .PP /var/cache/apt/archives/partial/ .RS 4 Storage area for package files in transit\&. Configuration Item: Dir::Cache::Archives (partial will be implicitly appended) .RE .PP /var/lib/apt/lists/ .RS 4 Storage area for state information for each package resource specified in \fBsources.list\fR(5) Configuration Item: Dir::State::Lists\&. .RE .PP /var/lib/apt/lists/partial/ .RS 4 Storage area for state information in transit\&. Configuration Item: Dir::State::Lists (partial will be implicitly appended) .RE .SH "SEE ALSO" .PP \fBapt-cache\fR(8), \fBapt-cdrom\fR(8), \fBdpkg\fR(1), \fBsources.list\fR(5), \fBapt.conf\fR(5), \fBapt-config\fR(8), \fBapt-secure\fR(8), The APT User\*(Aqs guide in /usr/share/doc/apt\-doc/, \fBapt_preferences\fR(5), the APT Howto\&. .SH "DIAGNOSTICS" .PP \fBapt\-get\fR returns zero on normal operation, decimal 100 on error\&. .SH "BUGS" .PP \m[blue]\fBAPT bug page\fR\m[]\&\s-2\u[1]\d\s+2\&. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug\-reporting\&.txt or the \fBreportbug\fR(1) command\&. .SH "AUTHORS" .PP \fBJason Gunthorpe\fR .RS 4 .RE .PP \fBAPT team\fR .RS 4 .RE .SH "NOTES" .IP " 1." 4 APT bug page .RS 4 \%http://bugs.debian.org/src:apt .RE ================================================ FILE: packages/apt/man/man8/apt-key.8 ================================================ '\" t .\" Title: apt-key .\" Author: Jason Gunthorpe .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 25\ \&November\ \&2016 .\" Manual: APT .\" Source: APT 1.4.9 .\" Language: English .\" .TH "APT\-KEY" "8" "25\ \&November\ \&2016" "APT 1.4.9" "APT" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" apt-key \- APT key management utility .SH "SYNOPSIS" .HP \w'\fBapt\-key\fR\ 'u \fBapt\-key\fR [\fB\-\-keyring\ \fR\fB\fIfilename\fR\fR] {add\ \fIfilename\fR | del\ \fIkeyid\fR | export\ \fIkeyid\fR | exportall | list | finger | adv | update | net\-update | {\-v\ |\ \-\-version} | {\-h\ |\ \-\-help}} .SH "DESCRIPTION" .PP \fBapt\-key\fR is used to manage the list of keys used by apt to authenticate packages\&. Packages which have been authenticated using these keys will be considered trusted\&. .PP Note that if usage of \fBapt\-key\fR is desired the additional installation of the GNU Privacy Guard suite (packaged in gnupg) is required\&. For this reason alone the programmatic usage (especially in package maintainerscripts!) is strongly discouraged\&. Further more the output format of all commands is undefined and can and does change whenever the underlying commands change\&. \fBapt\-key\fR will try to detect such usage and generates warnings on stderr in these cases\&. .SH "SUPPORTED KEYRING FILES" .PP apt\-key supports only the binary OpenPGP format (also known as "GPG key public ring") in files with the "gpg" extension, not the keybox database format introduced in newer \fBgpg\fR(1) versions as default for keyring files\&. Binary keyring files intended to be used with any apt version should therefore always be created with \fBgpg \-\-export\fR\&. .PP Alternatively, if all systems which should be using the created keyring have at least apt version >= 1\&.4 installed, you can use the ASCII armored format with the "asc" extension instead which can be created with \fBgpg \-\-armor \-\-export\fR\&. .SH "COMMANDS" .PP \fBadd\fR \fB\fIfilename\fR\fR .RS 4 Add a new key to the list of trusted keys\&. The key is read from the filename given with the parameter \fIfilename\fR or if the filename is \- from standard input\&. .sp It is critical that keys added manually via \fBapt\-key\fR are verified to belong to the owner of the repositories they claim to be for otherwise the \fBapt-secure\fR(8) infrastructure is completely undermined\&. .sp \fINote\fR: Instead of using this command a keyring should be placed directly in the /etc/apt/trusted\&.gpg\&.d/ directory with a descriptive name and either "gpg" or "asc" as file extension\&. .RE .PP \fBdel\fR \fB\fIkeyid\fR\fR .RS 4 Remove a key from the list of trusted keys\&. .RE .PP \fBexport\fR \fB\fIkeyid\fR\fR .RS 4 Output the key \fIkeyid\fR to standard output\&. .RE .PP \fBexportall\fR .RS 4 Output all trusted keys to standard output\&. .RE .PP \fBlist\fR, \fBfinger\fR .RS 4 List trusted keys with fingerprints\&. .RE .PP \fBadv\fR .RS 4 Pass advanced options to gpg\&. With \fBadv \-\-recv\-key\fR you can e\&.g\&. download key from keyservers directly into the trusted set of keys\&. Note that there are \fIno\fR checks performed, so it is easy to completely undermine the \fBapt-secure\fR(8) infrastructure if used without care\&. .RE .PP \fBupdate\fR (deprecated) .RS 4 Update the local keyring with the archive keyring and remove from the local keyring the archive keys which are no longer valid\&. The archive keyring is shipped in the archive\-keyring package of your distribution, e\&.g\&. the debian\-archive\-keyring package in Debian\&. .sp Note that a distribution does not need to and in fact should not use this command any longer and instead ship keyring files in the /etc/apt/trusted\&.gpg\&.d/ directory directly as this avoids a dependency on gnupg and it is easier to manage keys by simply adding and removing files for maintainers and users alike\&. .RE .PP \fBnet\-update\fR .RS 4 Perform an update working similarly to the \fBupdate\fR command above, but get the archive keyring from a URI instead and validate it against a master key\&. This requires an installed \fBwget\fR(1) and an APT build configured to have a server to fetch from and a master keyring to validate\&. APT in Debian does not support this command, relying on \fBupdate\fR instead, but Ubuntu\*(Aqs APT does\&. .RE .SH "OPTIONS" .PP Note that options need to be defined before the commands described in the previous section\&. .PP \fB\-\-keyring\fR \fB\fIfilename\fR\fR .RS 4 With this option it is possible to specify a particular keyring file the command should operate on\&. The default is that a command is executed on the trusted\&.gpg file as well as on all parts in the trusted\&.gpg\&.d directory, though trusted\&.gpg is the primary keyring which means that e\&.g\&. new keys are added to this one\&. .RE .SH "FILES" .PP /etc/apt/trusted\&.gpg .RS 4 Keyring of local trusted keys, new keys will be added here\&. Configuration Item: Dir::Etc::Trusted\&. .RE .PP /etc/apt/trusted\&.gpg\&.d/ .RS 4 File fragments for the trusted keys, additional keyrings can be stored here (by other packages or the administrator)\&. Configuration Item Dir::Etc::TrustedParts\&. .RE .SH "SEE ALSO" .PP \fBapt-get\fR(8), \fBapt-secure\fR(8) .SH "BUGS" .PP \m[blue]\fBAPT bug page\fR\m[]\&\s-2\u[1]\d\s+2\&. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug\-reporting\&.txt or the \fBreportbug\fR(1) command\&. .SH "AUTHOR" .PP APT was written by the APT team \&. .SH "AUTHORS" .PP \fBJason Gunthorpe\fR .RS 4 .RE .PP \fBAPT team\fR .RS 4 .RE .SH "NOTES" .IP " 1." 4 APT bug page .RS 4 \%http://bugs.debian.org/src:apt .RE ================================================ FILE: packages/apt/man/man8/apt-mark.8 ================================================ '\" t .\" Title: apt-mark .\" Author: Mike O\*(AqConnor .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 25\ \&September\ \&2015 .\" Manual: APT .\" Source: APT 1.4.9 .\" Language: English .\" .TH "APT\-MARK" "8" "25\ \&September\ \&2015" "APT 1.4.9" "APT" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" apt-mark \- show, set and unset various settings for a package .SH "SYNOPSIS" .HP \w'\fBapt\-mark\fR\ 'u \fBapt\-mark\fR {\fB\-f=\fR\fB\fIfilename\fR\fR | {auto\ |\ manual}\ \fIpkg\fR... | {showauto\ |\ showmanual}\ [\fIpkg\fR...] } | {\-v\ |\ \-\-version} | {\-h\ |\ \-\-help} .HP \w'\fBapt\-mark\fR\ 'u \fBapt\-mark\fR {hold\ |\ unhold\ |\ install\ |\ remove\ |\ purge}\ \fIpkg\fR... | {showhold\ |\ showinstall\ |\ showremove\ |\ showpurge}\ [\fIpkg\fR...] .SH "DESCRIPTION" .PP \fBapt\-mark\fR can be used as a unified front\-end to set various settings for a package, such as marking a package as being automatically/manually installed or changing \fBdpkg\fR selections such as hold, install, deinstall and purge which are respected e\&.g\&. by \fBapt\-get dselect\-upgrade\fR or \fBaptitude\fR\&. .SH "AUTOMATICALLY AND MANUALLY INSTALLED PACKAGES" .PP When you request that a package is installed, and as a result other packages are installed to satisfy its dependencies, the dependencies are marked as being automatically installed, while the package you installed explicitly is marked as manually installed\&. Once an automatically installed package is no longer depended on by any manually installed package it is considered no longer needed and e\&.g\&. \fBapt\-get\fR or \fBaptitude\fR will at least suggest removing them\&. .PP \fBauto\fR .RS 4 auto is used to mark a package as being automatically installed, which will cause the package to be removed when no more manually installed packages depend on this package\&. .RE .PP \fBmanual\fR .RS 4 manual is used to mark a package as being manually installed, which will prevent the package from being automatically removed if no other packages depend on it\&. .RE .PP \fBshowauto\fR .RS 4 showauto is used to print a list of automatically installed packages with each package on a new line\&. All automatically installed packages will be listed if no package is given\&. If packages are given only those which are automatically installed will be shown\&. .RE .PP \fBshowmanual\fR .RS 4 showmanual can be used in the same way as showauto except that it will print a list of manually installed packages instead\&. .RE .SS "Options" .PP \fB\-f=\fR\fB\fIfilename\fR\fR, \fB\-\-file=\fR\fB\fIfilename\fR\fR .RS 4 Read/Write package stats from the filename given with the parameter \fIfilename\fR instead of from the default location, which is extended_status in the directory defined by the Configuration Item: Dir::State\&. .RE .SH "PREVENT CHANGES FOR A PACKAGE" .PP \fBhold\fR .RS 4 hold is used to mark a package as held back, which will prevent the package from being automatically installed, upgraded or removed\&. .RE .PP \fBunhold\fR .RS 4 unhold is used to cancel a previously set hold on a package to allow all actions again\&. .RE .PP \fBshowhold\fR .RS 4 showhold is used to print a list of packages on hold in the same way as for the other show commands\&. .RE .SH "SCHEDULE PACKAGES FOR INSTALL, REMOVE AND PURGE" .PP Some front\-ends like \fBapt\-get dselect\-upgrade\fR can be used to apply previously scheduled changes to the install state of packages\&. Such changes can be scheduled with the \fBinstall\fR, \fBremove\fR (also known as \fBdeinstall\fR) and \fBpurge\fR commands\&. Packages with a specific selection can be displayed with \fBshowinstall\fR, \fBshowremove\fR and \fBshowpurge\fR respectively\&. More information about these so called dpkg selections can be found in \fBdpkg\fR(1)\&. .SH "OPTIONS" .PP \fB\-h\fR, \fB\-\-help\fR .RS 4 Show a short usage summary\&. .RE .PP \fB\-v\fR, \fB\-\-version\fR .RS 4 Show the program version\&. .RE .PP \fB\-c\fR, \fB\-\-config\-file\fR .RS 4 Configuration File; Specify a configuration file to use\&. The program will read the default configuration file and then this configuration file\&. If configuration settings need to be set before the default configuration files are parsed specify a file with the \fBAPT_CONFIG\fR environment variable\&. See \fBapt.conf\fR(5) for syntax information\&. .RE .PP \fB\-o\fR, \fB\-\-option\fR .RS 4 Set a Configuration Option; This will set an arbitrary configuration option\&. The syntax is \fB\-o Foo::Bar=bar\fR\&. \fB\-o\fR and \fB\-\-option\fR can be used multiple times to set different options\&. .RE .SH "FILES" .PP /var/lib/apt/extended_states .RS 4 Status list of auto\-installed packages\&. Configuration Item: Dir::State::extended_states\&. .RE .SH "SEE ALSO" .PP \fBapt-get\fR(8),\fBaptitude\fR(8),\fBapt.conf\fR(5) .SH "DIAGNOSTICS" .PP \fBapt\-mark\fR returns zero on normal operation, non\-zero on error\&. .SH "BUGS" .PP \m[blue]\fBAPT bug page\fR\m[]\&\s-2\u[1]\d\s+2\&. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug\-reporting\&.txt or the \fBreportbug\fR(1) command\&. .SH "AUTHORS" .PP \fBMike O\*(AqConnor\fR .RS 4 .RE .PP \fBAPT team\fR .RS 4 .RE .SH "NOTES" .IP " 1." 4 APT bug page .RS 4 \%http://bugs.debian.org/src:apt .RE ================================================ FILE: packages/apt/man/man8/apt-secure.8 ================================================ '\" t .\" Title: apt-secure .\" Author: Jason Gunthorpe .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 06\ \&August\ \&2016 .\" Manual: APT .\" Source: APT 1.4.9 .\" Language: English .\" .TH "APT\-SECURE" "8" "06\ \&August\ \&2016" "APT 1.4.9" "APT" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" apt-secure \- Archive authentication support for APT .SH "DESCRIPTION" .PP Starting with version 0\&.6, \fBAPT\fR contains code that does signature checking of the Release file for all repositories\&. This ensures that data like packages in the archive can\*(Aqt be modified by people who have no access to the Release file signing key\&. Starting with version 1\&.1 \fBAPT\fR requires repositories to provide recent authentication information for unimpeded usage of the repository\&. .PP If an archive has an unsigned Release file or no Release file at all current APT versions will refuse to download data from them by default in \fBupdate\fR operations and even if forced to download front\-ends like \fBapt-get\fR(8) will require explicit confirmation if an installation request includes a package from such an unauthenticated archive\&. .PP As a temporary exception \fBapt-get\fR(8) (not \fBapt\fR(8)!) raises warnings only if it encounters unauthenticated archives to give a slightly longer grace period on this backward compatibility effecting change\&. This exception will be removed in future releases and you can opt\-out of this grace period by setting the configuration option \fBBinary::apt\-get::Acquire::AllowInsecureRepositories\fR to false or \fB\-\-no\-allow\-insecure\-repositories\fR on the command line\&. .PP You can force all APT clients to raise only warnings by setting the configuration option \fBAcquire::AllowInsecureRepositories\fR to true\&. Individual repositories can also be allowed to be insecure via the \fBsources.list\fR(5) option allow\-insecure=yes\&. Note that insecure repositories are strongly discouraged and all options to force apt to continue supporting them will eventually be removed\&. Users also have the \fBTrusted\fR option available to disable even the warnings, but be sure to understand the implications as detailed in \fBsources.list\fR(5)\&. .PP A repository which previously was authenticated but would loose this state in an \fBupdate\fR operation raises an error in all APT clients irrespective of the option to allow or forbid usage of insecure repositories\&. The error can be overcome by additionally setting \fBAcquire::AllowDowngradeToInsecureRepositories\fR to true or for Individual repositories with the \fBsources.list\fR(5) option allow\-downgrade\-to\-insecure=yes\&. .PP Note: All APT\-based package management front\-ends like \fBapt-get\fR(8), \fBaptitude\fR(8) and \fBsynaptic\fR(8) support this authentication feature, so this manpage uses APT to refer to them all for simplicity only\&. .SH "TRUSTED REPOSITORIES" .PP The chain of trust from an APT archive to the end user is made up of several steps\&. \fBapt\-secure\fR is the last step in this chain; trusting an archive does not mean that you trust its packages not to contain malicious code, but means that you trust the archive maintainer\&. It\*(Aqs the archive maintainer\*(Aqs responsibility to ensure that the archive\*(Aqs integrity is preserved\&. .PP apt\-secure does not review signatures at a package level\&. If you require tools to do this you should look at \fBdebsig\-verify\fR and \fBdebsign\fR (provided in the debsig\-verify and devscripts packages respectively)\&. .PP The chain of trust in Debian starts (e\&.g\&.) when a maintainer uploads a new package or a new version of a package to the Debian archive\&. In order to become effective, this upload needs to be signed by a key contained in one of the Debian package maintainer keyrings (available in the debian\-keyring package)\&. Maintainers\*(Aq keys are signed by other maintainers following pre\-established procedures to ensure the identity of the key holder\&. Similar procedures exist in all Debian\-based distributions\&. .PP Once the uploaded package is verified and included in the archive, the maintainer signature is stripped off, and checksums of the package are computed and put in the Packages file\&. The checksums of all of the Packages files are then computed and put into the Release file\&. The Release file is then signed by the archive key for this Debian release, and distributed alongside the packages and the Packages files on Debian mirrors\&. The keys are in the Debian archive keyring available in the debian\-archive\-keyring package\&. .PP End users can check the signature of the Release file, extract a checksum of a package from it and compare it with the checksum of the package they downloaded by hand \- or rely on APT doing this automatically\&. .PP Notice that this is distinct from checking signatures on a per package basis\&. It is designed to prevent two possible attacks: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Network "man in the middle" attacks\&. Without signature checking, malicious agents can introduce themselves into the package download process and provide malicious software either by controlling a network element (router, switch, etc\&.) or by redirecting traffic to a rogue server (through ARP or DNS spoofing attacks)\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Mirror network compromise\&. Without signature checking, a malicious agent can compromise a mirror host and modify the files in it to propagate malicious software to all users downloading packages from that host\&. .RE .PP However, it does not defend against a compromise of the master server itself (which signs the packages) or against a compromise of the key used to sign the Release files\&. In any case, this mechanism can complement a per\-package signature\&. .SH "USER CONFIGURATION" .PP \fBapt\-key\fR is the program that manages the list of keys used by APT to trust repositories\&. It can be used to add or remove keys as well as list the trusted keys\&. Limiting which key(s) are able to sign which archive is possible via the \fBSigned\-By\fR in \fBsources.list\fR(5)\&. .PP Note that a default installation already contains all keys to securely acquire packages from the default repositories, so fiddling with \fBapt\-key\fR is only needed if third\-party repositories are added\&. .PP In order to add a new key you need to first download it (you should make sure you are using a trusted communication channel when retrieving it), add it with \fBapt\-key\fR and then run \fBapt\-get update\fR so that apt can download and verify the InRelease or Release\&.gpg files from the archives you have configured\&. .SH "ARCHIVE CONFIGURATION" .PP If you want to provide archive signatures in an archive under your maintenance you have to: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fICreate a toplevel Release file\fR, if it does not exist already\&. You can do this by running \fBapt\-ftparchive release\fR (provided in apt\-utils)\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fISign it\fR\&. You can do this by running \fBgpg \-\-clearsign \-o InRelease Release\fR and \fBgpg \-abs \-o Release\&.gpg Release\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIPublish the key fingerprint\fR, so that your users will know what key they need to import in order to authenticate the files in the archive\&. It is best to ship your key in its own keyring package like Debian does with debian\-archive\-keyring to be able to distribute updates and key transitions automatically later\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIProvide instructions on how to add your archive and key\fR\&. If your users can\*(Aqt acquire your key securely the chain of trust described above is broken\&. How you can help users add your key depends on your archive and target audience ranging from having your keyring package included in another archive users already have configured (like the default repositories of their distribution) to leveraging the web of trust\&. .RE .PP Whenever the contents of the archive change (new packages are added or removed) the archive maintainer has to follow the first two steps outlined above\&. .SH "SEE ALSO" .PP \fBapt.conf\fR(5), \fBapt-get\fR(8), \fBsources.list\fR(5), \fBapt-key\fR(8), \fBapt-ftparchive\fR(1), \fBdebsign\fR(1), \fBdebsig-verify\fR(1), \fBgpg\fR(1) .PP For more background information you might want to review the \m[blue]\fBDebian Security Infrastructure\fR\m[]\&\s-2\u[1]\d\s+2 chapter of the Securing Debian Manual (also available in the harden\-doc package) and the \m[blue]\fBStrong Distribution HOWTO\fR\m[]\&\s-2\u[2]\d\s+2 by V\&. Alex Brennen\&. .SH "BUGS" .PP \m[blue]\fBAPT bug page\fR\m[]\&\s-2\u[3]\d\s+2\&. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug\-reporting\&.txt or the \fBreportbug\fR(1) command\&. .SH "AUTHOR" .PP APT was written by the APT team \&. .SH "MANPAGE AUTHORS" .PP This man\-page is based on the work of Javier Fernández\-Sanguino Peña, Isaac Jones, Colin Walters, Florian Weimer and Michael Vogt\&. .SH "AUTHORS" .PP \fBJason Gunthorpe\fR .RS 4 .RE .PP \fBAPT team\fR .RS 4 .RE .SH "NOTES" .IP " 1." 4 Debian Security Infrastructure .RS 4 \%https://www.debian.org/doc/manuals/securing-debian-howto/ch7 .RE .IP " 2." 4 Strong Distribution HOWTO .RS 4 \%http://www.cryptnet.net/fdp/crypto/strong_distro.html .RE .IP " 3." 4 APT bug page .RS 4 \%http://bugs.debian.org/src:apt .RE ================================================ FILE: packages/apt/man/man8/apt.8 ================================================ '\" t .\" Title: apt .\" Author: APT team .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 20\ \&October\ \&2015 .\" Manual: APT .\" Source: APT 1.4.9 .\" Language: English .\" .TH "APT" "8" "20\ \&October\ \&2015" "APT 1.4.9" "APT" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" apt \- command\-line interface .SH "SYNOPSIS" .HP \w'\fBapt\fR\ 'u \fBapt\fR [\fB\-h\fR] [\fB\-o=\fR\fB\fIconfig_string\fR\fR] [\fB\-c=\fR\fB\fIconfig_file\fR\fR] [\fB\-t=\fR\fB\fItarget_release\fR\fR] [\fB\-a=\fR\fB\fIarchitecture\fR\fR] {list | search | show | update | install\ \fIpkg\fR\ [{=\fIpkg_version_number\fR\ |\ /\fItarget_release\fR}]... | remove\ \fIpkg\fR... | upgrade | full\-upgrade | edit\-sources | {\-v\ |\ \-\-version} | {\-h\ |\ \-\-help}} .SH "DESCRIPTION" .PP \fBapt\fR provides a high\-level commandline interface for the package management system\&. It is intended as an end user interface and enables some options better suited for interactive usage by default compared to more specialized APT tools like \fBapt-get\fR(8) and \fBapt-cache\fR(8)\&. .PP Much like \fBapt\fR itself, its manpage is intended as an end user interface and as such only mentions the most used commands and options partly to not duplicate information in multiple places and partly to avoid overwhelming readers with a cornucopia of options and details\&. .PP \fBupdate\fR (\fBapt-get\fR(8)) .RS 4 \fBupdate\fR is used to download package information from all configured sources\&. Other commands operate on this data to e\&.g\&. perform package upgrades or search in and display details about all packages available for installation\&. .RE .PP \fBupgrade\fR (\fBapt-get\fR(8)) .RS 4 \fBupgrade\fR is used to install available upgrades of all packages currently installed on the system from the sources configured via \fBsources.list\fR(5)\&. New packages will be installed if required to satisfy dependencies, but existing packages will never be removed\&. If an upgrade for a package requires the remove of an installed package the upgrade for this package isn\*(Aqt performed\&. .RE .PP \fBfull\-upgrade\fR (\fBapt-get\fR(8)) .RS 4 full\-upgrade performs the function of upgrade but will remove currently installed packages if this is needed to upgrade the system as a whole\&. .RE .PP \fBinstall\fR, \fBremove\fR, \fBpurge\fR (\fBapt-get\fR(8)) .RS 4 Performs the requested action on one or more packages specified via \fBregex\fR(7), \fBglob\fR(7) or exact match\&. The requested action can be overridden for specific packages by append a plus (+) to the package name to install this package or a minus (\-) to remove it\&. .sp A specific version of a package can be selected for installation by following the package name with an equals (=) and the version of the package to select\&. Alternatively the version from a specific release can be selected by following the package name with a forward slash (/) and codename (stretch, buster, sid \&...) or suite name (stable, testing, unstable)\&. This will also select versions from this release for dependencies of this package if needed to satisfy the request\&. .sp Removing a package removes all packaged data, but leaves usually small (modified) user configuration files behind, in case the remove was an accident\&. Just issuing an installation request for the accidentally removed package will restore its function as before in that case\&. On the other hand you can get rid of these leftovers by calling \fBpurge\fR even on already removed packages\&. Note that this does not affect any data or configuration stored in your home directory\&. .RE .PP \fBautoremove\fR (\fBapt-get\fR(8)) .RS 4 autoremove is used to remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed as dependencies changed or the package(s) needing them were removed in the meantime\&. .sp You should check that the list does not include applications you have grown to like even though they were once installed just as a dependency of another package\&. You can mark such a package as manually installed by using \fBapt-mark\fR(8)\&. Packages which you have installed explicitly via \fBinstall\fR are also never proposed for automatic removal\&. .RE .PP \fBsearch\fR (\fBapt-cache\fR(8)) .RS 4 \fBsearch\fR can be used to search for the given \fBregex\fR(7) term(s) in the list of available packages and display matches\&. This can e\&.g\&. be useful if you are looking for packages having a specific feature\&. If you are looking for a package including a specific file try \fBapt-file\fR(1)\&. .RE .PP \fBshow\fR (\fBapt-cache\fR(8)) .RS 4 Show information about the given package(s) including its dependencies, installation and download size, sources the package is available from, the description of the packages content and much more\&. It can e\&.g\&. be helpful to look at this information before allowing \fBapt\fR(8) to remove a package or while searching for new packages to install\&. .RE .PP \fBlist\fR (work\-in\-progress) .RS 4 \fBlist\fR is somewhat similar to \fBdpkg\-query \-\-list\fR in that it can display a list of packages satisfying certain criteria\&. It supports \fBglob\fR(7) patterns for matching package names as well as options to list installed (\fB\-\-installed\fR), upgradeable (\fB\-\-upgradeable\fR) or all available (\fB\-\-all\-versions\fR) versions\&. .RE .PP \fBedit\-sources\fR (work\-in\-progress) .RS 4 edit\-sources lets you edit your \fBsources.list\fR(5) files in your preferred texteditor while also providing basic sanity checks\&. .RE .SH "SCRIPT USAGE AND DIFFERENCES FROM OTHER APT TOOLS" .PP The \fBapt\fR(8) commandline is designed as an end\-user tool and it may change behavior between versions\&. While it tries not to break backward compatibility this is not guaranteed either if a change seems beneficial for interactive use\&. .PP All features of \fBapt\fR(8) are available in dedicated APT tools like \fBapt-get\fR(8) and \fBapt-cache\fR(8) as well\&. \fBapt\fR(8) just changes the default value of some options (see \fBapt.conf\fR(5) and specifically the Binary scope)\&. So you should prefer using these commands (potentially with some additional options enabled) in your scripts as they keep backward compatibility as much as possible\&. .SH "SEE ALSO" .PP \fBapt-get\fR(8), \fBapt-cache\fR(8), \fBsources.list\fR(5), \fBapt.conf\fR(5), \fBapt-config\fR(8), The APT User\*(Aqs guide in /usr/share/doc/apt\-doc/, \fBapt_preferences\fR(5), the APT Howto\&. .SH "DIAGNOSTICS" .PP \fBapt\fR returns zero on normal operation, decimal 100 on error\&. .SH "BUGS" .PP \m[blue]\fBAPT bug page\fR\m[]\&\s-2\u[1]\d\s+2\&. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug\-reporting\&.txt or the \fBreportbug\fR(1) command\&. .SH "AUTHOR" .PP \fBAPT team\fR .RS 4 .RE .SH "NOTES" .IP " 1." 4 APT bug page .RS 4 \%http://bugs.debian.org/src:apt .RE ================================================ FILE: packages/aptly/Makefile.patch ================================================ diff -uNr aptly-1.4.0/Makefile aptly-1.4.0.mod/Makefile --- aptly-1.4.0/Makefile 2019-07-06 16:03:14.000000000 +0300 +++ aptly-1.4.0.mod/Makefile 2019-07-23 00:58:29.206419471 +0300 @@ -4,7 +4,7 @@ else TAG="$(shell git describe --tags)" endif -VERSION=$(shell echo $(TAG) | sed 's@^v@@' | sed 's@-@+@g') +VERSION ?= $(shell echo $(TAG) | sed 's@^v@@' | sed 's@-@+@g') PACKAGES=context database deb files gpg http query swift s3 utils PYTHON?=python TESTS?= ================================================ FILE: packages/aptly/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.aptly.info TERMUX_PKG_DESCRIPTION="A Swiss Army knife for Debian repository management." TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.4.0 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/aptly-dev/aptly/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=4172d54613139f6c34d5a17396adc9675d7ed002e517db8381731d105351fbe5 termux_step_make() { termux_setup_golang export GOPATH=$TERMUX_PKG_BUILDDIR mkdir -p "$GOPATH"/src/github.com/aptly-dev/ cp -a "$TERMUX_PKG_SRCDIR" "$GOPATH"/src/github.com/aptly-dev/aptly cd "$GOPATH"/src/github.com/aptly-dev/aptly make install VERSION=$TERMUX_PKG_VERSION } termux_step_make_install() { install -Dm700 \ "$GOPATH"/bin/${GOOS}_${GOARCH}/aptly \ "$TERMUX_PREFIX"/bin/aptly install -Dm600 \ "$TERMUX_PKG_SRCDIR"/man/aptly.1 \ "$TERMUX_PREFIX"/share/man/man1/aptly.1 } ================================================ FILE: packages/argp/argp-fmtstream.h.patch ================================================ --- ./argp-fmtstream.h.orig 2003-12-11 09:37:05.000000000 +0100 +++ ./argp-fmtstream.h 2011-08-12 11:56:43.000000000 +0200 @@ -192,7 +192,7 @@ extern int _argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount); extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount); -#ifdef __OPTIMIZE__ +#if defined(__OPTIMIZE__) && !defined(__clang__) /* Inline versions of above routines. */ #if !_LIBC ================================================ FILE: packages/argp/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.lysator.liu.se/~nisse/misc/ TERMUX_PKG_DESCRIPTION="Standalone version of arguments parsing functions from GLIBC" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=1.3 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=dec79694da1319acd2238ce95df57f3680fea2482096e483323fddf3d818d8be TERMUX_PKG_SRCURL=https://www.lysator.liu.se/~nisse/misc/argp-standalone-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_NO_STATICSPLIT=true termux_step_post_make_install() { cp libargp.a $TERMUX_PREFIX/lib cp $TERMUX_PKG_SRCDIR/argp.h $TERMUX_PREFIX/include } ================================================ FILE: packages/aria2/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://aria2.github.io TERMUX_PKG_DESCRIPTION="Download utility supporting HTTP/HTTPS, FTP, BitTorrent and Metalink" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.35.0 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/aria2/aria2/releases/download/release-${TERMUX_PKG_VERSION}/aria2-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=1e2b7fd08d6af228856e51c07173cfcf987528f1ac97e04c5af4a47642617dfd TERMUX_PKG_DEPENDS="libc++, c-ares, openssl, libxml2, zlib" # sqlite3 is only used for loading cookies from firefox or chrome: TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --with-openssl --without-gnutls --without-libuv --without-sqlite3 --without-libssh2 ac_cv_func_basename=yes ac_cv_func_getaddrinfo=yes ac_cv_func_gettimeofday=yes ac_cv_func_sleep=yes ac_cv_func_usleep=yes ac_cv_search_getaddrinfo=no " termux_step_pre_configure() { if [ "$TERMUX_ARCH" = "arm" ]; then CXXFLAGS="${CFLAGS/-Oz/-Os}" fi } ================================================ FILE: packages/arj/001_arches_align.patch ================================================ Description: Correct build failure on ia64 due to unaligned memory access. Author: Guillem Jover Origin: vendor Forwarded: no Last-Update: 2008-06-16 Index: b/arj_proc.c =================================================================== --- a/arj_proc.c 2005-06-21 22:53:12.000000000 +0300 +++ b/arj_proc.c 2008-06-16 08:25:28.000000000 +0300 @@ -2898,7 +2898,7 @@ char *ltrim(char *str) } #endif -#if defined(WORDS_BIGENDIAN)&&!defined(ARJDISP)&&!defined(REGISTER) +#if (defined(WORDS_BIGENDIAN) || defined(ALIGN_POINTERS)) && !defined(ARJDISP) && !defined(REGISTER) /* Model-independent routine to get 2 bytes from far RAM */ unsigned int mget_word(char FAR *p) Index: b/arj_proc.h =================================================================== --- a/arj_proc.h 2004-01-25 12:39:30.000000000 +0200 +++ b/arj_proc.h 2008-06-16 08:25:28.000000000 +0300 @@ -12,7 +12,7 @@ #define mget_byte(p) (*(unsigned char FAR *)(p)&0xFF) #define mput_byte(c, p) *(unsigned char FAR *)(p)=(unsigned char)(c) -#ifndef WORDS_BIGENDIAN +#if !defined(ALIGN_POINTERS) && !defined(WORDS_BIGENDIAN) #define mget_word(p) (*(unsigned short *)(p)&0xFFFF) #define mput_word(w,p) (*(unsigned short *)(p)=(unsigned short)(w)) #define mget_dword(p) (*(unsigned long *)(p)) @@ -60,7 +60,7 @@ void pack_mem(struct mempack *mempack); void unpack_mem(struct mempack *mempack); void strip_lf(char *str); char *ltrim(char *str); -#ifdef WORDS_BIGENDIAN +#if defined(ALIGN_POINTERS) || defined(WORDS_BIGENDIAN) unsigned int mget_word(char FAR *p); unsigned long mget_dword(char FAR *p); void mput_word(unsigned int w, char FAR *p); ================================================ FILE: packages/arj/002_no_remove_static_const.patch ================================================ Description: Set the static const intergrity_identifier variable as volatile instead of building the file with -O0 to avoid the compiler optimizing it away, so that we can use standard flags everywhere. Author: Guillem Jover Origin: vendor Forwarded: no Last-Update: 2013-05-10 --- integr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/integr.c +++ b/integr.c @@ -5,7 +5,7 @@ * */ -static const char intergrity_identifier[] = { +static volatile const char intergrity_identifier[] = { 0xB0, 0x03, 0xB0, 0x02, 0xB0, 0x03, 0xB0, 0x04, 0xB0, 0x05, 0x90, 0x90, 0x90, 0x90, ================================================ FILE: packages/arj/003_64_bit_clean.patch ================================================ Description: Make code 64-bit clean. Author: Guillem Jover Origin: vendor Bug-Debian: https://bugs.debian.org/339815 Forwarded: no Last-Update: 2005-11-24 Index: b/arj_arcv.c =================================================================== --- a/arj_arcv.c 2005-06-21 22:53:12.000000000 +0300 +++ b/arj_arcv.c 2008-06-16 08:25:43.000000000 +0300 @@ -59,27 +59,27 @@ static char idxid_fault[]="?"; #define setup_hput(ptr) (tmp_hptr=(ptr)) #define hget_byte() (*(tmp_hptr++)&0xFF) -#define hput_byte(c) (*(tmp_hptr++)=(char) (c)) +#define hput_byte(c) (*(tmp_hptr++)=(uint8_t) (c)) /* Reads two bytes from the header, incrementing the pointer */ -static unsigned int hget_word() +static uint16_t hget_word() { - unsigned int result; + uint16_t result; result=mget_word(tmp_hptr); - tmp_hptr+=sizeof(short); + tmp_hptr+=sizeof(uint16_t); return result; } /* Reads four bytes from the header, incrementing the pointer */ -static unsigned long hget_longword() +static uint32_t hget_longword() { - unsigned long result; + uint32_t result; result=mget_dword(tmp_hptr); - tmp_hptr+=sizeof(unsigned long); + tmp_hptr+=sizeof(uint32_t); return result; } @@ -87,18 +87,18 @@ static unsigned long hget_longword() /* Writes two bytes to the header, incrementing the pointer */ -static void hput_word(unsigned int w) +static void hput_word(uint16_t w) { mput_word(w,tmp_hptr); - tmp_hptr+=sizeof(unsigned short); + tmp_hptr+=sizeof(uint16_t); } /* Writes four bytes to the header, incrementing the pointer */ -static void hput_longword(unsigned long l) +static void hput_longword(uint32_t l) { mput_dword(l,tmp_hptr); - tmp_hptr+=sizeof(unsigned long); + tmp_hptr+=sizeof(uint32_t); } /* Calculates and stores the basic header size */ Index: b/arj_proc.c =================================================================== --- a/arj_proc.c 2008-06-16 08:25:28.000000000 +0300 +++ b/arj_proc.c 2008-06-16 08:25:43.000000000 +0300 @@ -585,7 +585,7 @@ int search_for_extension(char *name, cha /* Returns the exact amount of data that could be safely written to the destination volume */ -unsigned long get_volfree(unsigned int increment) +unsigned long get_volfree(unsigned long increment) { unsigned long pvol; unsigned int arjsec_overhead; @@ -605,7 +605,7 @@ unsigned long get_volfree(unsigned int i remain=volume_limit-ftell(aostream)-pvol-(long)arjsec_overhead- (long)out_bytes-(long)cpos-(long)ext_voldata- MULTIVOLUME_RESERVE-t_volume_offset; - return((unsigned long)min(remain, (unsigned long)increment)); + return((unsigned long)min(remain, increment)); } /* Performs various checks when multivolume data is packed to predict an @@ -2466,14 +2466,14 @@ static int get_str_from_jq() *tsptr='\0'; endptr=tsptr; tsptr=sptr; - while((unsigned int)tsptr<(unsigned int)endptr&&patterns>8 , p+1); @@ -2931,7 +2931,7 @@ void mput_word(unsigned int w, char FAR /* Model-independent routine to store 4 bytes in far RAM */ -void mput_dword(unsigned long d, char FAR *p) +void mput_dword(uint32_t d, char FAR *p) { mput_word(d&0xFFFF, p); mput_word(d>>16 , p+2); Index: b/arj_proc.h =================================================================== --- a/arj_proc.h 2008-06-16 08:25:28.000000000 +0300 +++ b/arj_proc.h 2008-06-16 08:25:43.000000000 +0300 @@ -8,15 +8,17 @@ #ifndef ARJ_PROC_INCLUDED #define ARJ_PROC_INCLUDED +#include + /* Helper macros */ -#define mget_byte(p) (*(unsigned char FAR *)(p)&0xFF) -#define mput_byte(c, p) *(unsigned char FAR *)(p)=(unsigned char)(c) +#define mget_byte(p) (*(uint8_t FAR *)(p)&0xFF) +#define mput_byte(c, p) *(uint8_t FAR *)(p)=(uint8_t)(c) #if !defined(ALIGN_POINTERS) && !defined(WORDS_BIGENDIAN) -#define mget_word(p) (*(unsigned short *)(p)&0xFFFF) -#define mput_word(w,p) (*(unsigned short *)(p)=(unsigned short)(w)) -#define mget_dword(p) (*(unsigned long *)(p)) -#define mput_dword(w,p) (*(unsigned long *)(p)=(unsigned long)(w)) +#define mget_word(p) (*(uint16_t *)(p)&0xFFFF) +#define mput_word(w,p) (*(uint16_t *)(p)=(uint16_t)(w)) +#define mget_dword(p) (*(uint32_t *)(p)) +#define mput_dword(w,p) (*(uint32_t *)(p)=(uint32_t)(w)) #endif /* Prototypes */ @@ -31,7 +33,7 @@ void copy_bytes(unsigned long nbytes); int translate_path(char *name); void restart_proc(char *dest); int search_for_extension(char *name, char *ext_list); -unsigned long get_volfree(unsigned int increment); +unsigned long get_volfree(unsigned long increment); unsigned int check_multivolume(unsigned int increment); void store(); void hollow_encode(); @@ -61,10 +63,10 @@ void unpack_mem(struct mempack *mempack) void strip_lf(char *str); char *ltrim(char *str); #if defined(ALIGN_POINTERS) || defined(WORDS_BIGENDIAN) -unsigned int mget_word(char FAR *p); -unsigned long mget_dword(char FAR *p); -void mput_word(unsigned int w, char FAR *p); -void mput_dword(unsigned long d, char FAR *p); +uint16_t mget_word(char FAR *p); +uint32_t mget_dword(char FAR *p); +void mput_word(uint16_t w, char FAR *p); +void mput_dword(uint32_t d, char FAR *p); #endif #endif ================================================ FILE: packages/arj/004_parallel_build.patch ================================================ Description: Fix upstream build sysstem to support parallel builds. Author: Guillem Jover Origin: vendor Forwarded: no Last-Update: 2007-12-05 --- gnu/makefile.in | 74 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 30 deletions(-) --- a/gnu/makefile.in +++ b/gnu/makefile.in @@ -159,13 +159,15 @@ $(SFXSTUB_DIR)/%.o: $(SRC_DIR)/%.c # Main dependency tree # -.PHONY: timestamp prepare cleanup package help +.PHONY: timestamp msg-headers depends prepare clean package help ifdef COMMERCIAL MAKE_KEY=$(TOOLS_DIR)/make_key$x endif all: prepare timestamp + $(MAKE) msg-headers + $(MAKE) depends $(MAKE) do-all do-all: \ @@ -175,8 +177,28 @@ do-all: \ $(REGISTER_DIR)/$(REGISTER)$x \ $(ARJDISP_DIR)/arjdisp$x \ $(TOOLS_DIR)/packager$x \ - $(MAKE_KEY) \ - dispose + $(MAKE_KEY) + +MSG_ID := \ + msg_crp msg_stb msg_sfv msg_sfx msg_sfj msg_arj msg_rej msg_reg msg_adi +MSG_HEADERS := $(patsubst %,$(BASEDIR)/%.h,$(MSG_ID)) + +msg-headers: $(MSG_HEADERS) + +.deps: + mkdir -p $@ + +.deps/%.d: %.c .deps + $(CC) $(CPPFLAGS) $(COPT) $< -MM > $@ + +SOURCES = $(wildcard *.c) +DEPS = $(addprefix .deps/,$(SOURCES:.c=.d)) + +ifeq ($(sort $(DEPS)),$(sort $(wildcard .deps/*.d))) +include $(DEPS) +endif + +depends: $(DEPS) # # Update timestamp file @@ -186,12 +208,6 @@ timestamp: $(TOOLS_DIR)/today$x $(TOOLS_DIR)/today$x $(LOCALE) $(BASEDIR) # -# Final cleanup -# - -dispose: - -# # The tools # @@ -255,7 +271,7 @@ $(ARJCRYPT_DIR)/arjcrypt$d: $(ARJCRYPT_O $(CC) $(ALL_CFLAGS) $(DLL_FLAGS) -o $@ $(ARJCRYPT_OBJS) $(ARJCRYPT_DEF) $(LIBS) $(TOOLS_DIR)/postproc $@ -$(BASEDIR)/nmsg_crp.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/nmsg_crp.c $(BASEDIR)/msg_crp.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_crp $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -269,7 +285,7 @@ $(SFXSTUB_DIR)/sfxstub$x: $(SFXSTUB_OBJS $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(SFXSTUB_OBJS) $(LIBS) $(TOOLS_DIR)/postproc$x $@ -sfx -$(BASEDIR)/nmsg_stb.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/nmsg_stb.c $(BASEDIR)/msg_stb.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_stb $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -287,7 +303,8 @@ $(ARJSFXV_DIR)/arjsfxv$x: $(ARJSFXV_OBJS $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFXV_OBJS) $(LIBS) $(DYN_LIBS) $(TOOLS_DIR)/postproc$x $@ -sfx -$(BASEDIR)/fmsg_sfv.c $(BASEDIR)/imsg_sfv.c $(BASEDIR)/nmsg_sfv.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/fmsg_sfv.c $(BASEDIR)/imsg_sfv.c $(BASEDIR)/nmsg_sfv.c \ +$(BASEDIR)/msg_sfv.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_sfv $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -304,7 +321,8 @@ $(ARJSFX_DIR)/arjsfx$x: $(ARJSFX_OBJS) $ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFX_OBJS) $(LIBS) $(TOOLS_DIR)/postproc$x $@ -sfx -$(BASEDIR)/fmsg_sfx.c $(BASEDIR)/imsg_sfx.c $(BASEDIR)/nmsg_sfx.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/fmsg_sfx.c $(BASEDIR)/imsg_sfx.c $(BASEDIR)/nmsg_sfx.c \ +$(BASEDIR)/msg_sfx.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_sfx $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -319,7 +337,8 @@ $(ARJSFXJR_DIR)/arjsfxjr$x: $(ARJSFXJR_O $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFXJR_OBJS) $(LIBS) $(TOOLS_DIR)/postproc$x $@ -sfx -$(BASEDIR)/fmsg_sfj.c $(BASEDIR)/imsg_sfj.c $(BASEDIR)/nmsg_sfj.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/fmsg_sfj.c $(BASEDIR)/imsg_sfj.c $(BASEDIR)/nmsg_sfj.c \ +$(BASEDIR)/msg_sfj.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_sfj $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -354,7 +373,8 @@ $(ARJ_DIR)/arj$x: $(ARJ_OBJS) \ $(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(BASEDIR)/help.arj $(TOOLS_DIR)/postproc $@ -$(BASEDIR)/fmsg_arj.c $(BASEDIR)/imsg_arj.c $(BASEDIR)/nmsg_arj.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/fmsg_arj.c $(BASEDIR)/imsg_arj.c $(BASEDIR)/nmsg_arj.c \ +$(BASEDIR)/msg_arj.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_arj $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -372,7 +392,8 @@ $(REARJ_DIR)/rearj$x: $(REARJ_OBJS) \ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(REARJ_OBJS) $(LIBS) $(TOOLS_DIR)/postproc $@ -$(BASEDIR)/fmsg_rej.c $(BASEDIR)/imsg_rej.c $(BASEDIR)/nmsg_rej.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/fmsg_rej.c $(BASEDIR)/imsg_rej.c $(BASEDIR)/nmsg_rej.c \ +$(BASEDIR)/msg_rej.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_rej $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -388,7 +409,8 @@ $(REGISTER_DIR)/$(REGISTER)$x: $(REGISTE $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(REGISTER_OBJS) $(LIBS) $(TOOLS_DIR)/postproc $@ -sfx -$(BASEDIR)/fmsg_reg.c $(BASEDIR)/imsg_reg.c $(BASEDIR)/nmsg_reg.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/fmsg_reg.c $(BASEDIR)/imsg_reg.c $(BASEDIR)/nmsg_reg.c \ +$(BASEDIR)/msg_reg.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_reg $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -402,7 +424,8 @@ ARJDISP_OBJS = $(patsubst %,$(ARJDISP_DI $(ARJDISP_DIR)/arjdisp$x: $(ARJDISP_OBJS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJDISP_OBJS) $(LIBS) -$(BASEDIR)/fmsg_adi.c $(BASEDIR)/imsg_adi.c $(BASEDIR)/nmsg_adi.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/fmsg_adi.c $(BASEDIR)/imsg_adi.c $(BASEDIR)/nmsg_adi.c \ +$(BASEDIR)/msg_adi.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_adi $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -427,18 +450,9 @@ prepare: # clean: - -rm -f $(BASEDIR)/* - -rm -f $(TOOLS_DIR)/* - -rm -f $(ARJCRYPT_DIR)/* - -rm -f $(SFXSTUB_DIR)/* - -rm -f $(ARJSFXV_DIR)/* - -rm -f $(ARJSFX_DIR)/* - -rm -f $(ARJSFXJR_DIR)/* - -rm -f $(ARJ_DIR)/* - -rm -f $(REARJ_DIR)/* - -rm -f $(REGISTER_DIR)/* - -rm -f $(ARJDISP_DIR)/* - -rm -f arj.core + rm -rf .deps + rm -rf $(BASEDIR) + rm -f arj.core # # Local installation ================================================ FILE: packages/arj/005_use_system_strnlen.patch ================================================ Description: Detect and conditionally use system strnlen function. This fixes build failures when the system has eglibc 2.10. Author: Guillem Jover Origin: vendor Bug-Debian: https://bugs.debian.org/546475 Forwarded: no Last-Update: 2009-09-13 --- fardata.c | 2 ++ gnu/config.h.in | 1 + gnu/configure.in | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) --- a/fardata.c +++ b/fardata.c @@ -190,6 +190,7 @@ int msg_sprintf(char *str, FMSG *fmt, .. /* Length-limited strlen() */ +#ifndef HAVE_STRNLEN static int strnlen(const char FAR *s, int count) { const char FAR *sc; @@ -198,6 +199,7 @@ static int strnlen(const char FAR *s, in ; return(sc-s); } +#endif /* Hex representation of digits */ --- a/gnu/config.h.in +++ b/gnu/config.h.in @@ -8,6 +8,7 @@ #undef HAVE_FCLOSEALL #undef HAVE_SETPRIORITY #undef HAVE_STRCASECMP +#undef HAVE_STRNLEN #undef HAVE_STRUPR #undef HAVE_STRLWR #undef USE_COLORS --- a/gnu/configure.in +++ b/gnu/configure.in @@ -35,7 +35,9 @@ AC_FUNC_MEMCMP AC_FUNC_SETVBUF_REVERSED AC_TYPE_SIGNAL AC_FUNC_VPRINTF -AC_CHECK_FUNCS([getcwd min max mkdir mkdtemp rmdir fcloseall strcasecmp setpriority strdup strerror strstr strupr strlwr strtol strtoul]) +AC_CHECK_FUNCS([getcwd min max mkdir mkdtemp rmdir fcloseall \ + strcasecmp setpriority strdup strerror strstr strnlen \ + strupr strlwr strtol strtoul]) dnl Platform-specific tuning PROG_EXT= ================================================ FILE: packages/arj/006_use_safe_strcpy.patch ================================================ Description: Use a safe strcpy for overlapping strings, among others fixes a build problem with a mangled generated .c file by msgbind (thus FTBFS), and CRC errors at run-time. Author: Guillem Jover Origin: vendor Bug-Debian: https://bugs.debian.org/590354 Forwarded: no Last-Update: 2010-07-26 --- arj.c | 2 +- arjdata.c | 9 +-------- ea_mgr.c | 2 +- misc.h | 4 ++++ msgbind.c | 2 +- packager.c | 2 +- 6 files changed, 9 insertions(+), 12 deletions(-) --- a/arjdata.c +++ b/arjdata.c @@ -204,13 +204,6 @@ void date_fmt(char *dest) #endif } -/* A safe strcpy() */ - -static void safe_strcpy(char *dest, char *src) -{ - memmove(dest, src, strlen(src)+1); -} - /* Context substitution routine */ char *expand_tags(char *str, int limit) @@ -232,7 +225,7 @@ char *expand_tags(char *str, int limit) { if(*(p+1)==TAG_CHAR) { - strcpy(p, p+1); + safe_strcpy(p, p+1); p++; } else if(*(p+1)==TAG_SPECIAL_BEGIN&&(et=strchr(p+3, TAG_SPECIAL_END))!=NULL) --- a/arj.c +++ b/arj.c @@ -1169,7 +1169,7 @@ int main(int argc, char *argv[]) if(strlen(tmp_ptr)<=121) tmp_ptr[0]='\0'; else if(tmp_ptr[120]==' ') - strcpy(tmp_ptr, tmp_ptr+121); + safe_strcpy(tmp_ptr, tmp_ptr+121); } if(cmd==ARJ_CMD_ORDER&&strpbrk(tmp_ptr, wildcard_pattern)!=NULL) error(M_ORDER_WILDCARD); --- a/ea_mgr.c +++ b/ea_mgr.c @@ -696,7 +696,7 @@ int resolve_longname(char *dest, char *n tmp_name[st_len]='\0'; if(tmp_name[0]==0xFD&&tmp_name[1]==0xFF) { - strcpy(tmp_name, (char *)tmp_name+4); + safe_strcpy(tmp_name, (char *)tmp_name+4); st_len-=4; } if(st_len==0||st_len+entry>=FILENAME_MAX) --- a/msgbind.c +++ b/msgbind.c @@ -578,7 +578,7 @@ int main(int argc, char **argv) } strcat(pool[tpool].data, msgname); strcat(pool[tpool].data, ", "); - strcpy(msg_buffer, msg_buffer+1); + safe_strcpy(msg_buffer, msg_buffer+1); buf_len=strlen(msg_buffer); msg_buffer[--buf_len]='\0'; patch_string(msg_buffer); --- a/packager.c +++ b/packager.c @@ -347,7 +347,7 @@ int main(int argc, char **argv) expand_tags(buf, sizeof(buf)-1); if((p=strchr(buf, '.'))!=NULL) { - strcpy(p, p+1); + safe_strcpy(p, p+1); if((p=strchr(buf, '.'))!=NULL) *p='\0'; } --- a/misc.h +++ b/misc.h @@ -11,6 +11,10 @@ #include "arjtypes.h" #include "filelist.h" +/* A safe strcpy() */ + +#define safe_strcpy(dest, src) memmove(dest, src, strlen(src)+1); + /* ASCIIZ string copy macro */ #define strcpyn(dest, src, n) \ ================================================ FILE: packages/arj/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://arj.sourceforge.net/ TERMUX_PKG_DESCRIPTION="Open-source version of arj archiver" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=3.10.22 TERMUX_PKG_REVISION=5 TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/arj/arj-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=589e4c9bccc8669e7b6d8d6fcd64e01f6a2c21fe10aad56a83304ecc3b96a7db TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { (cd ./gnu && autoconf -f -i) # Hack for executing configure script in # non-standard directory. { echo "#!/bin/sh" echo "cd ./gnu" echo "\$(dirname \$0)/gnu/configure \"\$@\"" } > ./configure chmod +x ./configure } # ARJ appends archive of its help to its end. Unfortunately stripping and # ELF cleaning remove it. So redo this addition and correct the # ARJ self-checksum. termux_step_post_massage() { local build_subdir if [ "$TERMUX_ARCH" = "arm" ]; then build_subdir="linux-androideabi" else build_subdir="linux-android" fi "$TERMUX_PKG_SRCDIR/$build_subdir"/en/rs/tools/join \ bin/arj \ "$TERMUX_PKG_SRCDIR/$build_subdir"/en/rs/help.arj "$TERMUX_PKG_SRCDIR/$build_subdir"/en/rs/tools/postproc \ bin/arj } ================================================ FILE: packages/arj/doc_refer_robert_k_jung.patch ================================================ Description: Refer to original author Robert K. Jung in the manual page. Author: Guillem Jover Origin: vendor Bug-Debian: https://bugs.debian.org/456275 Forwarded: no Last-Update: 2008-06-16 Index: b/resource/en/arj.1 =================================================================== --- a/resource/en/arj.1 2005-06-21 21:27:20.000000000 +0300 +++ b/resource/en/arj.1 2008-06-16 08:25:47.000000000 +0300 @@ -21,6 +21,9 @@ arj \- Archiver for .arj files .IR archive [ .arj ] .RI [ "base directory" ] .RI [ "!list name" | "path name" | "wildcard name" ] +.SH DESCRIPTION +\fIarj\fP is a compression and file archiving utility. It was invented by +Robert K. Jung. \fIARJ\fP stands for \fIA\fPrchived by \fIR\fPobert \fIJ\fPung. .SH COMMANDS .TP .B ac ================================================ FILE: packages/arj/gnu_build_fix.patch ================================================ Description: Fix build failure on GNU/Hurd due to missing -ldl, by adding “gnu*” to the configure case handling libdl linking. Author: Guillem Jover Origin: vendor Forwarded: no Last-Update: 2011-02-28 --- gnu/configure.in | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) --- a/gnu/configure.in +++ b/gnu/configure.in @@ -49,16 +49,11 @@ OS_DEF="-D_UNIX" DLL_CFLAGS="-fPIC" case $host_os in -linux*) +gnu*|linux*|k*bsd*) AC_DEFINE(ELF_EXECUTABLES, 1, [Define if executables use ELF format]) DYN_LIBS="-ldl" LD_STRIP="gnu/stripgcc.lnk" ;; -k*bsd*) - AC_DEFINE(ELF_EXECUTABLES) - DYN_LIBS="-ldl" - LD_STRIP="gnu/stripgcc.lnk" - ;; *bsd*) AC_DEFINE(ELF_EXECUTABLES) DLL_FLAGS="-shared -export-dynamic" ================================================ FILE: packages/arj/gnu_build_flags.patch ================================================ Description: Fix upstream build system to honour CPPFLAGS and LDFLAGS. Author: Guillem Jover Origin: vendor Forwarded: no Last-Update: 2013-05-09 --- gnu/makefile.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) --- a/gnu/makefile.in +++ b/gnu/makefile.in @@ -56,7 +56,7 @@ DEBUG_SM = r ADD_LDFLAGS = -s @LD_STRIP@ endif -ALL_CFLAGS += $(CFLAGS) +ALL_CFLAGS += @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) # Build Installation paths @@ -80,11 +80,11 @@ SFXSTUB_DIR = $(BASEDIR)/sfxstub # Definitions for compiling submodules LDFLAGS = @LDFLAGS@ $(ADD_LDFLAGS) -DLL_FLAGS = @DLL_FLAGS@ $(ADD_LDFLAGS) +DLL_FLAGS = @DLL_FLAGS@ $(LDFLAGS) DLL_CFLAGS = @DLL_CFLAGS@ REQUIRES_DEF = @REQUIRES_DEF@ -COPT = -c -I@OUT_DIR@ -I$(BASEDIR) -I$(SRC_DIR) @CFLAGS@ $(ALL_CFLAGS) +COPT = -c -I@OUT_DIR@ -I$(BASEDIR) -I$(SRC_DIR) $(ALL_CFLAGS) STD_COPT = -DARJUTIL $(COPT) ARJ_COPT = -DSFL=4 $(COPT) ARJSFXV_COPT = -DSFL=3 $(COPT) @@ -189,7 +190,7 @@ msg-headers: $(MSG_HEADERS) mkdir -p $@ .deps/%.d: %.c .deps - $(CC) $(CPPFLAGS) $(COPT) $< -MM > $@ + $(CC) $(COPT) $< -MM > $@ SOURCES = $(wildcard *.c) DEPS = $(addprefix .deps/,$(SOURCES:.c=.d)) ================================================ FILE: packages/arj/gnu_build_pie.patch ================================================ Description: Support PIE build option. We always pass -shared and -fPIC after all user defined flags, so that these will override any possibly passed -fPIE option. Author: Guillem Jover Origin: vendor Forwarded: no Last-Update: 2016-06-03 --- gnu/configure.in | 2 ++ gnu/makefile.in | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) --- a/gnu/makefile.in +++ b/gnu/makefile.in @@ -85,7 +85,7 @@ SFXSTUB_DIR = $(BASEDIR)/sfxstub # Definitions for compiling submodules LDFLAGS = @LDFLAGS@ $(ADD_LDFLAGS) -DLL_FLAGS = @DLL_FLAGS@ $(LDFLAGS) +DLL_FLAGS = $(LDFLAGS) @DLL_FLAGS@ DLL_CFLAGS = @DLL_CFLAGS@ REQUIRES_DEF = @REQUIRES_DEF@ @@ -98,7 +98,7 @@ ARJSFXJR_COPT = -DSFL=1 $(COPT) REARJ_COPT = -DREARJ $(COPT) REGISTER_COPT = -DREGISTER $(COPT) ARJDISP_COPT = -DARJDISP $(COPT) -ARJCRYPT_COPT = $(DLL_CFLAGS) $(COPT) +ARJCRYPT_COPT = $(COPT) $(DLL_CFLAGS) SFXSTUB_COPT = -DSFXSTUB $(COPT) # Linkage --- a/gnu/configure.in +++ b/gnu/configure.in @@ -52,6 +52,8 @@ case $host_os in gnu*|linux*|k*bsd*) AC_DEFINE(ELF_EXECUTABLES, 1, [Define if executables use ELF format]) DYN_LIBS="-ldl" + DLL_FLAGS="-shared -fPIC" + DLL_CFLAGS="-fPIC" LD_STRIP="gnu/stripgcc.lnk" ;; *bsd*) ================================================ FILE: packages/arj/gnu_build_strip.patch ================================================ Description: Support nostrip build option. By changing the upstrem build system to optionally strip the binaries after the linking stage and before their preprocessing. Author: Guillem Jover Origin: vendor Bug-Debian: https://bugs.debian.org/436473 Forwarded: no Last-Update: 2013-05-10 --- gnu/makefile.in | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) --- a/gnu/makefile.in +++ b/gnu/makefile.in @@ -50,10 +50,15 @@ endif ifdef DEBUG DEBUG_SM = d -ALL_CFLAGS += -g -DDEBUG +ALL_CFLAGS += -DDEBUG else DEBUG_SM = r -ADD_LDFLAGS = -s @LD_STRIP@ +endif + +ifdef BUILD_STRIP +STRIP = strip --strip-unneeded --remove-section=.comment --remove-section=.note +else +STRIP = : endif ALL_CFLAGS += @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) @@ -269,6 +274,7 @@ ARJCRYPT_OBJS = $(patsubst %,$(ARJCRYPT_ $(ARJCRYPT_DIR)/arjcrypt$d: $(ARJCRYPT_OBJS) $(TOOLS_DIR)/postproc$x $(CC) $(ALL_CFLAGS) $(DLL_FLAGS) -o $@ $(ARJCRYPT_OBJS) $(ARJCRYPT_DEF) $(LIBS) + $(STRIP) $@ $(TOOLS_DIR)/postproc $@ $(BASEDIR)/nmsg_crp.c $(BASEDIR)/msg_crp.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) @@ -283,6 +289,7 @@ SFXSTUB_OBJS = $(patsubst %,$(SFXSTUB_DI $(SFXSTUB_DIR)/sfxstub$x: $(SFXSTUB_OBJS) $(TOOLS_DIR)/postproc$x $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(SFXSTUB_OBJS) $(LIBS) + $(STRIP) $@ $(TOOLS_DIR)/postproc$x $@ -sfx $(BASEDIR)/nmsg_stb.c $(BASEDIR)/msg_stb.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) @@ -301,6 +308,7 @@ ARJSFXV_OBJS = $(patsubst %,$(ARJSFXV_DI $(ARJSFXV_DIR)/arjsfxv$x: $(ARJSFXV_OBJS) $(TOOLS_DIR)/postproc$x $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFXV_OBJS) $(LIBS) $(DYN_LIBS) + $(STRIP) $@ $(TOOLS_DIR)/postproc$x $@ -sfx $(BASEDIR)/fmsg_sfv.c $(BASEDIR)/imsg_sfv.c $(BASEDIR)/nmsg_sfv.c \ @@ -319,6 +327,7 @@ ARJSFX_OBJS = $(patsubst %,$(ARJSFX_DIR) $(ARJSFX_DIR)/arjsfx$x: $(ARJSFX_OBJS) $(TOOLS_DIR)/postproc$x $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFX_OBJS) $(LIBS) + $(STRIP) $@ $(TOOLS_DIR)/postproc$x $@ -sfx $(BASEDIR)/fmsg_sfx.c $(BASEDIR)/imsg_sfx.c $(BASEDIR)/nmsg_sfx.c \ @@ -335,6 +344,7 @@ ARJSFXJR_OBJS = $(patsubst %,$(ARJSFXJR_ $(ARJSFXJR_DIR)/arjsfxjr$x: $(ARJSFXJR_OBJS) $(TOOLS_DIR)/postproc$x $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFXJR_OBJS) $(LIBS) + $(STRIP) $@ $(TOOLS_DIR)/postproc$x $@ -sfx $(BASEDIR)/fmsg_sfj.c $(BASEDIR)/imsg_sfj.c $(BASEDIR)/nmsg_sfj.c \ @@ -364,6 +374,7 @@ $(ARJ_DIR)/arj$x: $(ARJ_OBJS) \ $(ARJSFX_DIR)/arjsfx$x \ $(ARJSFXJR_DIR)/arjsfxjr$x $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJ_OBJS) $(LIBS) $(DYN_LIBS) + $(STRIP) $@ $(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(ARJSFXJR_DIR)/arjsfxjr$x $(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(ARJSFX_DIR)/arjsfx$x $(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(ARJSFXV_DIR)/arjsfxv$x @@ -390,6 +401,7 @@ REARJ_OBJS = $(patsubst %,$(REARJ_DIR)/% $(REARJ_DIR)/rearj$x: $(REARJ_OBJS) \ $(TOOLS_DIR)/postproc$x $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(REARJ_OBJS) $(LIBS) + $(STRIP) $@ $(TOOLS_DIR)/postproc $@ $(BASEDIR)/fmsg_rej.c $(BASEDIR)/imsg_rej.c $(BASEDIR)/nmsg_rej.c \ @@ -407,6 +419,7 @@ REGISTER_OBJS = $(patsubst %,$(REGISTER_ $(REGISTER_DIR)/$(REGISTER)$x: $(REGISTER_OBJS) \ $(TOOLS_DIR)/postproc$x $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(REGISTER_OBJS) $(LIBS) + $(STRIP) $@ $(TOOLS_DIR)/postproc $@ -sfx $(BASEDIR)/fmsg_reg.c $(BASEDIR)/imsg_reg.c $(BASEDIR)/nmsg_reg.c \ @@ -423,6 +436,7 @@ ARJDISP_OBJS = $(patsubst %,$(ARJDISP_DI $(ARJDISP_DIR)/arjdisp$x: $(ARJDISP_OBJS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJDISP_OBJS) $(LIBS) + $(STRIP) $@ $(BASEDIR)/fmsg_adi.c $(BASEDIR)/imsg_adi.c $(BASEDIR)/nmsg_adi.c \ $(BASEDIR)/msg_adi.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) ================================================ FILE: packages/arj/hurd_no_fcntl_getlk.patch ================================================ Description: Fix build failure on GNU/Hurd, by handling unimplemented fcntl(F_GETLK). The Hurd does not implement yet fcntl(F_GETLK) and returns ENOSYS, handle this as a non-fatal error. Author: Guillem Jover Origin: vendor Forwarded: no Last-Update: 2013-05-10 --- environ.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/environ.c +++ b/environ.c @@ -1775,7 +1775,8 @@ int file_test_access(char *name) memset(&flk, 0, sizeof(flk)); rc=fcntl(handle, F_GETLK, &flk); close(handle); - return(((rc==-1&&errno!=EINVAL)||(rc!=1&&flk.l_type==F_RDLCK))?-1:0); + return(((rc==-1&&errno!=EINVAL&&errno!=ENOSYS)|| + (rc!=1&&flk.l_type==F_RDLCK))?-1:0); #endif } #endif ================================================ FILE: packages/arj/integr.patch ================================================ Declare arj_integrity_identifier as global. Without this it's not added to resulting binary and we need it. --- src-orig/integr.c 2017-09-08 21:45:38.422802558 +0200 +++ src/integr.c 2017-09-08 22:25:22.853785365 +0200 @@ -5,7 +5,7 @@ * */ -static volatile const char intergrity_identifier[] = { +volatile const char arj_intergrity_identifier[] = { 0xB0, 0x03, 0xB0, 0x02, 0xB0, 0x03, 0xB0, 0x04, 0xB0, 0x05, 0x90, 0x90, 0x90, 0x90, ================================================ FILE: packages/arj/mode.patch ================================================ Fix mode consts. Use modern consts present on modern Android. --- src-orig/arjsfxjr.c 2017-09-08 21:45:38.418802563 +0200 +++ src/arjsfxjr.c 2017-09-08 22:12:14.130184907 +0200 @@ -520,7 +520,7 @@ } } create_subdir_tree(filename); - if(file_type!=ARJT_DIR&&(atstream=open(filename, O_CREAT|O_TRUNC|O_BINARY|O_RDWR, S_IREAD|S_IWRITE))<0) + if(file_type!=ARJT_DIR&&(atstream=open(filename, O_CREAT|O_TRUNC|O_BINARY|O_RDWR, S_IRUSR|S_IWUSR))<0) { skip_file(M_CANTOPEN_F); errors++; ================================================ FILE: packages/arj/out-of-bounds-read.patch ================================================ Description: Fix out-of-bounds read We need to handle possible overflows, by using an int instead of a short, and terminating if after computing the index it is out-of-bounds. Author: Guillem Jover Origin: vendor Bug-Debian: https://bugs.debian.org/783948 Forwarded: no Last-Update: 2015-07-01 --- --- arj-3.10.22.orig/decode.c +++ arj-3.10.22/decode.c @@ -416,10 +416,10 @@ static void NEAR decode_end() void decode(int action) { - short i; - short r; - short c; - static short j; + int i; + int r; + int c; + static int j; #if SFX_LEVEL>=ARJSFXV if(!setjmp(decode_proc)) @@ -450,9 +450,12 @@ void decode(int action) { j=c-(UCHAR_MAX+1-THRESHOLD); count-=(unsigned long)j; - i=r-decode_p()-1; + int P = decode_p(); + i=r-P-1; if(i<0) i+=DICSIZ; + if(i<0) + goto termination; if(r>i&&r=0) ================================================ FILE: packages/arj/security-afl.patch ================================================ Description: Fix buffer overflow causing an invalid pointer free(). Author: Guillem Jover Origin: vendor Bug-Debian: https://bugs.debian.org/774015 Forwarded: no Last-Update: 2015-02-26 --- decode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/decode.c +++ b/decode.c @@ -255,7 +255,7 @@ void read_pt_len(int nn, int nbit, int i if(i==i_special) { c=getbits(2); - while(--c>=0) + while(--c>=0&&i=0) + while(--c>=0&&i Origin: vendor Bug-Debian: https://bugs.debian.org/774435 Forwarded: no Last-Update: 2015-02-26 --- environ.c | 3 +++ 1 file changed, 3 insertions(+) --- a/environ.c +++ b/environ.c @@ -1087,6 +1087,8 @@ static char *validate_path(char *name) if(action!=VALIDATE_DRIVESPEC) { #endif + while (name[0]!='\0'&& + (name[0]=='.'||name[0]==PATHSEP_DEFAULT||name[0]==PATHSEP_UNIX)) { if(name[0]=='.') { if(name[1]=='.'&&(name[2]==PATHSEP_DEFAULT||name[2]==PATHSEP_UNIX)) @@ -1096,6 +1098,7 @@ static char *validate_path(char *name) } if(name[0]==PATHSEP_DEFAULT||name[0]==PATHSEP_UNIX) name++; /* "\\" - revert to root */ + } #if SFX_LEVEL>=ARJSFXV } } ================================================ FILE: packages/arj/security-traversal-symlink.patch ================================================ Description: Fix symlink directory traversal. Do not allow symlinks that traverse the current directoru, nor absolute symlinks. . Fixes CVE-2015-0556. Author: Guillem Jover Origin: vendor Bug-Debian: https://bugs.debian.org/774434 Forwarded: no Last-Update: 2015-03-28 --- uxspec.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) --- a/uxspec.c +++ b/uxspec.c @@ -120,6 +120,58 @@ int query_uxspecial(char FAR **dest, cha } #endif +#if TARGET==UNIX +static int is_link_traversal(const char *name) +{ + enum { + STATE_NONE, + STATE_DOTS, + STATE_NAME, + } state = STATE_NONE; + int ndir = 0; + int dots = 0; + + while(*name) { + int c = *name++; + + if (c == '/') + { + if ((state == STATE_DOTS) && (dots == 2)) + ndir--; + if (ndir < 0) + return 1; + if ((state == STATE_DOTS && dots == 1) && ndir == 0) + return 1; + if (state == STATE_NONE && ndir == 0) + return 1; + if ((state == STATE_DOTS) && (dots > 2)) + ndir++; + state = STATE_NONE; + dots = 0; + } + else if (c == '.') + { + if (state == STATE_NONE) + state = STATE_DOTS; + dots++; + } + else + { + if (state == STATE_NONE) + ndir++; + state = STATE_NAME; + } + } + + if ((state == STATE_DOTS) && (dots == 2)) + ndir--; + if ((state == STATE_DOTS) && (dots > 2)) + ndir++; + + return ndir < 0; +} +#endif + /* Restores the UNIX special file data */ int set_uxspecial(char FAR *storage, char *name) @@ -156,6 +208,8 @@ int set_uxspecial(char FAR *storage, cha l=sizeof(tmp_name)-1; far_memmove((char FAR *)tmp_name, dptr, l); tmp_name[l]='\0'; + if (is_link_traversal(tmp_name)) + return(UXSPEC_RC_ERROR); rc=(id==UXSB_HLNK)?link(tmp_name, name):symlink(tmp_name, name); if(!rc) return(0); ================================================ FILE: packages/arj/security_format.patch ================================================ Description: Fix format security errors. Author: Guillem Jover Origin: vendor Forwarded: no Last-Update: 2013-05-09 --- arj_arcv.c | 12 ++++++------ arj_user.c | 8 ++++---- arjdisp.c | 58 ++++++++++++++++++++++++++++------------------------------ arjsfx.c | 2 +- fardata.c | 10 +++++----- rearj.c | 2 +- register.c | 2 +- 7 files changed, 46 insertions(+), 48 deletions(-) --- a/fardata.c +++ b/fardata.c @@ -52,7 +52,7 @@ int error_proc(FMSG *errmsg, ...) /* Check if the message could have a standard error code */ if(errno!=0&&is_std_error(errmsg)) { - msg_cprintf(0, lf); + msg_cprintf(0, "\n"); error_report(); } #endif @@ -379,10 +379,10 @@ static void flush_cbuf(int ccode, char * { #if SFX_LEVEL>=ARJSFXV fprintf(new_stdout, strform, n_text); - fprintf(new_stdout, lf); + fprintf(new_stdout, "\n"); #else printf(strform, n_text); - printf(lf); + printf("\n"); #endif } else @@ -393,13 +393,13 @@ static void flush_cbuf(int ccode, char * #ifdef NEED_CRLF scr_out("\r"); #endif - scr_out(lf); + scr_out("\n"); } if(!no_colors) textcolor(color_table[ccode&H_COLORMASK].color); #else printf(strform, n_text); - printf(lf); + printf("\n"); #endif n_text=t_text+1; #if SFX_LEVEL>=ARJ --- a/arj_user.c +++ b/arj_user.c @@ -1059,7 +1059,7 @@ static void finish_processing(int cmd) if(recover_file(tmp_archive_name, nullstr, tmp_tmp_filename, protected, eof_pos)) { msg_cprintf(H_HL, M_CANT_FIND_DAMAGE, archive_name); - printf(lf); + printf("\n"); } else { @@ -1294,7 +1294,7 @@ static void finish_processing(int cmd) if(recover_file(archive_name, nullstr, nullstr, protected, eof_pos)) { msg_cprintf(H_HL, M_CANT_FIND_DAMAGE, archive_name); - printf(lf); + printf("\n"); } else { @@ -1327,7 +1327,7 @@ static void finish_processing(int cmd) msg_cprintf(0, M_CHAPTERS_ON); else if(chapter_mode==CHAP_REMOVE) msg_cprintf(0, M_CHAPTERS_OFF); - msg_cprintf(0, strform, lf); + msg_cprintf(0, strform, "\n"); } if(cmd==ARJ_CMD_COPY&&protfile_option&&!arjprot_tail) msg_cprintf(0, M_ARJPROT_DISABLED); @@ -2303,7 +2303,7 @@ void process_archive() timestamp_to_str(timetext, &ftime_stamp); msg_cprintf(H_HL|H_NFMT, M_ARCHIVE_CREATED, timetext); if(show_ansi_comments) - printf(cmt_ptr); + fputs(cmt_ptr, stdout); else display_comment(cmt_ptr); /* The sfx_setup() occurs here */ --- a/arj_arcv.c +++ b/arj_arcv.c @@ -913,13 +913,13 @@ int supply_comment(char *cmtname, char * else { strcat(tmp_comment, tmp_cmtline); - strcat(tmp_comment, lf); + strcat(tmp_comment, "\n"); } } else { strcat(tmp_comment, tmp_cmtline); - strcat(tmp_comment, lf); + strcat(tmp_comment, "\n"); } } } @@ -1846,7 +1846,7 @@ int pack_file(int is_update, int is_repl raw_eh=eh_lookup(eh, UXSPECIAL_ID)->raw; uxspecial_stats(raw_eh, UXSTATS_SHORT); } - msg_cprintf(0, lf); + msg_cprintf(0, "\n"); } if(err_id==0&&user_wants_fail) { @@ -2523,9 +2523,9 @@ int unpack_validation() { msg_cprintf(0, (FMSG *)strform, misc_buf); if(search_mode==SEARCH_DEFAULT) - msg_cprintf(0, (FMSG *)lf); + msg_cprintf(0, "\n"); if(search_mode==SEARCH_BRIEF) - msg_cprintf(0, (FMSG *)cr); + msg_cprintf(0, "\r"); } for(pattern=0; pattern=ARJSFXV if(ferror(stdout)) - msg_fprintf(stderr, M_DISK_FULL); + msg_fprintf(stderr, "Can't write file. Disk full?"); if(debug_enabled&&strchr(debug_opt, 't')!=NULL) { ticks=get_ticks()-ticks; --- a/rearj.c +++ b/rearj.c @@ -935,7 +935,7 @@ static int convert_archive(char *name) msg_cprintf(H_HL|H_NFMT, M_OLD_SIZE, old_fsize); msg_cprintf(H_HL|H_NFMT, M_NEW_SIZE, new_fsize); msg_cprintf(H_HL|H_NFMT, M_SAVINGS_SIZE, gain); - printf(lf); + printf("\n"); total_old_fsize+=old_fsize; total_new_fsize+=new_fsize; total_files++; --- a/register.c +++ b/register.c @@ -205,7 +205,7 @@ int main(int argc, char **argv) char reg_source[200]; int i; - printf(M_REGISTER_BANNER); + fputs(M_REGISTER_BANNER, stdout); integrity_pattern[0]--; build_crc32_table(); if(argc!=2) --- a/arjdisp.c +++ b/arjdisp.c @@ -20,8 +20,6 @@ static long bytes; static long compsize; static char cmd_verb; static char msg_lf[]="\n"; -char strform[]="%s"; /* Export it for scrnio.c, too - (a byte saved is a byte gained) */ /* Pseudographical controls */ @@ -54,19 +52,19 @@ static void show_init_scrn() textcolor(7); clrscr(); gotoxy(2, 2); - scrprintf(win_top); + fputs(win_top, stdout); for(i=3; i<24; i++) { - gotoxy(2, i); scrprintf(win_border); - gotoxy(79, i); scrprintf(win_border); + gotoxy(2, i); fputs(win_border, stdout); + gotoxy(79, i); fputs(win_border, stdout); } - gotoxy(2, 24); scrprintf(win_bottom); + gotoxy(2, 24); fputs(win_bottom, stdout); gotoxy(10, 5); - scrprintf(M_ARJDISP_COPYRIGHT); + fputs(M_ARJDISP_COPYRIGHT, stdout); gotoxy(10, 6); - scrprintf(M_ARJDISP_DISTRIBUTION); + fputs(M_ARJDISP_DISTRIBUTION, stdout); gotoxy(10, 7); - scrprintf(M_ARJDISP_LICENSE); + fputs(M_ARJDISP_LICENSE, stdout); gotoxy(16, 10); scrprintf(M_PROCESSING_ARCHIVE, archive_name); t=strtok(M_ARJDISP_INFO, msg_lf); @@ -74,11 +72,11 @@ static void show_init_scrn() while(t!=NULL&&i<=23) { gotoxy(10, i++); - scrprintf(strform, t); + scrprintf("%s", t); t=strtok(NULL, msg_lf); } gotoxy(16, 20); - scrprintf(M_PRESS_ANY_KEY); + fputs(M_PRESS_ANY_KEY, stdout); uni_getch(); gotoxy(1, 24); } @@ -96,19 +94,19 @@ static void show_proc_scrn() { clrscr(); gotoxy(2, 2); - scrprintf(win_top); + fputs(win_top, stdout); for(i=3; i<24; i++) { - gotoxy(2, i); scrprintf(win_border); - gotoxy(79, i); scrprintf(win_border); + gotoxy(2, i); fputs(win_border, stdout); + gotoxy(79, i); fputs(win_border, stdout); } - gotoxy(2, 24); scrprintf(win_bottom); + gotoxy(2, 24); fputs(win_bottom, stdout); gotoxy(10, 5); - scrprintf(M_ARJDISP_COPYRIGHT); + fputs(M_ARJDISP_COPYRIGHT, stdout); gotoxy(10, 6); - scrprintf(M_ARJDISP_DISTRIBUTION); + fputs(M_ARJDISP_DISTRIBUTION, stdout); gotoxy(10, 7); - scrprintf(M_ARJDISP_LICENSE); + fputs(M_ARJDISP_LICENSE, stdout); gotoxy(16, 10); scrprintf(M_PROCESSING_ARCHIVE, archive_name); gotoxy(16, 12); @@ -132,13 +130,13 @@ static void show_proc_scrn() break; } gotoxy(15, 14); - scrprintf(ind_top); + fputs(ind_top, stdout); gotoxy(15, 15); - scrprintf(ind_middle); + fputs(ind_middle, stdout); gotoxy(15, 16); - scrprintf(ind_bottom); + fputs(ind_bottom, stdout); gotoxy(16, 18); - scrprintf(M_ARJDISP_CTR_START); + fputs(M_ARJDISP_CTR_START, stdout); } else { @@ -146,7 +144,7 @@ static void show_proc_scrn() gotoxy(16, 15); memset(progress, indo, i); progress[i]='\0'; - scrprintf(progress); + fputs(progress, stdout); gotoxy(16, 18); scrprintf(M_ARJDISP_CTR, calc_percentage(bytes, uncompsize)/10); } @@ -165,19 +163,19 @@ static void show_ending_scrn() textcolor(7); clrscr(); gotoxy(2, 2); - scrprintf(win_top); + fputs(win_top, stdout); for(i=3; i<24; i++) { - gotoxy(2, i); scrprintf(win_border); - gotoxy(79, i); scrprintf(win_border); + gotoxy(2, i); fputs(win_border, stdout); + gotoxy(79, i); fputs(win_border, stdout); } - gotoxy(2, 24); scrprintf(win_bottom); + gotoxy(2, 24); fputs(win_bottom, stdout); gotoxy(10, 5); - scrprintf(M_ARJDISP_COPYRIGHT); + fputs(M_ARJDISP_COPYRIGHT, stdout); gotoxy(10, 6); - scrprintf(M_ARJDISP_DISTRIBUTION); + fputs(M_ARJDISP_DISTRIBUTION, stdout); gotoxy(10, 7); - scrprintf(M_ARJDISP_LICENSE); + fputs(M_ARJDISP_LICENSE, stdout); gotoxy(16, 10); scrprintf(M_FINISHED_PROCESSING, archive_name); gotoxy(1, 24); ================================================ FILE: packages/arj/self_integrity_64bit.patch ================================================ Description: Fix arj self-integrity check on 64-bit systems Author: B Watson Origin: other, http://slackbuilds.org/cgit/slackbuilds/tree/system/arj/patches/SBo_integrity_64bit.patch Forwarded: no Reviewed-By: Guillem Jover Last-Update: 2014-08-06 diff -Naur arj-3.10.22/arj_proc.c arj-3.10.22.patched/arj_proc.c --- arj-3.10.22/arj_proc.c 2005-06-21 15:53:12.000000000 -0400 +++ arj-3.10.22.patched/arj_proc.c 2014-08-06 04:11:35.000000000 -0400 @@ -7,6 +7,7 @@ * */ +#include #include "arj.h" DEBUGHDR(__FILE__) /* Debug information block */ @@ -929,9 +930,9 @@ #endif fclose(stream); #if SFX_LEVEL>=ARJSFXV - return(crc32term==st_crc&&fsize==st_fsize); + return((uint32_t)crc32term==(uint32_t)st_crc&&(uint32_t)fsize==(uint32_t)st_fsize); #else - if(crc32term==st_crc&&fsize==st_fsize) + if((uint32_t)crc32term==(uint32_t)st_crc&&(uint32_t)fsize==(uint32_t)st_fsize) msg_cprintf(0, M_INTEGRITY_OK); else pause_error(M_INTEGRITY_VIOLATED); diff -Naur arj-3.10.22/postproc.c arj-3.10.22.patched/postproc.c --- arj-3.10.22/postproc.c 2003-06-22 07:12:28.000000000 -0400 +++ arj-3.10.22.patched/postproc.c 2014-08-06 03:22:16.000000000 -0400 @@ -6,6 +6,7 @@ * */ +#include #include "arj.h" /* Operations */ @@ -37,8 +38,9 @@ static char buf[PROC_BLOCK_SIZE]; -static void _fput_dword(const unsigned long l, FILE *stream) +static void _fput_dword(const unsigned long w, FILE *stream) { + uint32_t l = (uint32_t)w; #ifdef WORDS_BIGENDIAN fputc(l ,stream); fputc(l>>8 ,stream); ================================================ FILE: packages/arj/z_cross_compile.patch ================================================ Make arj cross-compileable. arj assumes that build and host are the same. Fix those assumptions. diff '--exclude=config.status' '--exclude=configure' '--exclude=*autom4te*' '--exclude=config.log' '--exclude=*~' -ur src-orig/gnu/configure.in src/gnu/configure.in --- src-orig/gnu/configure.in 2017-09-08 21:45:38.474802486 +0200 +++ src/gnu/configure.in 2017-09-08 23:09:57.990014311 +0200 @@ -15,11 +15,15 @@ AC_CONFIG_HEADER([../c_defs.h:config.h.in]) dnl Checks for the canonical system name +AC_CANONICAL_BUILD AC_CANONICAL_HOST dnl Checks for programs. AC_PROG_CC +AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc clang]) +test -z "$BUILD_CC" && AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.]) + dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h limits.h malloc.h]) @@ -196,6 +200,7 @@ AC_SUBST(LD_STRIP) AC_SUBST(REGISTER) AC_SUBST(TOLERANT_FNMATCH) +AC_SUBST(BUILD_CC) AC_CONFIG_FILES([../GNUmakefile:makefile.in]) AC_OUTPUT diff '--exclude=config.status' '--exclude=configure' '--exclude=*autom4te*' '--exclude=config.log' '--exclude=*~' -ur src-orig/gnu/makefile.in src/gnu/makefile.in --- src-orig/gnu/makefile.in 2017-09-08 21:45:38.474802486 +0200 +++ src/gnu/makefile.in 2017-09-08 23:17:01.790798189 +0200 @@ -14,6 +14,8 @@ LIBS = @LIBS@ REGISTER = @REGISTER@ +BUILD_CC = @BUILD_CC@ + # Programs INSTALL = @INSTALL@ @@ -40,17 +42,21 @@ ALL_CFLAGS = -DLOCALE=LANG_$(LOCALE) -DLOCALE_DESC="\"$(LOCALE)\"" \ -DPKGLIBDIR="\"$(pkglibdir)\"" @OS_DEF@ +BUILD_ALL_CFLAGS = -DLOCALE=LANG_$(LOCALE) -DLOCALE_DESC="\"$(LOCALE)\"" \ + -DPKGLIBDIR="\"$(pkglibdir)\"" @OS_DEF@ ifndef COMMERCIAL PACKAGE = s else PACKAGE = c ALL_CFLAGS += -DCOMMERCIAL +BUILD_ALL_CFLAGS += -DCOMMERCIAL endif ifdef DEBUG DEBUG_SM = d ALL_CFLAGS += -DDEBUG +BUILD_ALL_CFLAGS += -DDEBUG else DEBUG_SM = r endif @@ -62,6 +68,7 @@ endif ALL_CFLAGS += @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) +BUILD_ALL_CFLAGS += $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) # Build Installation paths @@ -73,6 +80,7 @@ TOOLS_DIR = $(BASEDIR)/tools ARJ_DIR = $(BASEDIR)/arj +BUILD_ARJ_DIR = $(BASEDIR)/build-arj ARJSFXV_DIR = $(BASEDIR)/arjsfxv ARJSFX_DIR = $(BASEDIR)/arjsfx ARJSFXJR_DIR = $(BASEDIR)/arjsfxjr @@ -90,8 +98,10 @@ REQUIRES_DEF = @REQUIRES_DEF@ COPT = -c -I@OUT_DIR@ -I$(BASEDIR) -I$(SRC_DIR) $(ALL_CFLAGS) -STD_COPT = -DARJUTIL $(COPT) +BUILD_COPT = -c -I@OUT_DIR@ -I$(BASEDIR) -I$(SRC_DIR) $(BUILD_ALL_CFLAGS) +BUILD_STD_COPT = -DARJUTIL $(BUILD_COPT) ARJ_COPT = -DSFL=4 $(COPT) +BUILD_ARJ_COPT = -DSFL=4 $(BUILD_COPT) ARJSFXV_COPT = -DSFL=3 $(COPT) ARJSFX_COPT = -DSFL=2 $(COPT) ARJSFXJR_COPT = -DSFL=1 $(COPT) @@ -106,6 +116,9 @@ $(ARJ_DIR)/%.o: $(BASEDIR)/%.c $(CC) $(COPT) -o$@ $< +$(BUILD_ARJ_DIR)/%.o: $(BASEDIR)/%.c + $(BUILD_CC) -DDISABLE_ARJCRYPT=1 $(BUILD_COPT) -o$@ $< + $(ARJSFX_DIR)/%.o: $(BASEDIR)/%.c $(CC) $(COPT) -o$@ $< @@ -131,11 +144,14 @@ $(CC) $(COPT) -o$@ $< $(TOOLS_DIR)/%.o: $(SRC_DIR)/%.c - $(CC) $(STD_COPT) -o$@ $< + $(BUILD_CC) $(BUILD_STD_COPT) -o$@ $< $(ARJ_DIR)/%.o: $(SRC_DIR)/%.c $(CC) $(ARJ_COPT) -o$@ $< +$(BUILD_ARJ_DIR)/%.o: $(SRC_DIR)/%.c + $(BUILD_CC) $(BUILD_ARJ_COPT) -DDISABLE_ARJCRYPT=1 -o$@ $< + $(ARJSFXV_DIR)/%.o: $(SRC_DIR)/%.c $(CC) $(ARJSFXV_COPT) -o$@ $< @@ -235,22 +251,22 @@ filemode.o packager.o arjdata.o) $(TOOLS_DIR)/msgbind$x: $(MSGBIND_OBJS) - $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(MSGBIND_OBJS) $(LIBS) + $(BUILD_CC) $(BUILD_ALL_CFLAGS) $(BUILD_LDFLAGS) -ldl -o $@ $(MSGBIND_OBJS) $(LIBS) $(TOOLS_DIR)/today$x: $(TODAY_OBJS) - $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(TODAY_OBJS) $(LIBS) + $(BUILD_CC) $(BUILD_ALL_CFLAGS) $(BUILD_LDFLAGS) -ldl -o $@ $(TODAY_OBJS) $(LIBS) $(TOOLS_DIR)/make_key$x: $(MAKE_KEY_OBJS) - $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(MAKE_KEY_OBJS) $(LIBS) + $(BUILD_CC) $(BUILD_ALL_CFLAGS) $(BUILD_LDFLAGS) -ldl -o $@ $(MAKE_KEY_OBJS) $(LIBS) $(TOOLS_DIR)/postproc$x: $(POSTPROC_OBJS) - $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(POSTPROC_OBJS) $(LIBS) + $(BUILD_CC) $(BUILD_ALL_CFLAGS) $(BUILD_LDFLAGS) -ldl -o $@ $(POSTPROC_OBJS) $(LIBS) $(TOOLS_DIR)/join$x: $(JOIN_OBJS) - $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JOIN_OBJS) $(LIBS) + $(BUILD_CC) $(BUILD_ALL_CFLAGS) $(BUILD_LDFLAGS) -ldl -o $@ $(JOIN_OBJS) $(LIBS) $(TOOLS_DIR)/packager$x: $(PACKAGER_OBJS) - $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(PACKAGER_OBJS) $(LIBS) + $(BUILD_CC) $(BUILD_ALL_CFLAGS) $(BUILD_LDFLAGS) -ldl -o $@ $(PACKAGER_OBJS) $(LIBS) # This rule tells that timestamping badly needs date_sig.c (it may bail out # otherwise when the timestamps are being created for the first time) @@ -355,17 +371,22 @@ # ARJ itself # -ARJ_OBJS = $(patsubst %,$(ARJ_DIR)/%, \ - filemode.o date_sig.o fmsg_arj.o imsg_arj.o \ +ARJ_OBJS_BASE= filemode.o date_sig.o fmsg_arj.o imsg_arj.o \ nmsg_arj.o integr.o file_reg.o decode.o encode.o \ arj.o enc_gwy.o fardata.o arj_user.o arj_arcv.o \ arj_file.o crc32.o misc.o debug.o arj_proc.o \ environ.o ea_mgr.o uxspec.o ext_hdr.o arjtypes.o exe_sear.o chk_fmsg.o \ filelist.o arjsec_h.o arjsec_l.o garble.o scrnio.o ansi.o \ crc16tab.o recovery.o gost.o gost40.o gost_t.o \ - externs.o) + externs.o + +ARJ_OBJS = $(patsubst %,$(ARJ_DIR)/%, $(ARJ_OBJS_BASE) ) +BUILD_ARJ_OBJS = $(patsubst %,$(BUILD_ARJ_DIR)/%, $(ARJ_OBJS_BASE) ) + +$(BUILD_ARJ_DIR)/arj$x: $(BUILD_ARJ_OBJS) + $(BUILD_CC) $(BUILD_ALL_CFLAGS) $(BUILD_LDFLAGS) -ldl -o $@ $(BUILD_ARJ_OBJS) -$(ARJ_DIR)/arj$x: $(ARJ_OBJS) \ +$(ARJ_DIR)/arj$x: $(ARJ_OBJS) $(BUILD_ARJ_DIR)/arj$x \ $(RES_DIR)/$(LOCALE)/arjl.txt $(RES_DIR)/$(LOCALE)/arjs.txt \ $(TOOLS_DIR)/join$x \ $(TOOLS_DIR)/postproc$x \ @@ -380,7 +401,7 @@ $(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(ARJSFXV_DIR)/arjsfxv$x $(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(SFXSTUB_DIR)/sfxstub$x rm -f $(BASEDIR)/help.arj - $(ARJ_DIR)/arj$x a $(BASEDIR)/help.arj -+ -t1f -2e -e -jm -jh65535 -jt $(RES_DIR)/$(LOCALE)/arj?.txt + $(BUILD_ARJ_DIR)/arj$x a $(BASEDIR)/help.arj -+ -t1f -2e -e -jm -jh65535 -jt $(RES_DIR)/$(LOCALE)/arj?.txt $(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(BASEDIR)/help.arj $(TOOLS_DIR)/postproc $@ @@ -455,6 +476,7 @@ -mkdir -p $(ARJSFX_DIR) -mkdir -p $(ARJSFXJR_DIR) -mkdir -p $(ARJ_DIR) + -mkdir -p $(BUILD_ARJ_DIR) -mkdir -p $(REARJ_DIR) -mkdir -p $(REGISTER_DIR) -mkdir -p $(ARJDISP_DIR) --- src-orig/garble.c 2004-02-21 23:53:34.000000000 +0100 +++ src/garble.c 2017-10-05 15:30:09.416517680 +0200 @@ -90,6 +90,7 @@ #if TARGET==OS2||TARGET==WIN32||TARGET==UNIX static void remove_arjcrypt() { +#ifndef DISABLE_ARJCRYPT if(arjcrypt_loaded) { #if TARGET==OS2 @@ -100,6 +101,7 @@ dlclose(arjcrypt_hmod); #endif } +#endif arjcrypt_loaded=0; } #endif @@ -109,6 +109,10 @@ static int arjcrypt_init(char *name) { +#ifdef DISABLE_ARJCRYPT + fputs("arjcrypt is disabled", new_stdout); + error(M_ARJCRYPT_ERROR); +#else FILE *stream; int arjcrypt_size; /* Size of ARJCRYPT module */ char *tmp_cryptmem; /* Temporary storage for ARJCRYPT */ @@ -186,6 +190,7 @@ if((arjcrypt_entry=dlsym(arjcrypt_hmod, "entry"))==NULL) error(M_NO_ARJCRYPT_ENTRY); #endif +#endif return(0); } ================================================ FILE: packages/asciidoc/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://asciidoc.org TERMUX_PKG_DESCRIPTION="Text document format for short documents, articles, books and UNIX man pages." TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=8.6.10 TERMUX_PKG_SRCURL=https://github.com/asciidoc/asciidoc/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=9e52f8578d891beaef25730a92a6e723596ddbd07bfe0d2a56486fcf63a0b983 TERMUX_PKG_DEPENDS="docbook-xsl, python2, xsltproc" TERMUX_PKG_SUGGESTS="lynx, w3m" TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { sed -i -e 's#python a2x.py#python2 a2x.py#' Makefile.in autoreconf -vfi } termux_step_post_make_install() { make docs install -Dm644 asciidocapi.py \ $TERMUX_PREFIX/lib/python2.7/site-packages/asciidocapi.py } ================================================ FILE: packages/asciinema/asciinema-__main__.py.patch ================================================ diff -u -r ../asciinema-2.0.2/asciinema/__main__.py ./asciinema/__main__.py --- ../asciinema-2.0.2/asciinema/__main__.py 2019-01-12 18:58:29.000000000 +0000 +++ ./asciinema/__main__.py 2019-01-16 21:07:50.834574609 +0000 @@ -50,10 +50,6 @@ def main(): - if locale.nl_langinfo(locale.CODESET).upper() not in ['US-ASCII', 'UTF-8']: - print("asciinema needs an ASCII or UTF-8 character encoding to run. Check the output of `locale` command.") - sys.exit(1) - try: cfg = config.load() except config.ConfigError as e: ================================================ FILE: packages/asciinema/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://asciinema.org/ TERMUX_PKG_DESCRIPTION="Record and share your terminal sessions, the right way" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=2.0.2 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=2578a1b5611e5375771ef6582a6533ef8d40cdbed1ba1c87786fd23af625ab68 TERMUX_PKG_SRCURL=https://github.com/asciinema/asciinema/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_PLATFORM_INDEPENDENT=true TERMUX_PKG_HAS_DEBUG=false # ncurses-utils for tput which asciinema uses: TERMUX_PKG_DEPENDS="python, ncurses-utils" termux_step_make() { return } termux_step_make_install() { export PYTHONPATH=$TERMUX_PREFIX/lib/python3.8/site-packages/ python3.8 setup.py install --prefix=$TERMUX_PREFIX --force } termux_step_post_massage() { find . -path '*/__pycache__*' -delete } ================================================ FILE: packages/assimp/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://assimp.sourceforge.net/index.html TERMUX_PKG_DESCRIPTION="Library to import various well-known 3D model formats in an uniform manner" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=5.0.0 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/assimp/assimp/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=b0110a91650d6bb4000e3d5c2185bf77b0ff0a2e7a284bc2c4af81b33988b63c TERMUX_PKG_DEPENDS="boost, zlib" TERMUX_PKG_BREAKS="assimp-dev" TERMUX_PKG_REPLACES="assimp-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-DASSIMP_BUILD_SAMPLES=OFF" ================================================ FILE: packages/assimp/test-CMakeLists.txt.patch ================================================ diff -uNr assimp-4.1.0/test/CMakeLists.txt assimp-4.1.0.mod/test/CMakeLists.txt --- assimp-4.1.0/test/CMakeLists.txt 2017-12-11 15:22:45.000000000 +0200 +++ assimp-4.1.0.mod/test/CMakeLists.txt 2019-07-01 22:47:01.990765003 +0300 @@ -174,7 +174,7 @@ IF( WIN32 ) SET( platform_libs ) ELSE( WIN32 ) - SET( platform_libs pthread ) + SET( platform_libs ) ENDIF( WIN32 ) IF( WIN32 ) ================================================ FILE: packages/atomicparsley/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://bitbucket.org/wez/atomicparsley TERMUX_PKG_DESCRIPTION="Read, parse and set metadata of MPEG-4 and 3gp files" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=0.9.6 TERMUX_PKG_REVISION=5 TERMUX_PKG_SRCURL=https://bitbucket.org/wez/atomicparsley/get/${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SHA256=e28d46728be86219e6ce48695ea637d831ca0170ca6bdac99810996a8291ee50 TERMUX_PKG_DEPENDS="libc++, zlib" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_func_lroundf=yes" termux_step_pre_configure() { ./autogen.sh # Avoid the configure script from using g++ for linking: export OBJCXX=$CXX } ================================================ FILE: packages/attr/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://savannah.nongnu.org/projects/attr/ TERMUX_PKG_DESCRIPTION="Utilities for manipulating filesystem extended attributes" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.4.48 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=http://download.savannah.gnu.org/releases/attr/attr-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=5ead72b358ec709ed00bbf7a9eaef1654baad937c001c044fe8b74c57f5324e7 TERMUX_PKG_BREAKS="attr-dev" TERMUX_PKG_REPLACES="attr-dev" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-gettext=no" # TERMUX_PKG_MAKE_INSTALL_TARGET="install install-lib" # attr.5 man page is in linux-man-pages: TERMUX_PKG_RM_AFTER_INSTALL="share/man/man5/attr.5" ================================================ FILE: packages/attr/tools-attr.c.patch ================================================ diff -u -r ../attr-2.4.48/tools/attr.c ./tools/attr.c --- ../attr-2.4.48/tools/attr.c 2018-01-21 05:00:44.000000000 +0000 +++ ./tools/attr.c 2018-06-26 03:18:34.271455876 +0000 @@ -28,6 +28,7 @@ #include #include #include +#include /* for basename(3) */ #include ================================================ FILE: packages/attr/walk_tree.c.patch ================================================ diff -u -r ../attr-2.4.47/libmisc/walk_tree.c ./libmisc/walk_tree.c --- ../attr-2.4.47/libmisc/walk_tree.c 2013-05-19 00:53:54.000000000 -0400 +++ ./libmisc/walk_tree.c 2015-12-13 14:47:30.178955536 -0500 @@ -122,7 +122,11 @@ close_another_dir: /* Close the topmost directory handle still open. */ closed = closed->prev; +#ifdef __ANDROID__ + closed->pos = -1; +#else closed->pos = telldir(closed->stream); +#endif closedir(closed->stream); closed->stream = NULL; num_dir_handles++; @@ -188,7 +192,9 @@ if (!dir.stream) return err + func(path, NULL, flags | WALK_TREE_FAILED, arg); +#ifndef __ANDROID__ seekdir(dir.stream, dir.pos); +#endif closed = closed->next; num_dir_handles--; ================================================ FILE: packages/autoconf/General.pm.patch ================================================ diff -u -r ../autoconf-2.69/lib/Autom4te/General.pm ./lib/Autom4te/General.pm --- ../autoconf-2.69/lib/Autom4te/General.pm 2012-04-24 16:44:15.000000000 -0400 +++ ./lib/Autom4te/General.pm 2015-05-17 16:11:45.492445577 -0400 @@ -300,7 +300,7 @@ sub mktmpdir ($) { my ($signature) = @_; - my $TMPDIR = $ENV{'TMPDIR'} || '/tmp'; + my $TMPDIR = $ENV{'TMPDIR'} || '@TERMUX_PREFIX@/tmp'; my $quoted_tmpdir = shell_quote ($TMPDIR); # If mktemp supports dirs, use it. ================================================ FILE: packages/autoconf/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/autoconf/autoconf.html TERMUX_PKG_DESCRIPTION="Creator of shell scripts to configure source code packages" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=2.69 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/autoconf/autoconf-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=64ebcec9f8ac5b2487125a86a7760d2591ac9e1d3dbd59489633f9de62a57684 TERMUX_PKG_DEPENDS="m4, make, perl" TERMUX_PKG_PLATFORM_INDEPENDENT=true termux_step_post_extract_package() { perl -p -i -e "s|/bin/sh|$TERMUX_PREFIX/bin/sh|" lib/*/*.m4 } termux_step_post_massage() { perl -p -i -e "s|/usr/bin/m4|$TERMUX_PREFIX/bin/m4|" bin/* perl -p -i -e "s|CONFIG_SHELL-/bin/sh|CONFIG_SHELL-$TERMUX_PREFIX/bin/sh|" bin/autoconf } ================================================ FILE: packages/automake/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/automake/ TERMUX_PKG_DESCRIPTION="Tool for automatically generating Makefile.in files" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.16.1 TERMUX_PKG_SHA256=5d05bb38a23fd3312b10aea93840feec685bdf4a41146e78882848165d3ae921 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/automake/automake-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_DEPENDS="autoconf" TERMUX_PKG_PLATFORM_INDEPENDENT=true ================================================ FILE: packages/autossh/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.harding.motd.ca/autossh/ TERMUX_PKG_DESCRIPTION="Automatically restart SSH sessions and tunnels" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_VERSION=1.4g TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=83766463763364a1be56d6bf1a75b40a59302586645bf0c4fa885188cf01ebfc TERMUX_PKG_SRCURL=https://fossies.org/linux/privat/autossh-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_DEPENDS="openssh | dropbear" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--mandir=$TERMUX_PREFIX/share/man ac_cv_path_ssh=$TERMUX_PREFIX/bin/ssh" termux_step_pre_configure() { # For syslog logging: export LIBS="-llog" } ================================================ FILE: packages/axel/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/axel-download-accelerator/axel TERMUX_PKG_DESCRIPTION="light command line download accelerator" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="lokesh @hax4us" TERMUX_PKG_VERSION=2.17.6 TERMUX_PKG_SRCURL=https://github.com/axel-download-accelerator/axel/releases/download/v${TERMUX_PKG_VERSION}/axel-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=15be4803789d8a3b0aa7ea9629a21ea56ff46ea5d8b484004a00826d4ffcbd00 TERMUX_PKG_DEPENDS="openssl" ================================================ FILE: packages/babl/babl-meson.build.patch ================================================ diff -u -r ../babl-0.1.70/babl/meson.build ./babl/meson.build --- ../babl-0.1.70/babl/meson.build 2019-08-02 16:16:52.000000000 +0000 +++ ./babl/meson.build 2019-08-08 09:55:50.648892290 +0000 @@ -128,7 +128,7 @@ c_args: babl_c_args, link_whole: [ babl_base, ], link_args: [ babl_link_args, ], - dependencies: [ math, thread, dl, lcms, ], + dependencies: [ math, thread, dl, lcms, log, ], link_depends: [ version_script_target, ], version: so_version, install: true, ================================================ FILE: packages/babl/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://gegl.org/babl/ TERMUX_PKG_DESCRIPTION="Dynamic pixel format translation library" TERMUX_PKG_LICENSE="LGPL-3.0" TERMUX_PKG_VERSION=0.1.72 TERMUX_PKG_SRCURL=https://download.gimp.org/pub/babl/0.1/babl-$TERMUX_PKG_VERSION.tar.xz TERMUX_PKG_SHA256=64e111097b1fa22f6c9bf044e341a9cd9ee1372c5acfa0b452e7a86fb37c6a42 TERMUX_PKG_DEPENDS="littlecms" TERMUX_PKG_BREAKS="babl-dev" TERMUX_PKG_REPLACES="babl-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-Denable-gir=false" ================================================ FILE: packages/babl/tests-meson.build.patch ================================================ diff -u -r ../babl-0.1.70/tests/meson.build ./tests/meson.build --- ../babl-0.1.70/tests/meson.build 2019-08-02 16:16:52.000000000 +0000 +++ ./tests/meson.build 2019-08-08 09:58:14.015259147 +0000 @@ -41,7 +41,7 @@ test_name + '.c', include_directories: [ rootInclude, bablInclude, ], link_with: [ babl, ], - dependencies: [ thread, ], + dependencies: [ thread, log, ], export_dynamic: true, install: false, ) ================================================ FILE: packages/babl/tools-meson.build.patch ================================================ diff -u -r ../babl-0.1.70/tools/meson.build ./tools/meson.build --- ../babl-0.1.70/tools/meson.build 2019-08-02 16:16:52.000000000 +0000 +++ ./tools/meson.build 2019-08-08 09:59:07.362648769 +0000 @@ -17,7 +17,7 @@ tool_name + '.c', include_directories: [ rootInclude, bablInclude, ], link_with: [ babl, ], - dependencies: [ math, thread, ], + dependencies: [ math, thread, log, ], install: false, ) ================================================ FILE: packages/barcode/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/barcode/ TERMUX_PKG_DESCRIPTION="Tool to convert text strings to printed bars" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.99 TERMUX_PKG_REVISION=3 TERMUX_PKG_SRCURL=http://mirrors.kernel.org/gnu/barcode/barcode-$TERMUX_PKG_VERSION.tar.xz TERMUX_PKG_SHA256=e87ecf6421573e17ce35879db8328617795258650831affd025fba42f155cdc6 TERMUX_PKG_BUILD_DEPENDS="gettext" termux_step_pre_configure() { CPPFLAGS+=" -I$TERMUX_PREFIX/share/gettext" } ================================================ FILE: packages/bash/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/bash/ TERMUX_PKG_DESCRIPTION="A sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh)" TERMUX_PKG_LICENSE="GPL-3.0" _MAIN_VERSION=5.0 _PATCH_VERSION=11 TERMUX_PKG_VERSION=${_MAIN_VERSION}.${_PATCH_VERSION} TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/bash/bash-${_MAIN_VERSION}.tar.gz TERMUX_PKG_SHA256=b4a80f2ac66170b2913efbfb9f2594f1f76c7b1afd11f799e22035d63077fb4d TERMUX_PKG_DEPENDS="libandroid-support, libiconv, ncurses, readline (>= 8.0), termux-tools" TERMUX_PKG_RECOMMENDS="command-not-found" TERMUX_PKG_BREAKS="bash-dev" TERMUX_PKG_REPLACES="bash-dev" TERMUX_PKG_ESSENTIAL=true TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-multibyte --without-bash-malloc --with-installed-readline" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" bash_cv_job_control_missing=present" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" bash_cv_sys_siglist=yes" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" bash_cv_func_sigsetjmp=present" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" bash_cv_unusable_rtsigs=no" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_mbsnrtowcs=no" # Use bash_cv_dev_fd=whacky to use /proc/self/fd instead of /dev/fd. # After making this change process substitution such as in 'cat <(ls)' works. TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" bash_cv_dev_fd=whacky" # Bash assumes that getcwd is broken and provides a wrapper which # does not work when not all parent directories up to root are # accessible, which they are not under Android (/data). See # - http://permalink.gmane.org/gmane.linux.embedded.yocto.general/25204 # - https://github.com/termux/termux-app/issues/200 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" bash_cv_getcwd_malloc=yes" TERMUX_PKG_CONFFILES="etc/bash.bashrc etc/profile" TERMUX_PKG_RM_AFTER_INSTALL="share/man/man1/bashbug.1 bin/bashbug" termux_step_pre_configure() { declare -A PATCH_CHECKSUMS PATCH_CHECKSUMS[001]=f2fe9e1f0faddf14ab9bfa88d450a75e5d028fedafad23b88716bd657c737289 PATCH_CHECKSUMS[002]=87e87d3542e598799adb3e7e01c8165bc743e136a400ed0de015845f7ff68707 PATCH_CHECKSUMS[003]=4eebcdc37b13793a232c5f2f498a5fcbf7da0ecb3da2059391c096db620ec85b PATCH_CHECKSUMS[004]=14447ad832add8ecfafdce5384badd933697b559c4688d6b9e3d36ff36c62f08 PATCH_CHECKSUMS[005]=5bf54dd9bd2c211d2bfb34a49e2c741f2ed5e338767e9ce9f4d41254bf9f8276 PATCH_CHECKSUMS[006]=d68529a6ff201b6ff5915318ab12fc16b8a0ebb77fda3308303fcc1e13398420 PATCH_CHECKSUMS[007]=17b41e7ee3673d8887dd25992417a398677533ab8827938aa41fad70df19af9b PATCH_CHECKSUMS[008]=eec64588622a82a5029b2776e218a75a3640bef4953f09d6ee1f4199670ad7e3 PATCH_CHECKSUMS[009]=ed3ca21767303fc3de93934aa524c2e920787c506b601cc40a4897d4b094d903 PATCH_CHECKSUMS[010]=d6fbc325f0b5dc54ddbe8ee43020bced8bd589ddffea59d128db14b2e52a8a11 PATCH_CHECKSUMS[011]=2c4de332b91eaf797abbbd6c79709690b5cbd48b12e8dfe748096dbd7bf474ea for PATCH_NUM in $(seq -f '%03g' ${_PATCH_VERSION}); do PATCHFILE=$TERMUX_PKG_CACHEDIR/bash_patch_${PATCH_NUM}.patch termux_download \ "https://mirrors.kernel.org/gnu/bash/bash-${_MAIN_VERSION}-patches/bash${_MAIN_VERSION/./}-$PATCH_NUM" \ $PATCHFILE \ ${PATCH_CHECKSUMS[$PATCH_NUM]} patch -p0 -i $PATCHFILE done unset PATCH_CHECKSUMS PATCHFILE PATCH_NUM } termux_step_post_make_install() { sed -e "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|" \ -e "s|@TERMUX_HOME@|$TERMUX_ANDROID_HOME|" \ $TERMUX_PKG_BUILDER_DIR/etc-profile > $TERMUX_PREFIX/etc/profile # /etc/bash.bashrc - System-wide .bashrc file for interactive shells. (config-top.h in bash source, patched to enable): sed -e "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|" \ -e "s|@TERMUX_HOME@|$TERMUX_ANDROID_HOME|" \ $TERMUX_PKG_BUILDER_DIR/etc-bash.bashrc > $TERMUX_PREFIX/etc/bash.bashrc } ================================================ FILE: packages/bash/config-top.h.patch ================================================ diff -uNr bash-5.0/config-top.h bash-5.0.mod/config-top.h --- bash-5.0/config-top.h 2018-10-12 22:35:23.000000000 +0300 +++ bash-5.0.mod/config-top.h 2019-02-20 14:15:53.266802311 +0200 @@ -63,7 +63,7 @@ /* The default value of the PATH variable. */ #ifndef DEFAULT_PATH_VALUE #define DEFAULT_PATH_VALUE \ - "/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:." + "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets:." #endif /* If you want to unconditionally set a value for PATH in every restricted @@ -74,7 +74,7 @@ the Posix.2 confstr () function, or CS_PATH define are not present. */ #ifndef STANDARD_UTILS_PATH #define STANDARD_UTILS_PATH \ - "/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc" + "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets" #endif /* Default primary and secondary prompt strings. */ @@ -91,7 +91,7 @@ #define DEFAULT_BASHRC "~/.bashrc" /* System-wide .bashrc file for interactive shells. */ -/* #define SYS_BASHRC "/etc/bash.bashrc" */ +#define SYS_BASHRC "@TERMUX_PREFIX@/etc/bash.bashrc" /* System-wide .bash_logout for login shells. */ /* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */ ================================================ FILE: packages/bash/error.c.patch ================================================ diff -uNr bash-5.0/error.c bash-5.0.mod/error.c --- bash-5.0/error.c 2018-10-08 22:16:07.000000000 +0300 +++ bash-5.0.mod/error.c 2019-02-20 14:19:39.265261705 +0200 @@ -430,7 +430,7 @@ static FILE *tracefp = (FILE *)NULL; if (tracefp == NULL) - tracefp = fopen("/tmp/bash-trace.log", "a+"); + tracefp = fopen("@TERMUX_PREFIX@/tmp/bash-trace.log", "a+"); if (tracefp == NULL) tracefp = stderr; ================================================ FILE: packages/bash/etc-bash.bashrc ================================================ if [ -x @TERMUX_PREFIX@/libexec/termux/command-not-found ]; then command_not_found_handle() { @TERMUX_PREFIX@/libexec/termux/command-not-found "$1" } fi PS1='\$ ' ================================================ FILE: packages/bash/etc-profile ================================================ for i in @TERMUX_PREFIX@/etc/profile.d/*.sh; do if [ -r $i ]; then . $i fi done unset i # Source etc/bash.bashrc and ~/.bashrc also for interactive bash login shells: if [ "$BASH" ]; then if [[ "$-" == *"i"* ]]; then if [ -r @TERMUX_PREFIX@/etc/bash.bashrc ]; then . @TERMUX_PREFIX@/etc/bash.bashrc fi if [ -r @TERMUX_HOME@/.bashrc ]; then . @TERMUX_HOME@/.bashrc fi fi fi ================================================ FILE: packages/bash/lib-malloc-stats.c.patch ================================================ diff -uNr bash-5.0/lib/malloc/stats.c bash-5.0.mod/lib/malloc/stats.c --- bash-5.0/lib/malloc/stats.c 2018-06-19 22:24:52.000000000 +0300 +++ bash-5.0.mod/lib/malloc/stats.c 2019-02-20 14:17:52.094412438 +0200 @@ -142,7 +142,7 @@ _print_malloc_stats (s, fp); } -#define TRACEROOT "/var/tmp/maltrace/stats." +#define TRACEROOT "@TERMUX_PREFIX@/var/tmp/maltrace/stats." void trace_malloc_stats (s, fn) ================================================ FILE: packages/bash/lib-malloc-table.c.patch ================================================ diff -uNr bash-5.0/lib/malloc/table.c bash-5.0.mod/lib/malloc/table.c --- bash-5.0/lib/malloc/table.c 2016-01-15 15:47:26.000000000 +0200 +++ bash-5.0.mod/lib/malloc/table.c 2019-02-20 14:18:05.854521552 +0200 @@ -390,7 +390,7 @@ _location_dump_table (stderr); } -#define LOCROOT "/var/tmp/maltrace/locations." +#define LOCROOT "@TERMUX_PREFIX@/var/tmp/maltrace/locations." void mlocation_write_table () ================================================ FILE: packages/bash/lib-malloc-trace.c.patch ================================================ diff -uNr bash-5.0/lib/malloc/trace.c bash-5.0.mod/lib/malloc/trace.c --- bash-5.0/lib/malloc/trace.c 2016-01-15 15:48:23.000000000 +0200 +++ bash-5.0.mod/lib/malloc/trace.c 2019-02-20 14:17:59.184468664 +0200 @@ -108,7 +108,7 @@ #endif } -#define TRACEROOT "/var/tmp/maltrace/trace." +#define TRACEROOT "@TERMUX_PREFIX@/var/tmp/maltrace/trace." void malloc_set_tracefn (s, fn) ================================================ FILE: packages/bash/lib-readline-complete.c.patch ================================================ diff -uNr bash-5.0/lib/readline/complete.c bash-5.0.mod/lib/readline/complete.c --- bash-5.0/lib/readline/complete.c 2017-07-05 02:43:20.000000000 +0300 +++ bash-5.0.mod/lib/readline/complete.c 2019-02-20 14:15:49.683440481 +0200 @@ -2231,7 +2231,7 @@ char * rl_username_completion_function (const char *text, int state) { -#if defined (__WIN32__) || defined (__OPENNT) +#if defined (__WIN32__) || defined (__OPENNT) || defined (__ANDROID__) return (char *)NULL; #else /* !__WIN32__ && !__OPENNT) */ static char *username = (char *)NULL; ================================================ FILE: packages/bash/lib-readline-rlconf.h.patch ================================================ diff -uNr bash-5.0/lib/readline/rlconf.h bash-5.0.mod/lib/readline/rlconf.h --- bash-5.0/lib/readline/rlconf.h 2017-02-21 17:25:30.000000000 +0200 +++ bash-5.0.mod/lib/readline/rlconf.h 2019-02-20 14:16:17.230326111 +0200 @@ -43,7 +43,7 @@ #define DEFAULT_INPUTRC "~/.inputrc" /* The ultimate last-ditch filename for an init file -- system-wide. */ -#define SYS_INPUTRC "/etc/inputrc" +#define SYS_INPUTRC "@TERMUX_PREFIX@/etc/inputrc" /* If defined, expand tabs to spaces. */ #define DISPLAY_TABS ================================================ FILE: packages/bash/lib-readline-util.c.patch ================================================ diff -uNr bash-5.0/lib/readline/util.c bash-5.0.mod/lib/readline/util.c --- bash-5.0/lib/readline/util.c 2017-06-15 23:27:17.000000000 +0300 +++ bash-5.0.mod/lib/readline/util.c 2019-02-20 14:18:24.271334221 +0200 @@ -506,7 +506,7 @@ if (x == 0) x = "."; #else - x = "/var/tmp"; + x = "@TERMUX_PREFIX@/var/tmp"; #endif snprintf (fnbuf, sizeof (fnbuf), "%s/rltrace.%ld", x, (long)getpid()); unlink(fnbuf); ================================================ FILE: packages/bash/lib-sh-tmpfile.c.patch ================================================ diff -uNr bash-5.0/lib/sh/tmpfile.c bash-5.0.mod/lib/sh/tmpfile.c --- bash-5.0/lib/sh/tmpfile.c 2016-08-11 18:05:58.000000000 +0300 +++ bash-5.0.mod/lib/sh/tmpfile.c 2019-02-20 14:17:08.270731426 +0200 @@ -74,15 +74,11 @@ return sys_tmpdir; #endif - sys_tmpdir = "/tmp"; + sys_tmpdir = "@TERMUX_PREFIX@/tmp"; if (file_iswdir (sys_tmpdir)) return sys_tmpdir; - sys_tmpdir = "/var/tmp"; - if (file_iswdir (sys_tmpdir)) - return sys_tmpdir; - - sys_tmpdir = "/usr/tmp"; + sys_tmpdir = "@TERMUX_PREFIX@/var/tmp"; if (file_iswdir (sys_tmpdir)) return sys_tmpdir; ================================================ FILE: packages/bash/pathnames.h.in.patch ================================================ diff -uNr bash-5.0/pathnames.h.in bash-5.0.mod/pathnames.h.in --- bash-5.0/pathnames.h.in 2009-01-04 21:32:40.000000000 +0200 +++ bash-5.0.mod/pathnames.h.in 2019-02-20 14:15:56.880164371 +0200 @@ -22,10 +22,10 @@ #define _PATHNAMES_H_ /* The default file for hostname completion. */ -#define DEFAULT_HOSTS_FILE "/etc/hosts" +#define DEFAULT_HOSTS_FILE "@TERMUX_PREFIX@/etc/hosts" /* The default login shell startup file. */ -#define SYS_PROFILE "/etc/profile" +#define SYS_PROFILE "@TERMUX_PREFIX@/etc/profile" /* The default location of the bash debugger initialization/startup file. */ #define DEBUGGER_START_FILE "@DEBUGGER_START_FILE@" ================================================ FILE: packages/bash/shell.c.patch ================================================ diff -uNr bash-5.0/shell.c bash-5.0.mod/shell.c --- bash-5.0/shell.c 2018-12-06 18:28:21.000000000 +0200 +++ bash-5.0.mod/shell.c 2019-02-20 14:19:29.808520144 +0200 @@ -339,12 +339,12 @@ { struct stat sb; - if (stat ("/tmp", &sb) < 0) - internal_warning (_("could not find /tmp, please create!")); + if (stat ("@TERMUX_PREFIX@/tmp", &sb) < 0) + internal_warning (_("could not find @TERMUX_PREFIX@/tmp, please create!")); else { if (S_ISDIR (sb.st_mode) == 0) - internal_warning (_("/tmp must be a valid directory name")); + internal_warning (_("@TERMUX_PREFIX@/tmp must be a valid directory name")); } } #endif /* __CYGWIN__ */ ================================================ FILE: packages/bash-completion/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/scop/bash-completion TERMUX_PKG_DESCRIPTION="Programmable completion for the bash shell" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.10 TERMUX_PKG_SHA256=123c17998e34b937ce57bb1b111cd817bc369309e9a8047c0bcf06ead4a3ec92 TERMUX_PKG_SRCURL=https://github.com/scop/bash-completion/releases/download/${TERMUX_PKG_VERSION}/bash-completion-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_DEPENDS="bash" TERMUX_PKG_PLATFORM_INDEPENDENT=true ================================================ FILE: packages/bash-completion/completions-man.patch ================================================ diff -uNr bash-completion-2.9/completions/man bash-completion-2.9.mod/completions/man --- bash-completion-2.9/completions/man 2019-04-27 11:54:49.000000000 +0300 +++ bash-completion-2.9.mod/completions/man 2019-05-02 15:36:06.454990217 +0300 @@ -51,8 +51,7 @@ return fi - local manpath=$(manpath 2>/dev/null || command man -w 2>/dev/null) - [[ -z $manpath ]] && manpath="/usr/share/man:/usr/local/share/man" + local manpath="@TERMUX_PREFIX@/share/man" # determine manual section to search local sect ================================================ FILE: packages/bat/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/sharkdp/bat TERMUX_PKG_DESCRIPTION="A cat(1) clone with wings" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_VERSION=0.12.1 TERMUX_PKG_SHA256=1dd184ddc9e5228ba94d19afc0b8b440bfc1819fef8133fe331e2c0ec9e3f8e2 TERMUX_PKG_SRCURL=https://github.com/sharkdp/bat/archive/v$TERMUX_PKG_VERSION.tar.gz # bat calls less with '--RAW-CONTROL-CHARS' which busybox less does not support: TERMUX_PKG_DEPENDS="less, zlib" TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { CFLAGS="$CFLAGS $CPPFLAGS" # See https://github.com/nagisa/rust_libloading/issues/54 export CC_x86_64_unknown_linux_gnu=gcc export CFLAGS_x86_64_unknown_linux_gnu="" } termux_step_post_make_install() { mkdir -p $TERMUX_PREFIX/share/man/man1 cp $TERMUX_PKG_SRCDIR/doc/bat.1 $TERMUX_PREFIX/share/man/man1/ } ================================================ FILE: packages/bc/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/bc/ TERMUX_PKG_DESCRIPTION="Arbitrary precision numeric processing language" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.07.1 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/bc/bc-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=62adfca89b0a1c0164c2cdca59ca210c1d44c3ffc46daf9931cf4942664cb02a TERMUX_PKG_DEPENDS="readline,flex" TERMUX_PKG_HOSTBUILD=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --infodir=$TERMUX_PREFIX/share/info --mandir=$TERMUX_PREFIX/share/man --with-readline " termux_step_pre_configure() { cp $TERMUX_PKG_HOSTBUILD_DIR/bc/libmath.h \ $TERMUX_PKG_SRCDIR/bc/libmath.h touch -d "next hour" $TERMUX_PKG_SRCDIR/bc/libmath.h } ================================================ FILE: packages/beanshell/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/beanshell/beanshell TERMUX_PKG_DESCRIPTION="Small, free, embeddable, source level Java interpreter with object based scripting language features written in Java" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=2.0b6 TERMUX_PKG_REVISION=4 TERMUX_PKG_SRCURL=https://github.com/beanshell/beanshell/releases/download/$TERMUX_PKG_VERSION/bsh-$TERMUX_PKG_VERSION.jar TERMUX_PKG_SHA256=a17955976070c0573235ee662f2794a78082758b61accffce8d3f8aedcd91047 TERMUX_PKG_DEPENDS="dash, termux-tools" TERMUX_PKG_SKIP_SRC_EXTRACT=true TERMUX_PKG_PLATFORM_INDEPENDENT=true TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { termux_download \ "$TERMUX_PKG_SRCURL" \ "$TERMUX_PKG_CACHEDIR/bsh-$TERMUX_PKG_VERSION.jar" \ "$TERMUX_PKG_SHA256" } termux_step_make() { "$ANDROID_HOME/build-tools/${TERMUX_ANDROID_BUILD_TOOLS_VERSION}/dx" \ --dex --output=beanshell.jar "$TERMUX_PKG_CACHEDIR/bsh-$TERMUX_PKG_VERSION.jar" } termux_step_make_install() { install -Dm600 beanshell.jar "$TERMUX_PREFIX/share/dex/beanshell.jar" { echo "#!$TERMUX_PREFIX/bin/sh" echo "dalvikvm -cp $TERMUX_PREFIX/share/dex/beanshell.jar bsh.Interpreter \"\$@\"" } > "$TERMUX_PREFIX"/bin/beanshell chmod 700 "$TERMUX_PREFIX"/bin/beanshell ln -sfr "$TERMUX_PREFIX"/bin/beanshell "$TERMUX_PREFIX"/bin/bsh } ================================================ FILE: packages/binutils/binutils-gold.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="bin/ld.gold bin/gold" TERMUX_SUBPKG_DESCRIPTION="gold linker" ================================================ FILE: packages/binutils/binutils.patch ================================================ diff -u -r ../binutils-2.24/bfd/archive.c ./bfd/archive.c --- ../binutils-2.24/bfd/archive.c 2013-11-04 16:33:37.000000000 +0100 +++ ./bfd/archive.c 2014-01-01 14:44:49.000000000 +0100 @@ -1880,7 +1880,8 @@ { /* Assume we just "made" the member, and fake it. */ struct bfd_in_memory *bim = (struct bfd_in_memory *) member->iostream; - time (&status.st_mtime); + /* termux diff: explicit cast */ + time ((time_t*) &status.st_mtime); status.st_uid = getuid (); status.st_gid = getgid (); status.st_mode = 0644; ================================================ FILE: packages/binutils/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/binutils/ TERMUX_PKG_DESCRIPTION="Collection of binary tools, the main ones being ld, the GNU linker, and as, the GNU assembler" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.33.1 TERMUX_PKG_SHA256=98aba5f673280451a09df3a8d8eddb3aa0c505ac183f1e2f9d00c67aa04c6f7d TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/binutils/binutils-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="libc++, zlib" TERMUX_PKG_BREAKS="binutils-dev" TERMUX_PKG_REPLACES="binutils-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-gold --enable-plugins --disable-werror --with-system-zlib --enable-new-dtags" TERMUX_PKG_EXTRA_MAKE_ARGS="tooldir=$TERMUX_PREFIX" TERMUX_PKG_RM_AFTER_INSTALL="share/man/man1/windmc.1 share/man/man1/windres.1 bin/ld.bfd" TERMUX_PKG_NO_STATICSPLIT=true TERMUX_PKG_HAS_DEBUG=false # Debug build fails with: # ~/termux-build/binutils/src/binutils/readelf.c:19060:81: error: in call to 'fread', size * count is too large for the given buffer # if (fread (ehdr32.e_type, sizeof (ehdr32) - EI_NIDENT, 1, filedata->handle) != 1) # ^ # ~/termux-build/_cache/19b-aarch64-24-v5/bin/../sysroot/usr/include/bits/fortify/stdio.h:107:9: note: from 'diagnose_if' attribute on 'fread': # __clang_error_if(__bos(buf) != __BIONIC_FORTIFY_UNKNOWN_SIZE && size * count > __bos(buf), # ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~/termux-build/_cache/19b-aarch64-24-v5/bin/../sysroot/usr/include/sys/cdefs.h:163:52: note: expanded from macro '__clang_error_if' # #define __clang_error_if(cond, msg) __attribute__((diagnose_if(cond, msg, "error"))) # ^ ~~~~ # Avoid linking against libfl.so from flex if available: export LEXLIB= termux_step_pre_configure() { export CPPFLAGS="$CPPFLAGS -Wno-c++11-narrowing" if [ $TERMUX_ARCH_BITS = 32 ]; then export LIB_PATH="${TERMUX_PREFIX}/lib:/system/lib" else export LIB_PATH="${TERMUX_PREFIX}/lib:/system/lib64" fi } termux_step_post_make_install() { cp $TERMUX_PKG_BUILDER_DIR/ldd $TERMUX_PREFIX/bin/ldd cd $TERMUX_PREFIX/bin # Setup symlinks as these are used when building, so used by # system setup in e.g. python, perl and libtool: for b in ar ld nm objdump ranlib readelf strip; do ln -s -f $b $TERMUX_HOST_PLATFORM-$b done ln -sf ld.gold gold } ================================================ FILE: packages/binutils/dirsearch.cc.patch ================================================ --- ../cache/binutils-2.30/gold/dirsearch.cc 2018-01-13 13:31:16.000000000 +0000 +++ ./gold/dirsearch.cc 2018-07-04 01:41:01.695893401 +0000 @@ -69,7 +69,7 @@ { // We ignore directories which do not exist or are actually file // names. - if (errno != ENOENT && errno != ENOTDIR) + if (errno != ENOENT && errno != ENOTDIR && errno != EACCES ) gold::gold_error(_("%s: can not read directory: %s"), this->dirname_, strerror(errno)); return; ================================================ FILE: packages/binutils/ld-emultempl-elf32.em.patch ================================================ diff -u -r ../binutils-2.26/ld/emultempl/elf32.em ./ld/emultempl/elf32.em --- ../binutils-2.26/ld/emultempl/elf32.em 2015-11-13 03:27:42.000000000 -0500 +++ ./ld/emultempl/elf32.em 2016-01-28 10:20:11.534910516 -0500 @@ -115,8 +115,13 @@ static void gld${EMULATION_NAME}_after_parse (void) { +#ifndef __ANDROID__ + /* The Android linker does not support DF_1_PIE: + 'unsupported flags DT_FLAGS_1=0x8000000' + from linker.cpp (see "case DT_FLAGS_1" there. */ if (bfd_link_pie (&link_info)) link_info.flags_1 |= (bfd_vma) DF_1_PIE; +#endif after_parse_default (); } ================================================ FILE: packages/binutils/ldd ================================================ #!/bin/sh objdump -p $@ | grep NEEDED | cut -d ' ' -f 18 ================================================ FILE: packages/binutils/native_lib_dirs.patch32 ================================================ diff -r -u ../binutils-2.24/ld/configure.tgt ./ld/configure.tgt --- ../binutils-2.24/ld/configure.tgt 2013-11-26 12:37:33.000000000 +0100 +++ ./ld/configure.tgt 2014-02-12 18:06:26.000000000 +0100 @@ -769,7 +769,7 @@ esac -NATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib' +NATIVE_LIB_DIRS='/system/lib' case "${target}" in *-*-dragonfly*) ================================================ FILE: packages/binutils/native_lib_dirs.patch64 ================================================ diff -r -u ../binutils-2.24/ld/configure.tgt ./ld/configure.tgt --- ../binutils-2.24/ld/configure.tgt 2013-11-26 12:37:33.000000000 +0100 +++ ./ld/configure.tgt 2014-02-12 18:06:26.000000000 +0100 @@ -769,7 +769,7 @@ esac -NATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib' +NATIVE_LIB_DIRS='/system/lib64' case "${target}" in *-*-dragonfly*) ================================================ FILE: packages/binutils/options.cc.patch32 ================================================ --- ../cache/binutils-2.30/gold/options.cc 2018-01-13 13:31:16.000000000 +0000 +++ ./gold/options.cc 2018-03-11 23:17:59.326121534 +0000 @@ -1227,8 +1227,8 @@ || this->user_set_sysroot() || *TARGET_SYSTEM_ROOT != '\0') { - this->add_to_library_path_with_sysroot("/lib"); - this->add_to_library_path_with_sysroot("/usr/lib"); + this->add_to_library_path_with_sysroot("@TERMUX_PREFIX@/lib"); + this->add_to_library_path_with_sysroot("/system/lib"); } else this->add_to_library_path_with_sysroot(TOOLLIBDIR); ================================================ FILE: packages/binutils/options.cc.patch64 ================================================ --- ../cache/binutils-2.30/gold/options.cc 2018-01-13 13:31:16.000000000 +0000 +++ ./gold/options.cc 2018-03-11 23:20:26.295331766 +0000 @@ -1227,8 +1227,8 @@ || this->user_set_sysroot() || *TARGET_SYSTEM_ROOT != '\0') { - this->add_to_library_path_with_sysroot("/lib"); - this->add_to_library_path_with_sysroot("/usr/lib"); + this->add_to_library_path_with_sysroot("@TERMUX_PREFIX@/lib"); + this->add_to_library_path_with_sysroot("/system/lib64"); } else this->add_to_library_path_with_sysroot(TOOLLIBDIR); ================================================ FILE: packages/bison/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/bison/ TERMUX_PKG_DESCRIPTION="General-purpose parser generator" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=3.4.2 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/bison/bison-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=27d05534699735dc69e86add5b808d6cb35900ad3fd63fa82e3eb644336abfa0 TERMUX_PKG_DEPENDS="m4" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" M4=m4 ac_cv_header_spawn_h=no " ================================================ FILE: packages/bitcoin/0001-android-patches.patch ================================================ diff --git i/depends/hosts/default.mk w/depends/hosts/default.mk index 144e5f88b..4d3c527de 100644 --- i/depends/hosts/default.mk +++ w/depends/hosts/default.mk @@ -2,8 +2,8 @@ ifneq ($(host),$(build)) host_toolchain:=$(host)- endif -default_host_CC = $(host_toolchain)gcc -default_host_CXX = $(host_toolchain)g++ +default_host_CC = $(CC) +default_host_CXX = $(CXX) default_host_AR = $(host_toolchain)ar default_host_RANLIB = $(host_toolchain)ranlib default_host_STRIP = $(host_toolchain)strip diff --git i/depends/hosts/linux.mk w/depends/hosts/linux.mk index b13a0f1ad..838db8537 100644 --- i/depends/hosts/linux.mk +++ w/depends/hosts/linux.mk @@ -10,19 +10,19 @@ linux_debug_CXXFLAGS=$(linux_debug_CFLAGS) linux_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC ifeq (86,$(findstring 86,$(build_arch))) -i686_linux_CC=gcc -m32 -i686_linux_CXX=g++ -m32 -i686_linux_AR=ar -i686_linux_RANLIB=ranlib -i686_linux_NM=nm -i686_linux_STRIP=strip +i686_linux_CC=$(default_host_CC) -m32 +i686_linux_CXX=$(default_host_CXX) -m32 +i686_linux_AR=$(default_host_AR) +i686_linux_RANLIB=$(default_host_RANLIB) +i686_linux_NM=$(default_host_NM) +i686_linux_STRIP=$(default_host_STRIP) -x86_64_linux_CC=gcc -m64 -x86_64_linux_CXX=g++ -m64 -x86_64_linux_AR=ar -x86_64_linux_RANLIB=ranlib -x86_64_linux_NM=nm -x86_64_linux_STRIP=strip +x86_64_linux_CC=$(default_host_CC) -m64 +x86_64_linux_CXX=$(default_host_CXX) -m64 +x86_64_linux_AR=$(default_host_AR) +x86_64_linux_RANLIB=$(default_host_RANLIB) +x86_64_linux_NM=$(default_host_NM) +x86_64_linux_STRIP=$(default_host_STRIP) else i686_linux_CC=$(default_host_CC) -m32 i686_linux_CXX=$(default_host_CXX) -m32 ================================================ FILE: packages/bitcoin/build-aux-m4-ax_boost_thread.m4.patch ================================================ diff -u -r ../bitcoin-0.19.0.1/build-aux/m4/ax_boost_thread.m4 ./build-aux/m4/ax_boost_thread.m4 --- ../bitcoin-0.19.0.1/build-aux/m4/ax_boost_thread.m4 2019-11-18 09:46:57.000000000 +0000 +++ ./build-aux/m4/ax_boost_thread.m4 2019-11-27 23:27:32.657357728 +0000 @@ -149,7 +149,7 @@ break; ;; * ) - BOOST_THREAD_LIB="$BOOST_THREAD_LIB -lpthread" + BOOST_THREAD_LIB="$BOOST_THREAD_LIB" break; ;; esac ================================================ FILE: packages/bitcoin/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://bitcoincore.org/ TERMUX_PKG_DESCRIPTION="Bitcoin Core" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=0.19.0.1 TERMUX_PKG_SRCURL=https://github.com/bitcoin/bitcoin/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=1a72f583f7448b3808d84ed7f8d8eb224f44b51291fee774bb9cecbd4fcbaec7 TERMUX_PKG_DEPENDS="boost, libevent, libzmq, miniupnpc, openssl" TERMUX_PKG_CONFFILES="var/service/bitcoind/run var/service/bitcoind/log/run" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-tests --with-daemon --with-boost-chrono=boost_chrono --with-boost-filesystem=boost_filesystem --with-boost-system=boost_system --with-boost-thread=boost_thread --with-gui=no --with-miniupnpc --without-libs " termux_step_pre_configure() { local db_version=4.8.30 local db_install_dir=$TERMUX_PKG_BUILDDIR/db-install local db_build_dir=$TERMUX_PKG_BUILDDIR/db-build termux_download https://download.oracle.com/berkeley-db/db-${db_version}.tar.gz \ $TERMUX_PKG_CACHEDIR/db-${db_version}.tar.gz \ e0491a07cdb21fb9aa82773bbbedaeb7639cbd0e7f96147ab46141e0045db72a tar xf $TERMUX_PKG_CACHEDIR/db-${db_version}.tar.gz cd $TERMUX_PKG_BUILDDIR/db-${db_version} sed -i.old 's/__atomic_compare_exchange/__atomic_compare_exchange_db/' \ dbinc/atomic.h sed -i.old 's/atomic_init/atomic_init_db/' dbinc/atomic.h mp/mp_region.c \ mp/mp_mvcc.c mp/mp_fget.c mutex/mut_method.c mutex/mut_tas.c termux_step_replace_guess_scripts mkdir -p ${db_build_dir} cd ${db_build_dir} ../db-${db_version}/dist/configure \ --host=$TERMUX_HOST_PLATFORM --prefix=${db_install_dir} \ --disable-shared --enable-static --enable-hash --enable-smallbuild \ --enable-compat185 --enable-cxx db_cv_atomic=gcc-builtin make -j $TERMUX_MAKE_PROCESSES make install_lib install_include cd $TERMUX_PKG_BUILDDIR export BDB_CFLAGS="-I${db_install_dir}/include -DHAVE_CXX_STDHEADERS=1" export BDB_LIBS="-L${db_install_dir}/lib -ldb_cxx" ./autogen.sh } termux_step_post_make_install() { mkdir -p $TERMUX_PREFIX/var/service cd $TERMUX_PREFIX/var/service mkdir -p bitcoind/log echo "#!$TERMUX_PREFIX/bin/sh" > bitcoind/run echo 'exec bitcoind 2>&1' >> bitcoind/run chmod +x bitcoind/run touch bitcoind/down ln -sf $TERMUX_PREFIX/share/termux-services/svlogger bitcoind/log/run } ================================================ FILE: packages/blogc/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://blogc.rgm.io/ TERMUX_PKG_DESCRIPTION="A blog compiler" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_MAINTAINER="Rafael Martins @rafaelmartins" TERMUX_PKG_VERSION=0.18.0 TERMUX_PKG_SHA256=c414625ee67b9b8e48bcc22b9f2463bf44368db4802200d798d55d7e176a1675 TERMUX_PKG_SRCURL=https://github.com/blogc/blogc/releases/download/v$TERMUX_PKG_VERSION/blogc-$TERMUX_PKG_VERSION.tar.bz2 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-git-receiver --enable-make --enable-runserver --disable-tests --disable-valgrind" ================================================ FILE: packages/blogc/termux-prefix.patch ================================================ diff --git a/src/blogc-make/atom.c b/src/blogc-make/atom.c index d5f5387..5154bb9 100644 --- a/src/blogc-make/atom.c +++ b/src/blogc-make/atom.c @@ -55,7 +55,7 @@ bm_atom_deploy(bm_settings_t *settings, bc_error_t **err) return NULL; // this is not really portable - char fname[] = "/tmp/blogc-make_XXXXXX"; + char fname[] = "@TERMUX_PREFIX@/tmp/blogc-make_XXXXXX"; int fd; if (-1 == (fd = mkstemp(fname))) { *err = bc_error_new_printf(BLOGC_MAKE_ERROR_ATOM, diff --git a/src/blogc-make/exec.c b/src/blogc-make/exec.c index db20cae..86e8d25 100644 --- a/src/blogc-make/exec.c +++ b/src/blogc-make/exec.c @@ -116,7 +116,7 @@ bm_exec_command(const char *cmd, const char *input, char **output, dup2(fd_err[1], STDERR_FILENO); char *const argv[] = { - "/bin/sh", + "@TERMUX_PREFIX@/bin/sh", "-c", (char*) cmd, NULL, ================================================ FILE: packages/bmon/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/tgraf/bmon TERMUX_PKG_DESCRIPTION="Bandwidth monitor and rate estimator" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=4.0 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/tgraf/bmon/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=d5e503ff6b116c681ebf4d10e238604dde836dceb9c0008eb92416a96c87ca40 TERMUX_PKG_DEPENDS="libconfuse, libnl, ncurses" TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { ./autogen.sh } ================================================ FILE: packages/bmon/config.h.patch ================================================ --- ../../build/bmon/cache/bmon-4.0/include/bmon/config.h 2016-12-13 11:56:40.000000000 +0100 +++ ./include/bmon/config.h 2017-02-09 00:29:18.177571494 +0100 @@ -46,11 +46,6 @@ #include #include #include -#ifdef SYS_BSD -# include -#else -# include -#endif #if TIME_WITH_SYS_TIME # include ================================================ FILE: packages/boost/bootstrap.sh.patch ================================================ diff --git a/bootstrap.sh b/bootstrap.sh index c6f3423..52c08e6 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -30,7 +30,7 @@ if test "x$ECHO" = x; then fi # Internal flags -flag_no_python= +flag_no_python=yes flag_icu= flag_show_libraries= ================================================ FILE: packages/boost/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://boost.org TERMUX_PKG_DESCRIPTION="Free peer-reviewed portable C++ source libraries" TERMUX_PKG_LICENSE="BSL-1.0" TERMUX_PKG_VERSION=1.71.0 TERMUX_PKG_SRCURL=https://dl.bintray.com/boostorg/release/$TERMUX_PKG_VERSION/source/boost_${TERMUX_PKG_VERSION//./_}.tar.bz2 TERMUX_PKG_SHA256=d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_DEPENDS="libc++, libbz2, libiconv, liblzma, zlib" TERMUX_PKG_BUILD_DEPENDS="python" TERMUX_PKG_BREAKS="libboost-python (<= 1.65.1-2), boost-dev" TERMUX_PKG_REPLACES="libboost-python (<= 1.65.1-2), boost-dev" termux_step_pre_configure() { # Certain packages are not safe to build on device because their # build.sh script deletes specific files in $TERMUX_PREFIX. if $TERMUX_ON_DEVICE_BUILD; then termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds." fi } termux_step_make_install() { CXXFLAGS+=" -std=c++14" rm $TERMUX_PREFIX/lib/libboost* -f rm $TERMUX_PREFIX/include/boost -rf CC= CXX= LDFLAGS= CXXFLAGS= ./bootstrap.sh echo "using clang : $TERMUX_ARCH : $CXX : -L$TERMUX_PREFIX/lib ; " >> project-config.jam echo "using python : 3.8 : $TERMUX_PREFIX/bin/python3 : $TERMUX_PREFIX/include/python3.8 : $TERMUX_PREFIX/lib ;" >> project-config.jam if [ "$TERMUX_ARCH" = arm ] || [ "$TERMUX_ARCH" = aarch64 ]; then BOOSTARCH=arm BOOSTABI=aapcs elif [ "$TERMUX_ARCH" = i686 ] || [ "$TERMUX_ARCH" = x86_64 ]; then BOOSTARCH=x86 BOOSTABI=sysv fi if [ "$TERMUX_ARCH" = x86_64 ] || [ "$TERMUX_ARCH" = aarch64 ]; then BOOSTAM=64 elif [ "$TERMUX_ARCH" = i686 ] || [ "$TERMUX_ARCH" = arm ]; then BOOSTAM=32 fi ./b2 target-os=android -j${TERMUX_MAKE_PROCESSES} \ include=$TERMUX_PREFIX/include \ toolset=clang-$TERMUX_ARCH \ --prefix="$TERMUX_PREFIX" \ -q \ --without-stacktrace \ --without-log \ --disable-icu \ -sNO_ZSTD=1 \ cxxflags="$CXXFLAGS" \ linkflags="$LDFLAGS" \ architecture="$BOOSTARCH" \ abi="$BOOSTABI" \ address-model="$BOOSTAM" \ boost.locale.icu=off \ binary-format=elf \ link=shared \ threading=multi \ install } ================================================ FILE: packages/boost/python.jam.patch ================================================ diff --git a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam index 273b28a..3de7f40 100644 --- a/tools/build/src/tools/python.jam +++ b/tools/build/src/tools/python.jam @@ -651,7 +651,7 @@ local rule system-library-dependencies ( target-os ) case aix : return pthread dl ; - case * : return pthread dl + case * : return dl gcc:util linux:util ; } } ================================================ FILE: packages/boost/tools-build-src-tools-common.jam.patch ================================================ diff -u -r ../boost_1_70_0/tools/build/src/tools/common.jam ./tools/build/src/tools/common.jam --- ../boost_1_70_0/tools/build/src/tools/common.jam 2019-04-09 19:36:57.000000000 +0000 +++ ./tools/build/src/tools/common.jam 2019-05-05 22:41:59.313215785 +0000 @@ -980,10 +980,11 @@ } # Ditto, from Clang 4 - if ( $(tag) = clang || $(tag) = clangw ) && [ numbers.less 3 $(version[1]) ] - { - version = $(version[1]) ; - } + # See https://github.com/boostorg/build/issues/385 + #if ( $(tag) = clang || $(tag) = clangw ) && [ numbers.less 3 $(version[1]) ] + #{ + # version = $(version[1]) ; + #} # On intel, version is not added, because it does not matter and it is the # version of vc used as backend that matters. Ideally, we should encode the ================================================ FILE: packages/brotli/CMakeLists.txt.patch ================================================ diff -u -r ../brotli-1.0.4/CMakeLists.txt ./CMakeLists.txt --- ../brotli-1.0.4/CMakeLists.txt 2018-03-29 08:37:07.000000000 +0000 +++ ./CMakeLists.txt 2018-05-27 12:33:42.384489726 +0000 @@ -183,7 +183,7 @@ # Build the brotli executable add_executable(brotli ${BROTLI_CLI_C}) -target_link_libraries(brotli ${BROTLI_LIBRARIES_STATIC}) +target_link_libraries(brotli ${BROTLI_LIBRARIES}) # Installation if(NOT BROTLI_BUNDLED_MODE) ================================================ FILE: packages/brotli/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/google/brotli TERMUX_PKG_DESCRIPTION="lossless compression algorithm and format (command line utility)" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=1.0.7 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=4c61bfb0faca87219ea587326c467b95acb25555b53d1a421ffa3c8a9296ee2c TERMUX_PKG_BREAKS="brotli-dev" TERMUX_PKG_REPLACES="brotli-dev" TERMUX_PKG_SRCURL=https://github.com/google/brotli/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_FORCE_CMAKE=true termux_step_post_make_install() { mkdir -p $TERMUX_PREFIX/share/man/man{1,3} cp $TERMUX_PKG_SRCDIR/docs/brotli.1 $TERMUX_PREFIX/share/man/man1/ cp $TERMUX_PKG_SRCDIR/docs/*.3 $TERMUX_PREFIX/share/man/man3/ } ================================================ FILE: packages/build-essential/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/termux/termux-packages TERMUX_PKG_DESCRIPTION="A metapackage that installs essential development tools" TERMUX_PKG_LICENSE="Public Domain" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=3.1 TERMUX_PKG_REVISION=4 TERMUX_PKG_SKIP_SRC_EXTRACT=true TERMUX_PKG_METAPACKAGE=true TERMUX_PKG_PLATFORM_INDEPENDENT=true # # Common utilities for various build systems: # # autoconf, automake, bison, clang, cmake, flex, gperf, libtool, m4, make, ninja, pkg-config, util-linux # # These packages replace busybox's applets: # # bc, bzip2, coreutils, diffutils, ed, findutils, gawk, grep, gzip, lzip, lzop, patch, procps, psmisc, sed, tar, xz-utils # TERMUX_PKG_DEPENDS="autoconf, automake, bison, clang, cmake, flex, gperf, libtool, m4, make, ninja, pkg-config, bc, bzip2, coreutils, diffutils, ed, findutils, gawk, grep, gzip, lzip, lzop, patch, procps, psmisc, sed, tar, util-linux, xz-utils" # Other packages that may be interesting. TERMUX_PKG_SUGGESTS="git, golang, nodejs, patchelf, proot, python, python2, ruby, rust, subversion" ================================================ FILE: packages/busybox/0000-use-clang.patch ================================================ diff -uNr busybox-1.31.1/Makefile busybox-1.31.1.mod/Makefile --- busybox-1.31.1/Makefile 2019-10-25 11:44:52.000000000 +0300 +++ busybox-1.31.1.mod/Makefile 2019-11-11 22:19:06.004778909 +0200 @@ -289,7 +289,7 @@ # Make variables (CC, etc...) AS = $(CROSS_COMPILE)as -CC = $(CROSS_COMPILE)gcc +CC = $(CROSS_COMPILE)clang LD = $(CC) -nostdlib CPP = $(CC) -E AR = $(CROSS_COMPILE)ar ================================================ FILE: packages/busybox/0001-clang-fix.patch ================================================ diff -uNr busybox-1.31.1/libbb/lineedit.c busybox-1.31.1.mod/libbb/lineedit.c --- busybox-1.31.1/libbb/lineedit.c 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/libbb/lineedit.c 2019-11-12 12:54:35.000425941 +0200 @@ -2337,6 +2337,7 @@ * (in both cases the cursor remains on the input line, '\n' is not printed) * >0 length of input string, including terminating '\n' */ +#pragma clang optimize off int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *command, int maxsize) { int len, n; diff -uNr busybox-1.31.1/miscutils/bc.c busybox-1.31.1.mod/miscutils/bc.c --- busybox-1.31.1/miscutils/bc.c 2019-10-21 17:54:40.000000000 +0300 +++ busybox-1.31.1.mod/miscutils/bc.c 2019-11-12 12:48:49.419098420 +0200 @@ -7435,6 +7435,7 @@ } #if ENABLE_BC +#pragma clang optimize off int bc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int bc_main(int argc UNUSED_PARAM, char **argv) { @@ -7454,6 +7455,7 @@ #endif #if ENABLE_DC +#pragma clang optimize off int dc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int dc_main(int argc UNUSED_PARAM, char **argv) { diff -uNr busybox-1.31.1/miscutils/less.c busybox-1.31.1.mod/miscutils/less.c --- busybox-1.31.1/miscutils/less.c 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/miscutils/less.c 2019-11-12 03:30:59.054944977 +0200 @@ -1803,6 +1803,7 @@ } #endif +#pragma clang optimize off int less_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int less_main(int argc, char **argv) { diff -uNr busybox-1.31.1/networking/ftpd.c busybox-1.31.1.mod/networking/ftpd.c --- busybox-1.31.1/networking/ftpd.c 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/networking/ftpd.c 2019-11-12 04:05:11.739983958 +0200 @@ -1169,6 +1169,7 @@ OPT_w = (1 << (BIT_A + 3)) * ENABLE_FEATURE_FTPD_WRITE, }; +#pragma clang optimize off int ftpd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int ftpd_main(int argc UNUSED_PARAM, char **argv) { diff -uNr busybox-1.31.1/networking/httpd.c busybox-1.31.1.mod/networking/httpd.c --- busybox-1.31.1/networking/httpd.c 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/networking/httpd.c 2019-11-12 03:30:08.104709323 +0200 @@ -2663,7 +2663,7 @@ OPT_VERBOSE = 1 << p_opt_verbose, }; - +#pragma clang optimize off int httpd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int httpd_main(int argc UNUSED_PARAM, char **argv) { diff -uNr busybox-1.31.1/procps/nmeter.c busybox-1.31.1.mod/procps/nmeter.c --- busybox-1.31.1/procps/nmeter.c 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/procps/nmeter.c 2019-11-12 12:59:16.564931184 +0200 @@ -821,6 +821,7 @@ init_cr }; +#pragma clang optimize off int nmeter_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int nmeter_main(int argc UNUSED_PARAM, char **argv) { diff -uNr busybox-1.31.1/runit/svlogd.c busybox-1.31.1.mod/runit/svlogd.c --- busybox-1.31.1/runit/svlogd.c 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/runit/svlogd.c 2019-11-12 03:28:11.214155815 +0200 @@ -1034,6 +1034,7 @@ } } +#pragma clang optimize off int svlogd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int svlogd_main(int argc, char **argv) { diff -uNr busybox-1.31.1/shell/ash.c busybox-1.31.1.mod/shell/ash.c --- busybox-1.31.1/shell/ash.c 2019-10-21 17:54:40.000000000 +0300 +++ busybox-1.31.1.mod/shell/ash.c 2019-11-12 03:24:39.613095056 +0200 @@ -14278,6 +14278,7 @@ * exception occurs. When an exception occurs the variable "state" * is used to figure out how far we had gotten. */ +#pragma clang optimize off int ash_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; #if NUM_SCRIPTS > 0 int ash_main(int argc, char **argv) ================================================ FILE: packages/busybox/0002-hardcoded-paths-fix.patch ================================================ diff -uNr busybox-1.31.1/coreutils/mktemp.c busybox-1.31.1.mod/coreutils/mktemp.c --- busybox-1.31.1/coreutils/mktemp.c 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/coreutils/mktemp.c 2019-11-11 21:46:00.848464330 +0200 @@ -50,7 +50,7 @@ //usage: "\n -p DIR Use DIR as a base directory (implies -t)" //usage: "\n -u Do not create anything; print a name" //usage: "\n" -//usage: "\nBase directory is: -p DIR, else $TMPDIR, else /tmp" +//usage: "\nBase directory is: -p DIR, else $TMPDIR, else @TERMUX_PREFIX@/tmp" //usage: //usage:#define mktemp_example_usage //usage: "$ mktemp /tmp/temp.XXXXXX\n" @@ -76,7 +76,7 @@ path = getenv("TMPDIR"); if (!path || path[0] == '\0') - path = "/tmp"; + path = "@TERMUX_PREFIX@/tmp"; opts = getopt32(argv, "^" "dqtp:u" "\0" "?1"/*1 arg max*/, &path); diff -uNr busybox-1.31.1/editors/diff.c busybox-1.31.1.mod/editors/diff.c --- busybox-1.31.1/editors/diff.c 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/editors/diff.c 2019-11-11 21:46:33.625316185 +0200 @@ -730,7 +730,7 @@ * When we meet non-seekable file, we must make a temp copy. */ if (lseek(fd, 0, SEEK_SET) == -1 && errno == ESPIPE) { - char name[] = "/tmp/difXXXXXX"; + char name[] = "@TERMUX_PREFIX@/tmp/difXXXXXX"; int fd_tmp = xmkstemp(name); unlink(name); diff -uNr busybox-1.31.1/include/libbb.h busybox-1.31.1.mod/include/libbb.h --- busybox-1.31.1/include/libbb.h 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/include/libbb.h 2019-11-11 21:55:22.141411848 +0200 @@ -2126,12 +2126,12 @@ * use bb_default_login_shell and following defines. * If you change LIBBB_DEFAULT_LOGIN_SHELL, * don't forget to change increment constant. */ -#define LIBBB_DEFAULT_LOGIN_SHELL "-/bin/sh" +#define LIBBB_DEFAULT_LOGIN_SHELL "-@TERMUX_PREFIX@/bin/sh" extern const char bb_default_login_shell[] ALIGN1; -/* "/bin/sh" */ +/* "@TERMUX_PREFIX@/bin/sh" */ #define DEFAULT_SHELL (bb_default_login_shell+1) /* "sh" */ -#define DEFAULT_SHELL_SHORT_NAME (bb_default_login_shell+6) +#define DEFAULT_SHELL_SHORT_NAME (bb_default_login_shell+1+sizeof("@TERMUX_PREFIX@/bin")) /* The following devices are the same on all systems. */ #define CURRENT_TTY "/dev/tty" diff -uNr busybox-1.31.1/networking/telnetd.c busybox-1.31.1.mod/networking/telnetd.c --- busybox-1.31.1/networking/telnetd.c 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/networking/telnetd.c 2019-11-11 22:00:22.799539737 +0200 @@ -99,7 +99,7 @@ //usage: "Handle incoming telnet connections" //usage: IF_NOT_FEATURE_TELNETD_STANDALONE(" via inetd") "\n" //usage: "\n -l LOGIN Exec LOGIN on connect" -//usage: "\n -f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue" +//usage: "\n -f ISSUE_FILE Display ISSUE_FILE instead of @TERMUX_PREFIX@/etc/issue.net" //usage: "\n -K Close connection as soon as login exits" //usage: "\n (normally wait until all programs close slave pty)" //usage: IF_FEATURE_TELNETD_STANDALONE( @@ -160,7 +160,7 @@ #define INIT_G() do { \ setup_common_bufsiz(); \ G.loginpath = "/bin/login"; \ - G.issuefile = "/etc/issue.net"; \ + G.issuefile = "@TERMUX_PREFIX@/etc/issue.net"; \ } while (0) diff -uNr busybox-1.31.1/util-linux/setarch.c busybox-1.31.1.mod/util-linux/setarch.c --- busybox-1.31.1/util-linux/setarch.c 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/util-linux/setarch.c 2019-11-11 21:56:31.521753610 +0200 @@ -98,7 +98,7 @@ argv += optind; if (!argv[0]) - (--argv)[0] = (char*)"/bin/sh"; + (--argv)[0] = (char*)"@TERMUX_PREFIX@/bin/sh"; /* Try to execute the program */ BB_EXECVP_or_die(argv); ================================================ FILE: packages/busybox/0003-strchrnul-fix.patch ================================================ diff -uNr busybox-1.31.1/include/platform.h busybox-1.31.1.mod/include/platform.h --- busybox-1.31.1/include/platform.h 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/include/platform.h 2019-11-12 02:43:11.833640516 +0200 @@ -526,7 +526,9 @@ # undef HAVE_STPCPY # endif # undef HAVE_MEMPCPY -# undef HAVE_STRCHRNUL +# if __ANDROID_API__ < 24 +# undef HAVE_STRCHRNUL +# endif # undef HAVE_STRVERSCMP # undef HAVE_UNLOCKED_LINE_OPS # undef HAVE_NET_ETHERNET_H ================================================ FILE: packages/busybox/0004-missing-syscalls.patch ================================================ diff -uNr busybox-1.31.1/libbb/missing_syscalls.c busybox-1.31.1.mod/libbb/missing_syscalls.c --- busybox-1.31.1/libbb/missing_syscalls.c 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/libbb/missing_syscalls.c 2019-11-11 22:56:16.433805825 +0200 @@ -10,10 +10,13 @@ #if defined(ANDROID) || defined(__ANDROID__) /*# include - for struct timex, but may collide with */ # include + +#if __ANDROID_API__ < 17 pid_t getsid(pid_t pid) { return syscall(__NR_getsid, pid); } +#endif int stime(const time_t *t) { @@ -23,16 +26,20 @@ return settimeofday(&tv, NULL); } +#if __ANDROID_API__ < 23 int sethostname(const char *name, size_t len) { return syscall(__NR_sethostname, name, len); } +#endif +#if __ANDROID_API__ < 24 struct timex; int adjtimex(struct timex *buf) { return syscall(__NR_adjtimex, buf); } +#endif int pivot_root(const char *new_root, const char *put_old) { ================================================ FILE: packages/busybox/0005-no-change-identity.patch ================================================ diff -uNr busybox-1.31.1/libbb/change_identity.c busybox-1.31.1.mod/libbb/change_identity.c --- busybox-1.31.1/libbb/change_identity.c 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/libbb/change_identity.c 2019-11-11 22:12:18.976233196 +0200 @@ -32,6 +32,9 @@ /* Become the user and group(s) specified by PW. */ void FAST_FUNC change_identity(const struct passwd *pw) { +#ifdef __ANDROID__ + return; +#endif int res; res = initgroups(pw->pw_name, pw->pw_gid); ================================================ FILE: packages/busybox/0006-no-crypt.h.patch ================================================ diff -uNr busybox-1.31.1/libbb/pw_encrypt.c busybox-1.31.1.mod/libbb/pw_encrypt.c --- busybox-1.31.1/libbb/pw_encrypt.c 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/libbb/pw_encrypt.c 2019-11-11 22:16:44.990795793 +0200 @@ -6,7 +6,10 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ -#include +#if !ENABLE_USE_BB_CRYPT +# include +#endif + #include "libbb.h" /* static const uint8_t ascii64[] ALIGN1 = ================================================ FILE: packages/busybox/0007-miscutils-crond.patch ================================================ diff -uNr busybox-1.31.1/miscutils/crond.c busybox-1.31.1.mod/miscutils/crond.c --- busybox-1.31.1/miscutils/crond.c 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/miscutils/crond.c 2019-11-11 22:04:10.820622087 +0200 @@ -435,7 +435,7 @@ maxLines = (strcmp(fileName, "root") == 0) ? 65535 : MAXLINES; - if (fstat(fileno(parser->fp), &sbuf) == 0 && sbuf.st_uid == DAEMON_UID) { + if (fstat(fileno(parser->fp), &sbuf) == 0) { CronFile *file = xzalloc(sizeof(CronFile)); CronLine **pline; int n; @@ -655,6 +655,9 @@ static void set_env_vars(struct passwd *pas, const char *shell) { +#ifdef __ANDROID__ + return; +#endif /* POSIX requires crond to set up at least HOME, LOGNAME, PATH, SHELL. * We assume crond inherited suitable PATH. */ ================================================ FILE: packages/busybox/0008-miscutils-crontab.patch ================================================ diff -uNr busybox-1.31.1/miscutils/crontab.c busybox-1.31.1.mod/miscutils/crontab.c --- busybox-1.31.1/miscutils/crontab.c 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/miscutils/crontab.c 2019-11-11 22:08:19.115118798 +0200 @@ -53,10 +53,12 @@ /* CHILD - change user and run editor */ /* initgroups, setgid, setuid */ +#ifndef __ANDROID__ change_identity(pas); setup_environment(pas->pw_shell, SETUP_ENV_CHANGEENV | SETUP_ENV_TO_TMP, pas); +#endif ptr = getenv("VISUAL"); if (!ptr) { ptr = getenv("EDITOR"); @@ -167,7 +169,8 @@ } close_on_exec_on(src_fd); /* don't want editor to see this fd */ edit_file(pas, tmp_fname); - /* fall through */ + xrename(tmp_fname, pas->pw_name); + break; case 0: /* Replace (no -l, -e, or -r were given) */ new_fname = xasprintf("%s.new", pas->pw_name); ================================================ FILE: packages/busybox/0009-networking-ftpd-no-chroot.patch ================================================ diff -uNr busybox-1.31.1/networking/ftpd.c busybox-1.31.1.mod/networking/ftpd.c --- busybox-1.31.1/networking/ftpd.c 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/networking/ftpd.c 2019-11-11 22:26:50.216912741 +0200 @@ -1301,8 +1301,11 @@ G.root_fd = xopen("/", O_RDONLY | O_DIRECTORY); close_on_exec_on(G.root_fd); #endif +#ifndef __ANDROID__ + /* Do not try chroot() on Android because it may trigger seccomp. */ if (chroot(basedir) == 0) basedir = "/"; +#endif #if !BB_MMU else { close(G.root_fd); ================================================ FILE: packages/busybox/0010-networking-httpd-default-port.patch ================================================ diff -uNr busybox-1.31.1/networking/httpd.c busybox-1.31.1.mod/networking/httpd.c --- busybox-1.31.1/networking/httpd.c 2019-11-11 21:31:58.406733857 +0200 +++ busybox-1.31.1.mod/networking/httpd.c 2019-11-11 22:29:16.534250966 +0200 @@ -232,7 +232,7 @@ //usage: "\n -i Inetd mode" //usage: "\n -f Don't daemonize" //usage: "\n -v[v] Verbose" -//usage: "\n -p [IP:]PORT Bind to IP:PORT (default *:80)" +//usage: "\n -p [IP:]PORT Bind to IP:PORT (default *:8080)" //usage: IF_FEATURE_HTTPD_SETUID( //usage: "\n -u USER[:GRP] Set uid/gid after binding to port") //usage: IF_FEATURE_HTTPD_BASIC_AUTH( @@ -488,7 +488,7 @@ asm volatile("":::"memory"); \ IF_FEATURE_HTTPD_BASIC_AUTH(g_realm = "Web Server Authentication";) \ IF_FEATURE_HTTPD_RANGES(range_start = -1;) \ - bind_addr_or_port = "80"; \ + bind_addr_or_port = "8080"; \ index_page = index_html; \ file_size = -1; \ } while (0) @@ -1004,7 +1004,7 @@ if (!errno && n && n <= 0xffff) n = create_and_bind_stream_or_die(NULL, n); else - n = create_and_bind_stream_or_die(bind_addr_or_port, 80); + n = create_and_bind_stream_or_die(bind_addr_or_port, 8080); xlisten(n, 9); return n; } @@ -2209,7 +2209,7 @@ if (proxy_entry) { if (verbose > 1) bb_error_msg("proxy:%s", urlcopy); - lsa = host2sockaddr(proxy_entry->host_port, 80); + lsa = host2sockaddr(proxy_entry->host_port, 8080); if (!lsa) send_headers_and_exit(HTTP_INTERNAL_SERVER_ERROR); proxy_fd = socket(lsa->u.sa.sa_family, SOCK_STREAM, 0); ================================================ FILE: packages/busybox/0011-networking-telnetd-default-port.patch ================================================ diff -uNr busybox-1.31.1/networking/telnetd.c busybox-1.31.1.mod/networking/telnetd.c --- busybox-1.31.1/networking/telnetd.c 2019-11-11 22:00:22.799539737 +0200 +++ busybox-1.31.1.mod/networking/telnetd.c 2019-11-11 22:32:02.268344626 +0200 @@ -707,7 +707,7 @@ } else { master_fd = 0; if (!(opt & OPT_WAIT)) { - unsigned portnbr = 23; + unsigned portnbr = 8023; if (opt & OPT_PORT) portnbr = xatou16(opt_portnbr); master_fd = create_and_bind_stream_or_die(opt_bindaddr, portnbr); ================================================ FILE: packages/busybox/0012-networking-tftp-no-chroot.patch ================================================ diff -uNr busybox-1.31.1/networking/tftp.c busybox-1.31.1.mod/networking/tftp.c --- busybox-1.31.1/networking/tftp.c 2019-06-10 13:50:53.000000000 +0300 +++ busybox-1.31.1.mod/networking/tftp.c 2019-11-11 22:36:27.592894669 +0200 @@ -907,7 +907,12 @@ G.pw = xgetpwnam(user_opt); } if (argv[0]) { +#ifdef __ANDROID__ + // chroot may trigger seccomp and is allowed only for root anyway. + xchdir(argv[0]); +#else xchroot(argv[0]); +#endif } result = recv_from_to(STDIN_FILENO, ================================================ FILE: packages/busybox/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://busybox.net/ TERMUX_PKG_DESCRIPTION="Tiny versions of many common UNIX utilities into a single small executable" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.31.1 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://busybox.net/downloads/busybox-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SHA256=d0f940a72f648943c1f2211e0e3117387c31d765137d92bd8284a3fb9752a998 TERMUX_PKG_BUILD_IN_SRC=true # We replace env in the old coreutils package: TERMUX_PKG_CONFLICTS="coreutils (<< 8.25-4)" TERMUX_PKG_CONFFILES="var/service/telnetd/run var/service/telnetd/log/run var/service/ftpd/run var/service/ftpd/log/run" termux_step_pre_configure() { # Certain packages are not safe to build on device because their # build.sh script deletes specific files in $TERMUX_PREFIX. if $TERMUX_ON_DEVICE_BUILD; then termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds." fi } termux_step_configure() { # Prevent spamming logs with useless warnings to make them more readable. CFLAGS+=" -Wno-ignored-optimization-argument -Wno-unused-command-line-argument" sed -e "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|g" \ -e "s|@TERMUX_SYSROOT@|$TERMUX_STANDALONE_TOOLCHAIN/sysroot|g" \ -e "s|@TERMUX_HOST_PLATFORM@|${TERMUX_HOST_PLATFORM}|g" \ -e "s|@TERMUX_CFLAGS@|$CFLAGS|g" \ -e "s|@TERMUX_LDFLAGS@|$LDFLAGS|g" \ -e "s|@TERMUX_LDLIBS@|log|g" \ $TERMUX_PKG_BUILDER_DIR/busybox.config > .config unset CFLAGS LDFLAGS make oldconfig } termux_step_post_make_install() { if $TERMUX_DEBUG; then install -Dm700 busybox_unstripped $PREFIX/bin/busybox fi # Utilities diff, mv, rm, rmdir are necessary to assist with package upgrading # after https://github.com/termux/termux-packages/issues/4070. # # Other utilities (like crond/crontab) are useful but not available # as standalone package in Termux. # # Few notes: # # * runsv, runsvdir, sv - for things like in https://github.com/termux/termux-packages/pull/3460. # * tcpsvd - required for ftpd applet. # * vi - replaced by vim, but it still good to have basic text editor in bootstrap. # * which - replaced by debianutils, but still good to have in bootstrap. # rm -Rf $TERMUX_PREFIX/bin/applets mkdir -p $TERMUX_PREFIX/bin/applets cd $TERMUX_PREFIX/bin/applets for f in crond crontab diff ftpd ftpget ftpput hostname inotifyd \ iostat lsof lsusb mpstat mv nmeter rm rmdir runsv runsvdir \ sendmail start-stop-daemon sv svlogd tcpsvd uptime usleep \ vi which; do ln -s ../busybox $f done unset f # Install busybox man page mkdir -p $TERMUX_PREFIX/share/man/man1 cp $TERMUX_PKG_SRCDIR/docs/busybox.1 $TERMUX_PREFIX/share/man/man1 # Needed for 'crontab -e' to work out of the box: local _CRONTABS=$TERMUX_PREFIX/var/spool/cron/crontabs mkdir -p $_CRONTABS echo "Used by the busybox crontab and crond tools" > $_CRONTABS/README.termux # Setup some services mkdir -p $TERMUX_PREFIX/var/service cd $TERMUX_PREFIX/var/service mkdir -p ftpd/log telnetd/log echo "#!$TERMUX_PREFIX/bin/sh" > ftpd/run echo 'exec busybox tcpsvd -vE 0.0.0.0 8021 ftpd /data/data/com.termux/files/home' >> ftpd/run echo "#!$TERMUX_PREFIX/bin/sh" > telnetd/run echo 'exec busybox telnetd -F' >> telnetd/run chmod +x */run touch telnetd/down ftpd/down ln -sf $PREFIX/share/termux-services/svlogger telnetd/log/run ln -sf $PREFIX/share/termux-services/svlogger ftpd/log/run } ================================================ FILE: packages/busybox/busybox.config ================================================ # # Automatically generated make config: don't edit # Busybox version: 1.31.1 # Mon Nov 11 21:25:37 2019 # CONFIG_HAVE_DOT_CONFIG=y # # Settings # CONFIG_DESKTOP=y # CONFIG_EXTRA_COMPAT is not set # CONFIG_FEDORA_COMPAT is not set # CONFIG_INCLUDE_SUSv2 is not set CONFIG_LONG_OPTS=y CONFIG_SHOW_USAGE=y CONFIG_FEATURE_VERBOSE_USAGE=y CONFIG_FEATURE_COMPRESS_USAGE=y # CONFIG_LFS is not set # CONFIG_PAM is not set CONFIG_FEATURE_DEVPTS=y # CONFIG_FEATURE_UTMP is not set # CONFIG_FEATURE_WTMP is not set # CONFIG_FEATURE_PIDFILE is not set CONFIG_PID_FILE_PATH="" CONFIG_BUSYBOX=y CONFIG_FEATURE_SHOW_SCRIPT=y CONFIG_FEATURE_INSTALLER=y CONFIG_INSTALL_NO_USR=y # CONFIG_FEATURE_SUID is not set # CONFIG_FEATURE_SUID_CONFIG is not set # CONFIG_FEATURE_SUID_CONFIG_QUIET is not set # CONFIG_FEATURE_PREFER_APPLETS is not set CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" # CONFIG_SELINUX is not set # CONFIG_FEATURE_CLEAN_UP is not set # CONFIG_FEATURE_SYSLOG_INFO is not set CONFIG_FEATURE_SYSLOG=y CONFIG_PLATFORM_LINUX=y # # Build Options # # CONFIG_STATIC is not set CONFIG_PIE=y # CONFIG_NOMMU is not set # CONFIG_BUILD_LIBBUSYBOX is not set # CONFIG_FEATURE_LIBBUSYBOX_STATIC is not set # CONFIG_FEATURE_INDIVIDUAL is not set # CONFIG_FEATURE_SHARED_BUSYBOX is not set CONFIG_CROSS_COMPILER_PREFIX="@TERMUX_HOST_PLATFORM@-" CONFIG_SYSROOT="@TERMUX_SYSROOT@" CONFIG_EXTRA_CFLAGS="@TERMUX_CFLAGS@" CONFIG_EXTRA_LDFLAGS="@TERMUX_LDFLAGS@" CONFIG_EXTRA_LDLIBS="@TERMUX_LDLIBS@" # CONFIG_USE_PORTABLE_CODE is not set # CONFIG_STACK_OPTIMIZATION_386 is not set # # Installation Options ("make install" behavior) # # CONFIG_INSTALL_APPLET_SYMLINKS is not set # CONFIG_INSTALL_APPLET_HARDLINKS is not set # CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set CONFIG_INSTALL_APPLET_DONT=y # CONFIG_INSTALL_SH_APPLET_SYMLINK is not set # CONFIG_INSTALL_SH_APPLET_HARDLINK is not set # CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set CONFIG_PREFIX="@TERMUX_PREFIX@" # # Debugging Options # # CONFIG_DEBUG is not set # CONFIG_DEBUG_PESSIMIZE is not set # CONFIG_DEBUG_SANITIZE is not set # CONFIG_UNIT_TEST is not set # CONFIG_WERROR is not set CONFIG_NO_DEBUG_LIB=y # CONFIG_DMALLOC is not set # CONFIG_EFENCE is not set # # Library Tuning # # CONFIG_FEATURE_USE_BSS_TAIL is not set CONFIG_FLOAT_DURATION=y # CONFIG_FEATURE_RTMINMAX is not set # CONFIG_FEATURE_RTMINMAX_USE_LIBC_DEFINITIONS is not set CONFIG_FEATURE_BUFFERS_USE_MALLOC=y # CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set # CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set CONFIG_PASSWORD_MINLEN=6 CONFIG_MD5_SMALL=1 CONFIG_SHA3_SMALL=1 # CONFIG_FEATURE_FAST_TOP is not set # CONFIG_FEATURE_ETC_NETWORKS is not set # CONFIG_FEATURE_ETC_SERVICES is not set CONFIG_FEATURE_EDITING=y CONFIG_FEATURE_EDITING_MAX_LEN=1024 CONFIG_FEATURE_EDITING_VI=y CONFIG_FEATURE_EDITING_HISTORY=255 CONFIG_FEATURE_EDITING_SAVEHISTORY=y CONFIG_FEATURE_EDITING_SAVE_ON_EXIT=y CONFIG_FEATURE_REVERSE_SEARCH=y CONFIG_FEATURE_TAB_COMPLETION=y # CONFIG_FEATURE_USERNAME_COMPLETION is not set CONFIG_FEATURE_EDITING_FANCY_PROMPT=y CONFIG_FEATURE_EDITING_WINCH=y CONFIG_FEATURE_EDITING_ASK_TERMINAL=y # CONFIG_LOCALE_SUPPORT is not set CONFIG_UNICODE_SUPPORT=y # CONFIG_UNICODE_USING_LOCALE is not set # CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set CONFIG_SUBST_WCHAR=63 CONFIG_LAST_SUPPORTED_WCHAR=0 # CONFIG_UNICODE_COMBINING_WCHARS is not set CONFIG_UNICODE_WIDE_WCHARS=y # CONFIG_UNICODE_BIDI_SUPPORT is not set # CONFIG_UNICODE_NEUTRAL_TABLE is not set # CONFIG_UNICODE_PRESERVE_BROKEN is not set CONFIG_FEATURE_NON_POSIX_CP=y CONFIG_FEATURE_VERBOSE_CP_MESSAGE=y CONFIG_FEATURE_USE_SENDFILE=y CONFIG_FEATURE_COPYBUF_KB=4 # CONFIG_FEATURE_SKIP_ROOTFS is not set # CONFIG_MONOTONIC_SYSCALL is not set # CONFIG_IOCTL_HEX2STR_ERROR is not set # CONFIG_FEATURE_HWIB is not set # # Applets # # # Archival Utilities # CONFIG_FEATURE_SEAMLESS_XZ=y CONFIG_FEATURE_SEAMLESS_LZMA=y CONFIG_FEATURE_SEAMLESS_BZ2=y CONFIG_FEATURE_SEAMLESS_GZ=y CONFIG_FEATURE_SEAMLESS_Z=y CONFIG_AR=y CONFIG_FEATURE_AR_LONG_FILENAMES=y CONFIG_FEATURE_AR_CREATE=y CONFIG_UNCOMPRESS=y CONFIG_GUNZIP=y CONFIG_ZCAT=y CONFIG_FEATURE_GUNZIP_LONG_OPTIONS=y CONFIG_BUNZIP2=y CONFIG_BZCAT=y CONFIG_UNLZMA=y CONFIG_LZCAT=y CONFIG_LZMA=y CONFIG_UNXZ=y CONFIG_XZCAT=y CONFIG_XZ=y CONFIG_BZIP2=y CONFIG_BZIP2_SMALL=0 CONFIG_FEATURE_BZIP2_DECOMPRESS=y CONFIG_CPIO=y CONFIG_FEATURE_CPIO_O=y CONFIG_FEATURE_CPIO_P=y # CONFIG_DPKG is not set # CONFIG_DPKG_DEB is not set CONFIG_GZIP=y CONFIG_FEATURE_GZIP_LONG_OPTIONS=y CONFIG_GZIP_FAST=0 CONFIG_FEATURE_GZIP_LEVELS=y CONFIG_FEATURE_GZIP_DECOMPRESS=y CONFIG_LZOP=y CONFIG_UNLZOP=y CONFIG_LZOPCAT=y CONFIG_LZOP_COMPR_HIGH=y # CONFIG_RPM is not set # CONFIG_RPM2CPIO is not set CONFIG_TAR=y CONFIG_FEATURE_TAR_LONG_OPTIONS=y CONFIG_FEATURE_TAR_CREATE=y CONFIG_FEATURE_TAR_AUTODETECT=y CONFIG_FEATURE_TAR_FROM=y CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY=y CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y CONFIG_FEATURE_TAR_TO_COMMAND=y CONFIG_FEATURE_TAR_UNAME_GNAME=y CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y # CONFIG_FEATURE_TAR_SELINUX is not set CONFIG_UNZIP=y CONFIG_FEATURE_UNZIP_CDF=y CONFIG_FEATURE_UNZIP_BZIP2=y CONFIG_FEATURE_UNZIP_LZMA=y CONFIG_FEATURE_UNZIP_XZ=y CONFIG_FEATURE_LZMA_FAST=y # # Coreutils # CONFIG_BASENAME=y CONFIG_CAT=y CONFIG_FEATURE_CATN=y CONFIG_FEATURE_CATV=y CONFIG_CHGRP=y CONFIG_CHMOD=y CONFIG_CHOWN=y CONFIG_FEATURE_CHOWN_LONG_OPTIONS=y CONFIG_CHROOT=y CONFIG_CKSUM=y CONFIG_COMM=y CONFIG_CP=y CONFIG_FEATURE_CP_LONG_OPTIONS=y CONFIG_FEATURE_CP_REFLINK=y CONFIG_CUT=y CONFIG_DATE=y CONFIG_FEATURE_DATE_ISOFMT=y # CONFIG_FEATURE_DATE_NANO is not set CONFIG_FEATURE_DATE_COMPAT=y CONFIG_DD=y CONFIG_FEATURE_DD_SIGNAL_HANDLING=y CONFIG_FEATURE_DD_THIRD_STATUS_LINE=y CONFIG_FEATURE_DD_IBS_OBS=y CONFIG_FEATURE_DD_STATUS=y # CONFIG_DF is not set # CONFIG_FEATURE_DF_FANCY is not set CONFIG_DIRNAME=y CONFIG_DOS2UNIX=y CONFIG_UNIX2DOS=y CONFIG_DU=y CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y CONFIG_ECHO=y CONFIG_FEATURE_FANCY_ECHO=y CONFIG_ENV=y CONFIG_EXPAND=y CONFIG_UNEXPAND=y CONFIG_EXPR=y CONFIG_EXPR_MATH_SUPPORT_64=y CONFIG_FACTOR=y CONFIG_FALSE=y CONFIG_FOLD=y CONFIG_HEAD=y CONFIG_FEATURE_FANCY_HEAD=y # CONFIG_HOSTID is not set CONFIG_ID=y CONFIG_GROUPS=y CONFIG_INSTALL=y CONFIG_FEATURE_INSTALL_LONG_OPTIONS=y CONFIG_LINK=y CONFIG_LN=y # CONFIG_LOGNAME is not set CONFIG_LS=y CONFIG_FEATURE_LS_FILETYPES=y CONFIG_FEATURE_LS_FOLLOWLINKS=y CONFIG_FEATURE_LS_RECURSIVE=y CONFIG_FEATURE_LS_WIDTH=y CONFIG_FEATURE_LS_SORTFILES=y CONFIG_FEATURE_LS_TIMESTAMPS=y CONFIG_FEATURE_LS_USERNAME=y CONFIG_FEATURE_LS_COLOR=y CONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y CONFIG_MD5SUM=y CONFIG_SHA1SUM=y CONFIG_SHA256SUM=y CONFIG_SHA512SUM=y CONFIG_SHA3SUM=y # # Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum # CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y CONFIG_MKDIR=y CONFIG_MKFIFO=y CONFIG_MKNOD=y CONFIG_MKTEMP=y CONFIG_MV=y CONFIG_NICE=y CONFIG_NL=y CONFIG_NOHUP=y CONFIG_NPROC=y CONFIG_OD=y CONFIG_PASTE=y CONFIG_PRINTENV=y CONFIG_PRINTF=y CONFIG_PWD=y CONFIG_READLINK=y CONFIG_FEATURE_READLINK_FOLLOW=y CONFIG_REALPATH=y CONFIG_RM=y CONFIG_RMDIR=y CONFIG_SEQ=y CONFIG_SHRED=y CONFIG_SHUF=y CONFIG_SLEEP=y CONFIG_FEATURE_FANCY_SLEEP=y CONFIG_SORT=y CONFIG_FEATURE_SORT_BIG=y # CONFIG_FEATURE_SORT_OPTIMIZE_MEMORY is not set CONFIG_SPLIT=y CONFIG_FEATURE_SPLIT_FANCY=y CONFIG_STAT=y CONFIG_FEATURE_STAT_FORMAT=y CONFIG_FEATURE_STAT_FILESYSTEM=y CONFIG_STTY=y CONFIG_SUM=y CONFIG_SYNC=y # CONFIG_FEATURE_SYNC_FANCY is not set CONFIG_FSYNC=y CONFIG_TAC=y CONFIG_TAIL=y CONFIG_FEATURE_FANCY_TAIL=y CONFIG_TEE=y CONFIG_FEATURE_TEE_USE_BLOCK_IO=y CONFIG_TEST=y CONFIG_TEST1=y CONFIG_TEST2=y CONFIG_FEATURE_TEST_64=y CONFIG_TIMEOUT=y CONFIG_TOUCH=y # CONFIG_FEATURE_TOUCH_NODEREF is not set CONFIG_FEATURE_TOUCH_SUSV3=y CONFIG_TR=y CONFIG_FEATURE_TR_CLASSES=y CONFIG_FEATURE_TR_EQUIV=y CONFIG_TRUE=y CONFIG_TRUNCATE=y CONFIG_TTY=y CONFIG_UNAME=y CONFIG_UNAME_OSNAME="Android" CONFIG_BB_ARCH=y CONFIG_UNIQ=y CONFIG_UNLINK=y CONFIG_USLEEP=y CONFIG_UUDECODE=y CONFIG_BASE64=y CONFIG_UUENCODE=y CONFIG_WC=y CONFIG_FEATURE_WC_LARGE=y CONFIG_WHOAMI=y # CONFIG_WHO is not set # CONFIG_W is not set # CONFIG_USERS is not set CONFIG_YES=y # # Common options # CONFIG_FEATURE_VERBOSE=y # # Common options for cp and mv # CONFIG_FEATURE_PRESERVE_HARDLINKS=y # # Common options for df, du, ls # CONFIG_FEATURE_HUMAN_READABLE=y # # Console Utilities # # CONFIG_CHVT is not set CONFIG_CLEAR=y # CONFIG_DEALLOCVT is not set # CONFIG_DUMPKMAP is not set # CONFIG_FGCONSOLE is not set # CONFIG_KBD_MODE is not set # CONFIG_LOADFONT is not set # CONFIG_SETFONT is not set # CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set CONFIG_DEFAULT_SETFONT_DIR="" # CONFIG_FEATURE_LOADFONT_PSF2 is not set # CONFIG_FEATURE_LOADFONT_RAW is not set # CONFIG_LOADKMAP is not set # CONFIG_OPENVT is not set CONFIG_RESET=y CONFIG_RESIZE=y CONFIG_FEATURE_RESIZE_PRINT=y # CONFIG_SETCONSOLE is not set # CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set # CONFIG_SETKEYCODES is not set # CONFIG_SETLOGCONS is not set # CONFIG_SHOWKEY is not set # # Debian Utilities # CONFIG_PIPE_PROGRESS=y CONFIG_RUN_PARTS=y CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y CONFIG_FEATURE_RUN_PARTS_FANCY=y CONFIG_START_STOP_DAEMON=y CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y CONFIG_WHICH=y # # klibc-utils # # CONFIG_MINIPS is not set # CONFIG_NUKE is not set # CONFIG_RESUME is not set # CONFIG_RUN_INIT is not set # # Editors # CONFIG_AWK=y CONFIG_FEATURE_AWK_LIBM=y CONFIG_FEATURE_AWK_GNU_EXTENSIONS=y CONFIG_CMP=y CONFIG_DIFF=y CONFIG_FEATURE_DIFF_LONG_OPTIONS=y CONFIG_FEATURE_DIFF_DIR=y CONFIG_ED=y CONFIG_PATCH=y CONFIG_SED=y CONFIG_VI=y CONFIG_FEATURE_VI_MAX_LEN=4096 CONFIG_FEATURE_VI_8BIT=y CONFIG_FEATURE_VI_COLON=y CONFIG_FEATURE_VI_YANKMARK=y CONFIG_FEATURE_VI_SEARCH=y # CONFIG_FEATURE_VI_REGEX_SEARCH is not set CONFIG_FEATURE_VI_USE_SIGNALS=y CONFIG_FEATURE_VI_DOT_CMD=y CONFIG_FEATURE_VI_READONLY=y CONFIG_FEATURE_VI_SETOPTS=y CONFIG_FEATURE_VI_SET=y CONFIG_FEATURE_VI_WIN_RESIZE=y CONFIG_FEATURE_VI_ASK_TERMINAL=y CONFIG_FEATURE_VI_UNDO=y CONFIG_FEATURE_VI_UNDO_QUEUE=y CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=256 CONFIG_FEATURE_ALLOW_EXEC=y # # Finding Utilities # CONFIG_FIND=y CONFIG_FEATURE_FIND_PRINT0=y CONFIG_FEATURE_FIND_MTIME=y CONFIG_FEATURE_FIND_MMIN=y CONFIG_FEATURE_FIND_PERM=y CONFIG_FEATURE_FIND_TYPE=y CONFIG_FEATURE_FIND_EXECUTABLE=y CONFIG_FEATURE_FIND_XDEV=y CONFIG_FEATURE_FIND_MAXDEPTH=y CONFIG_FEATURE_FIND_NEWER=y CONFIG_FEATURE_FIND_INUM=y CONFIG_FEATURE_FIND_EXEC=y CONFIG_FEATURE_FIND_EXEC_PLUS=y CONFIG_FEATURE_FIND_USER=y CONFIG_FEATURE_FIND_GROUP=y CONFIG_FEATURE_FIND_NOT=y CONFIG_FEATURE_FIND_DEPTH=y CONFIG_FEATURE_FIND_PAREN=y CONFIG_FEATURE_FIND_SIZE=y CONFIG_FEATURE_FIND_PRUNE=y CONFIG_FEATURE_FIND_QUIT=y CONFIG_FEATURE_FIND_DELETE=y CONFIG_FEATURE_FIND_PATH=y CONFIG_FEATURE_FIND_REGEX=y # CONFIG_FEATURE_FIND_CONTEXT is not set CONFIG_FEATURE_FIND_LINKS=y CONFIG_GREP=y CONFIG_EGREP=y CONFIG_FGREP=y CONFIG_FEATURE_GREP_CONTEXT=y CONFIG_XARGS=y CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR=y CONFIG_FEATURE_XARGS_SUPPORT_PARALLEL=y CONFIG_FEATURE_XARGS_SUPPORT_ARGS_FILE=y # # Init Utilities # # CONFIG_BOOTCHARTD is not set # CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set # CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set # CONFIG_HALT is not set # CONFIG_POWEROFF is not set # CONFIG_REBOOT is not set # CONFIG_FEATURE_WAIT_FOR_INIT is not set # CONFIG_FEATURE_CALL_TELINIT is not set CONFIG_TELINIT_PATH="" # CONFIG_INIT is not set # CONFIG_LINUXRC is not set # CONFIG_FEATURE_USE_INITTAB is not set # CONFIG_FEATURE_KILL_REMOVED is not set CONFIG_FEATURE_KILL_DELAY=0 # CONFIG_FEATURE_INIT_SCTTY is not set # CONFIG_FEATURE_INIT_SYSLOG is not set # CONFIG_FEATURE_INIT_QUIET is not set # CONFIG_FEATURE_INIT_COREDUMPS is not set CONFIG_INIT_TERMINAL_TYPE="" # CONFIG_FEATURE_INIT_MODIFY_CMDLINE is not set # # Login/Password Management Utilities # # CONFIG_FEATURE_SHADOWPASSWDS is not set # CONFIG_USE_BB_PWD_GRP is not set # CONFIG_USE_BB_SHADOW is not set CONFIG_USE_BB_CRYPT=y # CONFIG_USE_BB_CRYPT_SHA is not set # CONFIG_ADDGROUP is not set # CONFIG_FEATURE_ADDUSER_TO_GROUP is not set # CONFIG_ADD_SHELL is not set # CONFIG_REMOVE_SHELL is not set # CONFIG_ADDUSER is not set # CONFIG_FEATURE_CHECK_NAMES is not set CONFIG_LAST_ID=0 CONFIG_FIRST_SYSTEM_ID=0 CONFIG_LAST_SYSTEM_ID=0 # CONFIG_CHPASSWD is not set CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="" # CONFIG_CRYPTPW is not set # CONFIG_MKPASSWD is not set # CONFIG_DELUSER is not set # CONFIG_DELGROUP is not set # CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set # CONFIG_GETTY is not set # CONFIG_LOGIN is not set # CONFIG_LOGIN_SESSION_AS_CHILD is not set # CONFIG_LOGIN_SCRIPTS is not set # CONFIG_FEATURE_NOLOGIN is not set # CONFIG_FEATURE_SECURETTY is not set # CONFIG_PASSWD is not set # CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set # CONFIG_SU is not set # CONFIG_FEATURE_SU_SYSLOG is not set # CONFIG_FEATURE_SU_CHECKS_SHELLS is not set # CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set # CONFIG_SULOGIN is not set # CONFIG_VLOCK is not set # # Linux Ext2 FS Progs # CONFIG_CHATTR=y # CONFIG_FSCK is not set CONFIG_LSATTR=y CONFIG_TUNE2FS=y # # Linux Module Utilities # # CONFIG_MODPROBE_SMALL is not set # CONFIG_DEPMOD is not set # CONFIG_INSMOD is not set # CONFIG_LSMOD is not set # CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set # CONFIG_MODINFO is not set # CONFIG_MODPROBE is not set # CONFIG_FEATURE_MODPROBE_BLACKLIST is not set # CONFIG_RMMOD is not set # # Options common to multiple modutils # # CONFIG_FEATURE_CMDLINE_MODULE_OPTIONS is not set # CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set # CONFIG_FEATURE_2_4_MODULES is not set # CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set # CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set # CONFIG_FEATURE_INSMOD_LOADINKMEM is not set # CONFIG_FEATURE_INSMOD_LOAD_MAP is not set # CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set # CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set # CONFIG_FEATURE_INSMOD_TRY_MMAP is not set # CONFIG_FEATURE_MODUTILS_ALIAS is not set # CONFIG_FEATURE_MODUTILS_SYMBOLS is not set CONFIG_DEFAULT_MODULES_DIR="" CONFIG_DEFAULT_DEPMOD_FILE="" # # Linux System Utilities # # CONFIG_ACPID is not set # CONFIG_FEATURE_ACPID_COMPAT is not set CONFIG_BLKDISCARD=y CONFIG_BLKID=y CONFIG_FEATURE_BLKID_TYPE=y CONFIG_BLOCKDEV=y CONFIG_CAL=y CONFIG_CHRT=y CONFIG_DMESG=y CONFIG_FEATURE_DMESG_PRETTY=y # CONFIG_EJECT is not set # CONFIG_FEATURE_EJECT_SCSI is not set CONFIG_FALLOCATE=y # CONFIG_FATATTR is not set # CONFIG_FBSET is not set # CONFIG_FEATURE_FBSET_FANCY is not set # CONFIG_FEATURE_FBSET_READMODE is not set # CONFIG_FDFORMAT is not set CONFIG_FDISK=y CONFIG_FDISK_SUPPORT_LARGE_DISKS=y CONFIG_FEATURE_FDISK_WRITABLE=y CONFIG_FEATURE_AIX_LABEL=y CONFIG_FEATURE_SGI_LABEL=y CONFIG_FEATURE_SUN_LABEL=y CONFIG_FEATURE_OSF_LABEL=y CONFIG_FEATURE_GPT_LABEL=y CONFIG_FEATURE_FDISK_ADVANCED=y CONFIG_FINDFS=y CONFIG_FLOCK=y # CONFIG_FDFLUSH is not set # CONFIG_FREERAMDISK is not set # CONFIG_FSCK_MINIX is not set # CONFIG_FSFREEZE is not set CONFIG_FSTRIM=y CONFIG_GETOPT=y CONFIG_FEATURE_GETOPT_LONG=y CONFIG_HEXDUMP=y CONFIG_FEATURE_HEXDUMP_REVERSE=y CONFIG_HD=y CONFIG_XXD=y CONFIG_HWCLOCK=y # CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set CONFIG_IONICE=y # CONFIG_IPCRM is not set # CONFIG_IPCS is not set # CONFIG_LAST is not set # CONFIG_FEATURE_LAST_FANCY is not set CONFIG_LOSETUP=y CONFIG_LSPCI=y CONFIG_LSUSB=y # CONFIG_MDEV is not set # CONFIG_FEATURE_MDEV_CONF is not set # CONFIG_FEATURE_MDEV_RENAME is not set # CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set # CONFIG_FEATURE_MDEV_EXEC is not set # CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set # CONFIG_FEATURE_MDEV_DAEMON is not set # CONFIG_MESG is not set # CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP is not set CONFIG_MKE2FS=y CONFIG_MKFS_EXT2=y # CONFIG_MKFS_MINIX is not set # CONFIG_FEATURE_MINIX2 is not set # CONFIG_MKFS_REISER is not set CONFIG_MKDOSFS=y CONFIG_MKFS_VFAT=y CONFIG_MKSWAP=y CONFIG_FEATURE_MKSWAP_UUID=y CONFIG_MORE=y CONFIG_MOUNT=y CONFIG_FEATURE_MOUNT_FAKE=y CONFIG_FEATURE_MOUNT_VERBOSE=y CONFIG_FEATURE_MOUNT_HELPERS=y CONFIG_FEATURE_MOUNT_LABEL=y # CONFIG_FEATURE_MOUNT_NFS is not set CONFIG_FEATURE_MOUNT_CIFS=y CONFIG_FEATURE_MOUNT_FLAGS=y # CONFIG_FEATURE_MOUNT_FSTAB is not set # CONFIG_FEATURE_MOUNT_OTHERTAB is not set CONFIG_MOUNTPOINT=y # CONFIG_NOLOGIN is not set # CONFIG_NOLOGIN_DEPENDENCIES is not set CONFIG_NSENTER=y CONFIG_PIVOT_ROOT=y CONFIG_RDATE=y # CONFIG_RDEV is not set # CONFIG_READPROFILE is not set CONFIG_RENICE=y CONFIG_REV=y # CONFIG_RTCWAKE is not set CONFIG_SCRIPT=y CONFIG_SCRIPTREPLAY=y CONFIG_SETARCH=y CONFIG_LINUX32=y CONFIG_LINUX64=y # CONFIG_SETPRIV is not set # CONFIG_FEATURE_SETPRIV_DUMP is not set # CONFIG_FEATURE_SETPRIV_CAPABILITIES is not set # CONFIG_FEATURE_SETPRIV_CAPABILITY_NAMES is not set CONFIG_SETSID=y # CONFIG_SWAPON is not set # CONFIG_FEATURE_SWAPON_DISCARD is not set # CONFIG_FEATURE_SWAPON_PRI is not set # CONFIG_SWAPOFF is not set # CONFIG_FEATURE_SWAPONOFF_LABEL is not set CONFIG_SWITCH_ROOT=y # CONFIG_TASKSET is not set # CONFIG_FEATURE_TASKSET_FANCY is not set # CONFIG_UEVENT is not set CONFIG_UMOUNT=y # CONFIG_FEATURE_UMOUNT_ALL is not set CONFIG_UNSHARE=y # CONFIG_WALL is not set # # Common options for mount/umount # CONFIG_FEATURE_MOUNT_LOOP=y CONFIG_FEATURE_MOUNT_LOOP_CREATE=y # CONFIG_FEATURE_MTAB_SUPPORT is not set CONFIG_VOLUMEID=y # # Filesystem/Volume identification # CONFIG_FEATURE_VOLUMEID_BCACHE=y CONFIG_FEATURE_VOLUMEID_BTRFS=y CONFIG_FEATURE_VOLUMEID_CRAMFS=y CONFIG_FEATURE_VOLUMEID_EXFAT=y CONFIG_FEATURE_VOLUMEID_EXT=y CONFIG_FEATURE_VOLUMEID_F2FS=y CONFIG_FEATURE_VOLUMEID_FAT=y CONFIG_FEATURE_VOLUMEID_HFS=y CONFIG_FEATURE_VOLUMEID_ISO9660=y CONFIG_FEATURE_VOLUMEID_JFS=y CONFIG_FEATURE_VOLUMEID_LFS=y CONFIG_FEATURE_VOLUMEID_LINUXRAID=y CONFIG_FEATURE_VOLUMEID_LINUXSWAP=y CONFIG_FEATURE_VOLUMEID_LUKS=y CONFIG_FEATURE_VOLUMEID_MINIX=y CONFIG_FEATURE_VOLUMEID_NILFS=y CONFIG_FEATURE_VOLUMEID_NTFS=y CONFIG_FEATURE_VOLUMEID_OCFS2=y CONFIG_FEATURE_VOLUMEID_REISERFS=y CONFIG_FEATURE_VOLUMEID_ROMFS=y CONFIG_FEATURE_VOLUMEID_SQUASHFS=y CONFIG_FEATURE_VOLUMEID_SYSV=y CONFIG_FEATURE_VOLUMEID_UBIFS=y CONFIG_FEATURE_VOLUMEID_UDF=y CONFIG_FEATURE_VOLUMEID_XFS=y # # Miscellaneous Utilities # # CONFIG_ADJTIMEX is not set CONFIG_BBCONFIG=y CONFIG_FEATURE_COMPRESS_BBCONFIG=y CONFIG_BC=y CONFIG_DC=y CONFIG_FEATURE_DC_BIG=y # CONFIG_FEATURE_DC_LIBM is not set CONFIG_FEATURE_BC_INTERACTIVE=y CONFIG_FEATURE_BC_LONG_OPTIONS=y # CONFIG_BEEP is not set CONFIG_FEATURE_BEEP_FREQ=0 CONFIG_FEATURE_BEEP_LENGTH_MS=0 # CONFIG_CHAT is not set # CONFIG_FEATURE_CHAT_NOFAIL is not set # CONFIG_FEATURE_CHAT_TTY_HIFI is not set # CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set # CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set # CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set # CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set # CONFIG_FEATURE_CHAT_CLR_ABORT is not set # CONFIG_CONSPY is not set CONFIG_CROND=y CONFIG_FEATURE_CROND_D=y CONFIG_FEATURE_CROND_CALL_SENDMAIL=y CONFIG_FEATURE_CROND_SPECIAL_TIMES=y CONFIG_FEATURE_CROND_DIR="@TERMUX_PREFIX@/var/spool/cron" CONFIG_CRONTAB=y # CONFIG_DEVFSD is not set # CONFIG_DEVFSD_MODLOAD is not set # CONFIG_DEVFSD_FG_NP is not set # CONFIG_DEVFSD_VERBOSE is not set # CONFIG_FEATURE_DEVFS is not set # CONFIG_DEVMEM is not set # CONFIG_FBSPLASH is not set # CONFIG_FLASHCP is not set # CONFIG_FLASH_ERASEALL is not set # CONFIG_FLASH_LOCK is not set # CONFIG_FLASH_UNLOCK is not set # CONFIG_HDPARM is not set # CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set # CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set # CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set # CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set # CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set # CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set CONFIG_HEXEDIT=y # CONFIG_I2CGET is not set # CONFIG_I2CSET is not set # CONFIG_I2CDUMP is not set # CONFIG_I2CDETECT is not set # CONFIG_I2CTRANSFER is not set CONFIG_INOTIFYD=y CONFIG_LESS=y CONFIG_FEATURE_LESS_MAXLINES=9999999 CONFIG_FEATURE_LESS_BRACKETS=y CONFIG_FEATURE_LESS_FLAGS=y CONFIG_FEATURE_LESS_TRUNCATE=y CONFIG_FEATURE_LESS_MARKS=y CONFIG_FEATURE_LESS_REGEXP=y CONFIG_FEATURE_LESS_WINCH=y CONFIG_FEATURE_LESS_ASK_TERMINAL=y CONFIG_FEATURE_LESS_DASHCMD=y CONFIG_FEATURE_LESS_LINENUMS=y CONFIG_FEATURE_LESS_RAW=y CONFIG_FEATURE_LESS_ENV=y CONFIG_LSSCSI=y # CONFIG_MAKEDEVS is not set # CONFIG_FEATURE_MAKEDEVS_LEAF is not set # CONFIG_FEATURE_MAKEDEVS_TABLE is not set # CONFIG_MAN is not set # CONFIG_MICROCOM is not set # CONFIG_MT is not set # CONFIG_NANDWRITE is not set # CONFIG_NANDDUMP is not set # CONFIG_PARTPROBE is not set # CONFIG_RAIDAUTORUN is not set # CONFIG_READAHEAD is not set CONFIG_RFKILL=y # CONFIG_RUNLEVEL is not set CONFIG_RX=y # CONFIG_SETFATTR is not set # CONFIG_SETSERIAL is not set CONFIG_STRINGS=y CONFIG_TIME=y # CONFIG_TS is not set CONFIG_TTYSIZE=y # CONFIG_UBIRENAME is not set # CONFIG_UBIATTACH is not set # CONFIG_UBIDETACH is not set # CONFIG_UBIMKVOL is not set # CONFIG_UBIRMVOL is not set # CONFIG_UBIRSVOL is not set # CONFIG_UBIUPDATEVOL is not set # CONFIG_VOLNAME is not set # CONFIG_WATCHDOG is not set # # Networking Utilities # # CONFIG_FEATURE_IPV6 is not set CONFIG_FEATURE_UNIX_LOCAL=y # CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set CONFIG_VERBOSE_RESOLUTION_ERRORS=y # CONFIG_FEATURE_TLS_SHA1 is not set CONFIG_ARP=y CONFIG_ARPING=y CONFIG_BRCTL=y CONFIG_FEATURE_BRCTL_FANCY=y CONFIG_FEATURE_BRCTL_SHOW=y # CONFIG_DNSD is not set # CONFIG_ETHER_WAKE is not set CONFIG_FTPD=y CONFIG_FEATURE_FTPD_WRITE=y CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST=y # CONFIG_FEATURE_FTPD_AUTHENTICATION is not set CONFIG_FTPGET=y CONFIG_FTPPUT=y CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS=y CONFIG_HOSTNAME=y CONFIG_DNSDOMAINNAME=y CONFIG_HTTPD=y CONFIG_FEATURE_HTTPD_RANGES=y # CONFIG_FEATURE_HTTPD_SETUID is not set CONFIG_FEATURE_HTTPD_BASIC_AUTH=y # CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set CONFIG_FEATURE_HTTPD_CGI=y CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR=y CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV=y CONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y CONFIG_FEATURE_HTTPD_ERROR_PAGES=y CONFIG_FEATURE_HTTPD_PROXY=y CONFIG_FEATURE_HTTPD_GZIP=y CONFIG_IFCONFIG=y CONFIG_FEATURE_IFCONFIG_STATUS=y # CONFIG_FEATURE_IFCONFIG_SLIP is not set CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ=y CONFIG_FEATURE_IFCONFIG_HW=y CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y # CONFIG_IFENSLAVE is not set # CONFIG_IFPLUGD is not set # CONFIG_IFUP is not set # CONFIG_IFDOWN is not set CONFIG_IFUPDOWN_IFSTATE_PATH="" # CONFIG_FEATURE_IFUPDOWN_IP is not set # CONFIG_FEATURE_IFUPDOWN_IPV4 is not set # CONFIG_FEATURE_IFUPDOWN_IPV6 is not set # CONFIG_FEATURE_IFUPDOWN_MAPPING is not set # CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set # CONFIG_INETD is not set # CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set # CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set # CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set # CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set # CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set # CONFIG_FEATURE_INETD_RPC is not set CONFIG_IP=y CONFIG_IPADDR=y CONFIG_IPLINK=y CONFIG_IPROUTE=y CONFIG_IPTUNNEL=y CONFIG_IPRULE=y CONFIG_IPNEIGH=y CONFIG_FEATURE_IP_ADDRESS=y CONFIG_FEATURE_IP_LINK=y CONFIG_FEATURE_IP_ROUTE=y CONFIG_FEATURE_IP_ROUTE_DIR="@TERMUX_PREFIX@/etc/iproute2" CONFIG_FEATURE_IP_TUNNEL=y CONFIG_FEATURE_IP_RULE=y CONFIG_FEATURE_IP_NEIGH=y # CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set CONFIG_IPCALC=y CONFIG_FEATURE_IPCALC_LONG_OPTIONS=y CONFIG_FEATURE_IPCALC_FANCY=y # CONFIG_FAKEIDENTD is not set # CONFIG_NAMEIF is not set # CONFIG_FEATURE_NAMEIF_EXTENDED is not set # CONFIG_NBDCLIENT is not set CONFIG_NC=y CONFIG_NETCAT=y CONFIG_NC_SERVER=y CONFIG_NC_EXTRA=y CONFIG_NC_110_COMPAT=y CONFIG_NETSTAT=y CONFIG_FEATURE_NETSTAT_WIDE=y CONFIG_FEATURE_NETSTAT_PRG=y # CONFIG_NSLOOKUP is not set # CONFIG_FEATURE_NSLOOKUP_BIG is not set # CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS is not set # CONFIG_NTPD is not set # CONFIG_FEATURE_NTPD_SERVER is not set # CONFIG_FEATURE_NTPD_CONF is not set # CONFIG_FEATURE_NTP_AUTH is not set CONFIG_PING=y # CONFIG_PING6 is not set CONFIG_FEATURE_FANCY_PING=y CONFIG_PSCAN=y CONFIG_ROUTE=y # CONFIG_SLATTACH is not set # CONFIG_SSL_CLIENT is not set CONFIG_TC=y CONFIG_FEATURE_TC_INGRESS=y CONFIG_TCPSVD=y CONFIG_UDPSVD=y CONFIG_TELNET=y CONFIG_FEATURE_TELNET_TTYPE=y CONFIG_FEATURE_TELNET_AUTOLOGIN=y CONFIG_FEATURE_TELNET_WIDTH=y CONFIG_TELNETD=y CONFIG_FEATURE_TELNETD_STANDALONE=y # CONFIG_FEATURE_TELNETD_INETD_WAIT is not set CONFIG_TFTP=y CONFIG_FEATURE_TFTP_PROGRESS_BAR=y # CONFIG_FEATURE_TFTP_HPA_COMPAT is not set CONFIG_TFTPD=y CONFIG_FEATURE_TFTP_GET=y CONFIG_FEATURE_TFTP_PUT=y CONFIG_FEATURE_TFTP_BLOCKSIZE=y # CONFIG_TFTP_DEBUG is not set # CONFIG_TLS is not set CONFIG_TRACEROUTE=y # CONFIG_TRACEROUTE6 is not set CONFIG_FEATURE_TRACEROUTE_VERBOSE=y CONFIG_FEATURE_TRACEROUTE_USE_ICMP=y CONFIG_TUNCTL=y CONFIG_FEATURE_TUNCTL_UG=y CONFIG_VCONFIG=y CONFIG_WGET=y CONFIG_FEATURE_WGET_LONG_OPTIONS=y CONFIG_FEATURE_WGET_STATUSBAR=y CONFIG_FEATURE_WGET_AUTHENTICATION=y CONFIG_FEATURE_WGET_TIMEOUT=y # CONFIG_FEATURE_WGET_HTTPS is not set # CONFIG_FEATURE_WGET_OPENSSL is not set CONFIG_WHOIS=y # CONFIG_ZCIP is not set # CONFIG_UDHCPD is not set # CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set # CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set CONFIG_DHCPD_LEASES_FILE="" # CONFIG_DUMPLEASES is not set # CONFIG_DHCPRELAY is not set # CONFIG_UDHCPC is not set # CONFIG_FEATURE_UDHCPC_ARPING is not set # CONFIG_FEATURE_UDHCPC_SANITIZEOPT is not set CONFIG_UDHCPC_DEFAULT_SCRIPT="" # CONFIG_UDHCPC6 is not set # CONFIG_FEATURE_UDHCPC6_RFC3646 is not set # CONFIG_FEATURE_UDHCPC6_RFC4704 is not set # CONFIG_FEATURE_UDHCPC6_RFC4833 is not set # CONFIG_FEATURE_UDHCPC6_RFC5970 is not set # CONFIG_FEATURE_UDHCP_PORT is not set CONFIG_UDHCP_DEBUG=0 CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=0 # CONFIG_FEATURE_UDHCP_RFC3397 is not set # CONFIG_FEATURE_UDHCP_8021Q is not set CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="" # # Print Utilities # # CONFIG_LPD is not set # CONFIG_LPR is not set # CONFIG_LPQ is not set # # Mail Utilities # CONFIG_MAKEMIME=y CONFIG_POPMAILDIR=y CONFIG_FEATURE_POPMAILDIR_DELIVERY=y CONFIG_REFORMIME=y CONFIG_FEATURE_REFORMIME_COMPAT=y CONFIG_SENDMAIL=y CONFIG_FEATURE_MIME_CHARSET="us-ascii" # # Process Utilities # CONFIG_FREE=y CONFIG_FUSER=y CONFIG_IOSTAT=y CONFIG_KILL=y CONFIG_KILLALL=y CONFIG_KILLALL5=y CONFIG_LSOF=y CONFIG_MPSTAT=y CONFIG_NMETER=y CONFIG_PGREP=y CONFIG_PKILL=y CONFIG_PIDOF=y CONFIG_FEATURE_PIDOF_SINGLE=y CONFIG_FEATURE_PIDOF_OMIT=y CONFIG_PMAP=y # CONFIG_POWERTOP is not set # CONFIG_FEATURE_POWERTOP_INTERACTIVE is not set CONFIG_PS=y # CONFIG_FEATURE_PS_WIDE is not set # CONFIG_FEATURE_PS_LONG is not set CONFIG_FEATURE_PS_TIME=y # CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS=y CONFIG_PSTREE=y CONFIG_PWDX=y CONFIG_SMEMCAP=y CONFIG_BB_SYSCTL=y CONFIG_TOP=y CONFIG_FEATURE_TOP_INTERACTIVE=y CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y CONFIG_FEATURE_TOP_SMP_CPU=y CONFIG_FEATURE_TOP_DECIMALS=y CONFIG_FEATURE_TOP_SMP_PROCESS=y CONFIG_FEATURE_TOPMEM=y CONFIG_UPTIME=y # CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set CONFIG_WATCH=y CONFIG_FEATURE_SHOW_THREADS=y # # Runit Utilities # CONFIG_CHPST=y CONFIG_SETUIDGID=y # CONFIG_ENVUIDGID is not set CONFIG_ENVDIR=y CONFIG_SOFTLIMIT=y CONFIG_RUNSV=y CONFIG_RUNSVDIR=y # CONFIG_FEATURE_RUNSVDIR_LOG is not set CONFIG_SV=y CONFIG_SV_DEFAULT_SERVICE_DIR="@TERMUX_PREFIX@/var/service" # CONFIG_SVC is not set # CONFIG_SVOK is not set CONFIG_SVLOGD=y # CONFIG_CHCON is not set # CONFIG_GETENFORCE is not set # CONFIG_GETSEBOOL is not set # CONFIG_LOAD_POLICY is not set # CONFIG_MATCHPATHCON is not set # CONFIG_RUNCON is not set # CONFIG_SELINUXENABLED is not set # CONFIG_SESTATUS is not set # CONFIG_SETENFORCE is not set # CONFIG_SETFILES is not set # CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set # CONFIG_RESTORECON is not set # CONFIG_SETSEBOOL is not set # # Shells # CONFIG_SH_IS_ASH=y # CONFIG_SH_IS_HUSH is not set # CONFIG_SH_IS_NONE is not set # CONFIG_BASH_IS_ASH is not set # CONFIG_BASH_IS_HUSH is not set CONFIG_BASH_IS_NONE=y CONFIG_ASH=y CONFIG_ASH_OPTIMIZE_FOR_SIZE=y CONFIG_ASH_INTERNAL_GLOB=y CONFIG_ASH_BASH_COMPAT=y # CONFIG_ASH_BASH_SOURCE_CURDIR is not set CONFIG_ASH_BASH_NOT_FOUND_HOOK=y CONFIG_ASH_JOB_CONTROL=y CONFIG_ASH_ALIAS=y CONFIG_ASH_RANDOM_SUPPORT=y CONFIG_ASH_EXPAND_PRMT=y CONFIG_ASH_IDLE_TIMEOUT=y CONFIG_ASH_MAIL=y CONFIG_ASH_ECHO=y CONFIG_ASH_PRINTF=y CONFIG_ASH_TEST=y CONFIG_ASH_HELP=y CONFIG_ASH_GETOPTS=y CONFIG_ASH_CMDCMD=y # CONFIG_CTTYHACK is not set # CONFIG_HUSH is not set # CONFIG_HUSH_BASH_COMPAT is not set # CONFIG_HUSH_BRACE_EXPANSION is not set # CONFIG_HUSH_LINENO_VAR is not set # CONFIG_HUSH_BASH_SOURCE_CURDIR is not set # CONFIG_HUSH_INTERACTIVE is not set # CONFIG_HUSH_SAVEHISTORY is not set # CONFIG_HUSH_JOB is not set # CONFIG_HUSH_TICK is not set # CONFIG_HUSH_IF is not set # CONFIG_HUSH_LOOPS is not set # CONFIG_HUSH_CASE is not set # CONFIG_HUSH_FUNCTIONS is not set # CONFIG_HUSH_LOCAL is not set # CONFIG_HUSH_RANDOM_SUPPORT is not set # CONFIG_HUSH_MODE_X is not set # CONFIG_HUSH_ECHO is not set # CONFIG_HUSH_PRINTF is not set # CONFIG_HUSH_TEST is not set # CONFIG_HUSH_HELP is not set # CONFIG_HUSH_EXPORT is not set # CONFIG_HUSH_EXPORT_N is not set # CONFIG_HUSH_READONLY is not set # CONFIG_HUSH_KILL is not set # CONFIG_HUSH_WAIT is not set # CONFIG_HUSH_COMMAND is not set # CONFIG_HUSH_TRAP is not set # CONFIG_HUSH_TYPE is not set # CONFIG_HUSH_TIMES is not set # CONFIG_HUSH_READ is not set # CONFIG_HUSH_SET is not set # CONFIG_HUSH_UNSET is not set # CONFIG_HUSH_ULIMIT is not set # CONFIG_HUSH_UMASK is not set # CONFIG_HUSH_GETOPTS is not set # CONFIG_HUSH_MEMLEAK is not set # # Options common to all shells # CONFIG_FEATURE_SH_MATH=y CONFIG_FEATURE_SH_MATH_64=y # CONFIG_FEATURE_SH_MATH_BASE is not set CONFIG_FEATURE_SH_EXTRA_QUIET=y # CONFIG_FEATURE_SH_STANDALONE is not set # CONFIG_FEATURE_SH_NOFORK is not set CONFIG_FEATURE_SH_READ_FRAC=y CONFIG_FEATURE_SH_HISTFILESIZE=y # CONFIG_FEATURE_SH_EMBEDDED_SCRIPTS is not set # # System Logging Utilities # # CONFIG_KLOGD is not set # CONFIG_FEATURE_KLOGD_KLOGCTL is not set # CONFIG_LOGGER is not set # CONFIG_LOGREAD is not set # CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set # CONFIG_SYSLOGD is not set # CONFIG_FEATURE_ROTATE_LOGFILE is not set # CONFIG_FEATURE_REMOTE_LOG is not set # CONFIG_FEATURE_SYSLOGD_DUP is not set # CONFIG_FEATURE_SYSLOGD_CFG is not set CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0 # CONFIG_FEATURE_IPC_SYSLOG is not set CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0 # CONFIG_FEATURE_KMSG_SYSLOG is not set ================================================ FILE: packages/bvi/Makefile.in.patch ================================================ --- bvi-1.4.0/Makefile.in 2014-10-01 11:59:36.000000000 -0700 +++ src/Makefile.in 2017-02-19 00:34:01.662869384 -0800 @@ -72,8 +72,8 @@ @$(INSTALL_DATA) bmore.help $(helpdir) @if [ -f $(bindir)/bview ]; then rm $(bindir)/bview; fi @if [ -f $(bindir)/bvedit ]; then rm $(bindir)/bvedit; fi - @ln $(bindir)/bvi $(bindir)/bview - @ln $(bindir)/bvi $(bindir)/bvedit + @ln -s $(bindir)/bvi $(bindir)/bview + @ln -s $(bindir)/bvi $(bindir)/bvedit installdirs: $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(helpdir) $(man1dir) ================================================ FILE: packages/bvi/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://bvi.sourceforge.net/ TERMUX_PKG_DESCRIPTION="Binary file editor based on vi" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_DEPENDS="ncurses" TERMUX_PKG_VERSION=1.4.1 TERMUX_PKG_SRCURL=http://sourceforge.net/projects/bvi/files/bvi/${TERMUX_PKG_VERSION}/bvi-${TERMUX_PKG_VERSION}.src.tar.gz TERMUX_PKG_SHA256=3035255ca79e0464567d255baa5544f7794e2b7eb791dcc60cc339cf1aa01e28 TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_lib_ncursesw6_addnwstr=yes" TERMUX_PKG_RM_AFTER_INSTALL="share/applications share/pixmaps" ================================================ FILE: packages/bvi/column_number_bugfix.patch ================================================ --- bvi-1.4.0/bvi.c 2014-10-07 13:09:45.000000000 -0700 +++ src/bvi.c 2017-02-19 00:35:24.587363303 -0800 @@ -729,7 +729,6 @@ char *arg; { off_t val; - extern int errno; char *poi; errno = 0; --- bvi-1.4.0/set.c 2014-09-30 05:00:53.000000000 -0700 +++ src/set.c 2017-02-19 00:36:08.927600541 -0800 @@ -135,7 +135,7 @@ if (((COLS - AnzAdd - 1) / 4) >= P(P_CM)) { Anzahl = P(P_CM); } else { - Anzahl = P(P_CM) = ((COLS - AnzAdd - 1) / 4); + Anzahl = P(P_CM) = ((COLS - AnzAdd - 1) / 16) * 4; } maxx = Anzahl * 4 + AnzAdd + 1; Anzahl3 = Anzahl * 3; ================================================ FILE: packages/bvi/comm.c.patch ================================================ diff -u -r ../bvi-1.4.0/comm.c ./comm.c --- ../bvi-1.4.0/comm.c 2014-01-29 14:54:53.000000000 +0000 +++ ./comm.c 2017-07-07 07:11:55.310380582 +0000 @@ -84,10 +84,10 @@ extern char *name; /* actual filename */ extern char **files; /* used for "next" and "rewind" */ extern int numfiles, curfile; -extern int errno; static char oldbuf[CMDSZ]; /** for :!! command **/ +int save_chk(char* fname, char* start, char* end, int flags); /* * docmdline() - handle a colon command ================================================ FILE: packages/byobu/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://byobu.co/ TERMUX_PKG_DESCRIPTION="Byobu is a GPLv3 open source text-based window manager and terminal multiplexer" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=5.130 TERMUX_PKG_SRCURL=https://launchpad.net/byobu/trunk/${TERMUX_PKG_VERSION}/+download/byobu_${TERMUX_PKG_VERSION}.orig.tar.gz TERMUX_PKG_SHA256=47e414161dda124287b9ec1cf94acc716b49e7428c6ec7efeed181f477e17461 TERMUX_PKG_DEPENDS="gawk, tmux" TERMUX_PKG_PLATFORM_INDEPENDENT=true ================================================ FILE: packages/byobu/usr-bin-byobu.in.patch ================================================ diff -u -r ../byobu-5.122/usr/bin/byobu.in ./usr/bin/byobu.in --- ../byobu-5.122/usr/bin/byobu.in 2017-08-09 23:53:48.000000000 +0200 +++ ./usr/bin/byobu.in 2017-09-20 01:31:55.576848354 +0200 @@ -46,7 +46,7 @@ . "$HOME/.byoburc" fi fi -export BYOBU_CHARMAP=$(locale charmap) +export BYOBU_CHARMAP=UTF-8 [ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="@prefix@" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" ================================================ FILE: packages/c-ares/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://c-ares.haxx.se TERMUX_PKG_DESCRIPTION="Library for asynchronous DNS requests (including name resolves)" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=1.15.0 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/c-ares/c-ares/archive/cares-${TERMUX_PKG_VERSION//./_}.tar.gz TERMUX_PKG_SHA256=7deb7872cbd876c29036d5f37e30c4cbc3cc068d59d8b749ef85bb0736649f04 TERMUX_PKG_BREAKS="c-ares-dev" TERMUX_PKG_REPLACES="c-ares-dev" # Build with cmake to install cmake/c-ares/*.cmake files: TERMUX_PKG_FORCE_CMAKE=true TERMUX_PKG_RM_AFTER_INSTALL="bin/" ================================================ FILE: packages/c-ares/disable-ares-android.patch ================================================ diff -u -r ../c-ares-cares-1_15_0/ares_android.c ./ares_android.c --- ../c-ares-cares-1_15_0/ares_android.c 2018-10-23 13:49:22.000000000 +0000 +++ ./ares_android.c 2018-11-01 02:26:38.968483738 +0000 @@ -12,7 +12,7 @@ * this software for any purpose. It is provided "as is" * without express or implied warranty. */ -#if defined(ANDROID) || defined(__ANDROID__) +#if defined(__DISABLED_IN_TERMUX__) #include diff -u -r ../c-ares-cares-1_15_0/ares_init.c ./ares_init.c --- ../c-ares-cares-1_15_0/ares_init.c 2018-10-23 13:49:22.000000000 +0000 +++ ./ares_init.c 2018-11-01 02:29:03.106824681 +0000 @@ -44,7 +44,6 @@ #if defined(ANDROID) || defined(__ANDROID__) #include -#include "ares_android.h" /* From the Bionic sources */ #define DNS_PROP_NAME_PREFIX "net.dns" #define MAX_DNS_PROPERTIES 8 @@ -1549,35 +1548,6 @@ char *domains; size_t num_servers; - /* Use the Android connectivity manager to get a list - * of DNS servers. As of Android 8 (Oreo) net.dns# - * system properties are no longer available. Google claims this - * improves privacy. Apps now need the ACCESS_NETWORK_STATE - * permission and must use the ConnectivityManager which - * is Java only. */ - dns_servers = ares_get_android_server_list(MAX_DNS_PROPERTIES, &num_servers); - if (dns_servers != NULL) - { - for (i = 0; i < num_servers; i++) - { - status = config_nameserver(&servers, &nservers, dns_servers[i]); - if (status != ARES_SUCCESS) - break; - status = ARES_EOF; - } - for (i = 0; i < num_servers; i++) - { - ares_free(dns_servers[i]); - } - ares_free(dns_servers); - } - if (channel->ndomains == -1) - { - domains = ares_get_android_search_domains_list(); - set_search(channel, domains); - ares_free(domains); - } - # ifdef HAVE___SYSTEM_PROPERTY_GET /* Old way using the system property still in place as * a fallback. Older android versions can still use this. diff -u -r ../c-ares-cares-1_15_0/ares_library_init.c ./ares_library_init.c --- ../c-ares-cares-1_15_0/ares_library_init.c 2018-10-23 13:49:22.000000000 +0000 +++ ./ares_library_init.c 2018-11-01 02:26:38.972483691 +0000 @@ -30,10 +30,6 @@ fpGetBestRoute2_t ares_fpGetBestRoute2 = ZERO_NULL; #endif -#if defined(ANDROID) || defined(__ANDROID__) -#include "ares_android.h" -#endif - /* library-private global vars with source visibility restricted to this file */ static unsigned int ares_initialized; @@ -174,10 +170,6 @@ if (ares_init_flags & ARES_LIB_INIT_WIN32) ares_win32_cleanup(); -#if defined(ANDROID) || defined(__ANDROID__) - ares_library_cleanup_android(); -#endif - ares_init_flags = ARES_LIB_INIT_NONE; ares_malloc = malloc; ares_realloc = realloc; ================================================ FILE: packages/c-ares/fix-path-etc-hosts.patch ================================================ diff -uNr c-ares-1.13.0/ares_private.h c-ares-1.13.0.mod/ares_private.h --- c-ares-1.13.0/ares_private.h 2017-06-16 15:53:03.000000000 +0300 +++ c-ares-1.13.0.mod/ares_private.h 2017-09-12 11:24:17.332992105 +0300 @@ -84,7 +84,7 @@ #ifdef ETC_INET #define PATH_HOSTS "/etc/inet/hosts" #else -#define PATH_HOSTS "/etc/hosts" +#define PATH_HOSTS "@TERMUX_PREFIX@/etc/hosts" #endif #endif ================================================ FILE: packages/c-toxcore/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://tox.chat TERMUX_PKG_DESCRIPTION="Backend library for the Tox protocol" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.2.10 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=5ccc4ecd79b95c367efe8341b06bf2a81f853032e6fcd7cb2bc0ad0ef7419d40 TERMUX_PKG_SRCURL=https://github.com/TokTok/toxcore/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="libsodium" TERMUX_PKG_BREAKS="c-toxcore-dev" TERMUX_PKG_REPLACES="c-toxcore-dev" #TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DCMAKE_INSTALL_PREFIX=${TERMUX_PREFIX} -DCMAKE_INSTALL_LIBDIR=${TERMUX_PREFIX}/lib -DBOOTSTRAP_DAEMON=off -DDHT_BOOTSTRAP=off -DBUILD_TOXAV=off -DBUILD_AV_TEST=off " ================================================ FILE: packages/ca-certificates/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://curl.haxx.se/docs/caextract.html TERMUX_PKG_DESCRIPTION="Common CA certificates" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=20200101 TERMUX_PKG_SRCURL=https://curl.haxx.se/ca/cacert.pem # If the checksum has changed, it may be time to update the package version: TERMUX_PKG_SHA256=adf770dfd574a0d6026bfaa270cb6879b063957177a991d453ff1d302c02081f TERMUX_PKG_SKIP_SRC_EXTRACT=true TERMUX_PKG_PLATFORM_INDEPENDENT=true termux_step_make_install() { local CERTDIR=$TERMUX_PREFIX/etc/tls local CERTFILE=$CERTDIR/cert.pem mkdir -p $CERTDIR termux_download $TERMUX_PKG_SRCURL \ $CERTFILE \ $TERMUX_PKG_SHA256 touch $CERTFILE # Build java keystore which is split out into a ca-certificates-java subpackage: local KEYUTIL_JAR=$TERMUX_PKG_CACHEDIR/keyutil-0.4.0.jar termux_download \ https://github.com/use-sparingly/keyutil/releases/download/0.4.0/keyutil-0.4.0.jar \ $KEYUTIL_JAR \ 18f1d2c82839d84949b1ad015343c509e81ef678c24db6112acc6c0761314610 local JAVA_KEYSTORE_DIR=$PREFIX/lib/jvm/openjdk-9/lib/security mkdir -p $JAVA_KEYSTORE_DIR java -jar $KEYUTIL_JAR \ --import \ --new-keystore $JAVA_KEYSTORE_DIR/jssecacerts \ --password changeit \ --force-new-overwrite \ --import-pem-file $CERTFILE } ================================================ FILE: packages/ca-certificates/ca-certificates-java.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="lib/jvm" TERMUX_SUBPKG_DESCRIPTION="Common CA certificates (java keystore format)" TERMUX_SUBPKG_PLATFORM_INDEPENDENT=true ================================================ FILE: packages/cabextract/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.cabextract.org.uk/ TERMUX_PKG_DESCRIPTION="A program to extract Microsoft cabinet (.CAB) files" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.9.1 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://cabextract.org.uk/cabextract-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=afc253673c8ef316b4d5c29cc4aa8445844bee14afffbe092ee9469405851ca7 ================================================ FILE: packages/caddy/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://caddyserver.com/ TERMUX_PKG_DESCRIPTION="Fast, cross-platform HTTP/2 web server" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_VERSION=1.0.4 TERMUX_PKG_SRCURL=https://github.com/mholt/caddy/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=bf81245d2b347c89a8e8aa358a224b722d55cb6e1c266bbdffbe6acc54d130a5 termux_step_make() { termux_setup_golang export GOPATH=$TERMUX_PKG_BUILDDIR mkdir -p $GOPATH/src/github.com/mholt/ cp -a $TERMUX_PKG_SRCDIR $GOPATH/src/github.com/mholt/caddy cd $GOPATH/src/github.com/mholt/caddy/caddy export GO111MODULE=on go build } termux_step_make_install() { install -Dm700 $GOPATH/src/github.com/mholt/caddy/caddy/caddy \ $TERMUX_PREFIX/bin/caddy } ================================================ FILE: packages/calcurse/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://calcurse.org/ TERMUX_PKG_DESCRIPTION="calcurse is a calendar and scheduling application for the command line" TERMUX_PKG_LICENSE="BSD 2-Clause" TERMUX_PKG_VERSION=4.5.1 TERMUX_PKG_SRCURL=https://calcurse.org/files/calcurse-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=5336576824cba7d40eee0b33213992b4304368972ef556a930f3965e9068f331 TERMUX_PKG_DEPENDS="libandroid-support, ncurses" termux_step_pre_configure() { export ac_cv_lib_pthread_pthread_create=yes } ================================================ FILE: packages/calcurse/io.c.patch ================================================ diff -u -r ../calcurse-4.4.0/src/io.c ./src/io.c --- ../calcurse-4.4.0/src/io.c 2019-02-04 20:44:04.000000000 +0000 +++ ./src/io.c 2019-03-01 20:49:16.393057747 +0000 @@ -1399,7 +1399,6 @@ EXIT_IF(delay < 0, _("Invalid delay")); char *mesg = _("Periodic save: data files have changed. Save cancelled."); - pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); for (;;) { sleep(delay * MININSEC); pthread_mutex_lock(&io_periodic_save_mutex); @@ -1424,8 +1423,7 @@ /* Lock the mutex to avoid cancelling the thread during saving. */ pthread_mutex_lock(&io_periodic_save_mutex); - pthread_cancel(io_t_psave); - pthread_join(io_t_psave, NULL); + pthread_kill(io_t_psave, 0); pthread_mutex_unlock(&io_periodic_save_mutex); io_t_psave = pthread_self(); } ================================================ FILE: packages/calcurse/src-notify.c.patch ================================================ diff -u -r ../calcurse-4.4.0/src/notify.c ./src/notify.c --- ../calcurse-4.4.0/src/notify.c 2019-01-18 22:38:58.000000000 +0000 +++ ./src/notify.c 2019-03-01 20:45:55.019585998 +0000 @@ -196,8 +196,7 @@ if (pthread_equal(notify_t_main, pthread_self())) return; - pthread_cancel(notify_t_main); - pthread_join(notify_t_main, NULL); + pthread_kill(notify_t_main, 0); notify_t_main = pthread_self(); } ================================================ FILE: packages/calcurse/src-ui-calendar.c.patch ================================================ diff -u -r ../calcurse-4.4.0/src/ui-calendar.c ./src/ui-calendar.c --- ../calcurse-4.4.0/src/ui-calendar.c 2019-01-18 22:38:58.000000000 +0000 +++ ./src/ui-calendar.c 2019-03-01 20:47:58.622033795 +0000 @@ -123,8 +123,7 @@ if (pthread_equal(ui_calendar_t_date, pthread_self())) return; - pthread_cancel(ui_calendar_t_date); - pthread_join(ui_calendar_t_date, NULL); + pthread_kill(ui_calendar_t_date, 0); ui_calendar_t_date = pthread_self(); } ================================================ FILE: packages/capstone/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.capstone-engine.org/ TERMUX_PKG_DESCRIPTION="Lightweight multi-platform, multi-architecture disassembly framework" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=4.0.1 TERMUX_PKG_REVISION=3 TERMUX_PKG_SRCURL=https://github.com/aquynh/capstone/archive/$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=79bbea8dbe466bd7d051e037db5961fdb34f67c9fac5c3471dd105cfb1e05dc7 TERMUX_PKG_BREAKS="capstone-dev" TERMUX_PKG_REPLACES="capstone-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-DINSTALL_LIB_DIR=$TERMUX_PREFIX/lib" ================================================ FILE: packages/cava/Makefile.am.patch ================================================ diff -uNr cava-0.6.1/Makefile.am cava-0.6.1.mod/Makefile.am --- cava-0.6.1/Makefile.am 2018-05-03 19:07:33.000000000 +0300 +++ cava-0.6.1.mod/Makefile.am 2019-08-16 13:48:27.945938729 +0300 @@ -11,7 +11,7 @@ bin_PROGRAMS = cava cava_SOURCES = cava.c cava_LDADD = -liniparser -cava_LDFLAGS = -L/usr/local/lib -Wl,-rpath /usr/local/lib +cava_LDFLAGS = cava_CPPFLAGS = -DPACKAGE=\"$(PACKAGE)\" -DVERSION=\"$(VERSION)\" \ -D_POSIX_SOURCE -D _POSIX_C_SOURCE=200809L cava_CFLAGS = -std=c99 -Wall -Wextra -Wno-unused-result -Wno-maybe-uninitialized ================================================ FILE: packages/cava/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/karlstav/cava TERMUX_PKG_DESCRIPTION="Console-based Audio Visualizer. Works with MPD and Pulseaudio" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Oliver Schmidhauser @Neo-Oli" TERMUX_PKG_VERSION=0.6.1 TERMUX_PKG_REVISION=3 TERMUX_PKG_SHA256=98b880e7e704ed457863f379f31b488e06076bb34a5de02825096969b916a78d TERMUX_PKG_SRCURL=https://github.com/karlstav/cava/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="ncurses,fftw,pulseaudio" TERMUX_PKG_BUILD_DEPENDS="libtool" TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { ./autogen.sh } ================================================ FILE: packages/cava/config.c.patch ================================================ diff --git a/config.c b/config.c index 1da11cd..2e9ddd8 100644 --- a/config.c +++ b/config.c @@ -396,7 +396,7 @@ if (strcmp(inputMethod, "alsa") == 0) { } if (strcmp(inputMethod, "fifo") == 0) { p->im = 2; - p->audio_source = (char *)iniparser_getstring(ini, "input:source", "/tmp/mpd.fifo"); + p->audio_source = (char *)iniparser_getstring(ini, "input:source", "@TERMUX_PREFIX@/tmp/mpd.fifo"); } if (strcmp(inputMethod, "pulse") == 0) { p->im = 3; ================================================ FILE: packages/cava/configure.ac.patch ================================================ diff --git a/configure.ac b/configure.ac index 6e3c291..c9d706e 100644 --- a/configure.ac +++ b/configure.ac @@ -31,9 +31,9 @@ dnl ###################### AC_CHECK_HEADERS([pthread.h], AC_CHECK_LIB(pthread, pthread_create, LIBS="$LIBS -lpthread", - AC_MSG_ERROR([pthread.h found but there is no pthread library to make use of]) + AC_MSG_NOTICE([pthread.h found but there is no pthread library to make use of]) ), - AC_MSG_ERROR([no pthread.h header header file found]) + AC_MSG_NOTICE([no pthread.h header header file found]) ) @@ -152,7 +152,7 @@ AS_IF([test "x$enable_legacy_iniparser" = "xyes"], [ dnl ############################ dnl Set font directory dnl ############################ -DEFAULT_FONT_DIR="/usr/share/consolefonts" +DEFAULT_FONT_DIR="@TERMUX_PREFIX@/share/consolefonts" AC_ARG_VAR(FONT_DIR, [Directory where the font will be installed.]) if test -z "$FONT_DIR" ; then FONT_DIR="$DEFAULT_FONT_DIR" ================================================ FILE: packages/cboard/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://benkibbey.wordpress.com/cboard/ TERMUX_PKG_DESCRIPTION="PGN browser, editor and chess engine frontend" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=0.7.5 TERMUX_PKG_SHA256=dd748039f3531653e1573577cd814741524e1b16e16e3a841ef512e5150da6a0 TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/c-board/${TERMUX_PKG_VERSION}/cboard-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_DEPENDS="libandroid-support,libandroid-glob,gnuchess, ncurses, ncurses-ui-libs" termux_step_pre_configure() { CFLAGS+=" -DLINE_MAX=_POSIX2_LINE_MAX" LDFLAGS+=" -landroid-glob" if $TERMUX_DEBUG; then # When doing debug build, -D_FORTIFY_SOURCE=2 gives this error: # /home/builder/.termux-build/cboard/src/libchess/pgn.c:2235:33: error: 'umask' called with invalid mode # mode = umask(600); export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/} fi } ================================================ FILE: packages/cboard/configure.patch ================================================ diff -uNr cboard-0.7.5/configure cboard-0.7.5.mod/configure --- cboard-0.7.5/configure 2018-09-27 17:48:24.000000000 +0300 +++ cboard-0.7.5.mod/configure 2019-08-16 14:05:44.294565834 +0300 @@ -12194,13 +12194,8 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Unix98 pty support" >&5 $as_echo_n "checking for Unix98 pty support... " >&6; } -if test -c "/dev/ptmx"; then - have_ptmx=yes -else - have_ptmx=no -fi - -ptmx_works=no +have_ptmx=yes +ptmx_works=yes if test "x$have_ptmx" = "xyes"; then ac_ext=c @@ -12210,40 +12205,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -\ - #include - #include - #include - #include - - int main() - { - int fd; - - if ((fd = open("/dev/ptmx", O_RDWR)) == -1) - exit(1); - - if (ptsname(fd) == NULL) - exit(1); - - exit(0); - } - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : ptmx_works=yes -else - ptmx_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext fi ================================================ FILE: packages/cboard/libchess-pgn.c.patch ================================================ diff -u -r ../cboard-0.7.5/libchess/pgn.c ./libchess/pgn.c --- ../cboard-0.7.5/libchess/pgn.c 2018-09-17 15:58:48.000000000 +0000 +++ ./libchess/pgn.c 2018-12-19 00:16:27.204984323 +0000 @@ -883,7 +883,6 @@ time_t now; char tbuf[11] = { 0 }; struct tm *tp; - struct passwd *pw = getpwuid (getuid ()); char host[64] = { 0 }; time (&now); @@ -904,7 +903,7 @@ if (pgn_tag_add (&g->tag, (char *) "Round", (char *) "-") != E_PGN_OK) warn ("pgn_tag_add()"); - if (pgn_tag_add (&g->tag, (char *) "White", pw->pw_gecos) != E_PGN_OK) + if (pgn_tag_add (&g->tag, (char *) "White", (char *) "You") != E_PGN_OK) warn ("pgn_tag_add()"); if (pgn_tag_add (&g->tag, (char *) "Black", (char *) "?") != E_PGN_OK) ================================================ FILE: packages/ccache/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://ccache.samba.org TERMUX_PKG_DESCRIPTION="Compiler cache for fast recompilation of C/C++ code" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas" TERMUX_PKG_VERSION=3.7.6 TERMUX_PKG_SRCURL=https://github.com/ccache/ccache/releases/download/v$TERMUX_PKG_VERSION/ccache-$TERMUX_PKG_VERSION.tar.xz TERMUX_PKG_SHA256=73e2633ac9bca387b5a39c72a8f85634670c4091dab639228c433898163c86c0 TERMUX_PKG_DEPENDS="zlib" ================================================ FILE: packages/ccnet/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/haiwen/ccnet TERMUX_PKG_DESCRIPTION="Ccnet is a framework for writing networked applications in C" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=6.1.8 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/haiwen/ccnet/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=b55636bf95232dc1db70d3604d0bebb7c3d730292d15b9b6c5b951307eb69762 TERMUX_PKG_DEPENDS="libuuid, libevent, libsearpc, libsqlite, openssl" TERMUX_PKG_BREAKS="ccnet-dev" TERMUX_PKG_REPLACES="ccnet-dev" TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { ./autogen.sh } termux_step_post_configure() { # the package has trouble to prepare some headers cd $TERMUX_PKG_SRCDIR/lib python $TERMUX_PREFIX/bin/searpc-codegen.py ../lib/rpc_table.py } ================================================ FILE: packages/ccnet/configure.ac.patch ================================================ --- ../ccnet/configure.ac 2018-04-26 19:00:41.309901710 +0200 +++ ./configure.ac 2018-04-28 10:50:43.956523129 +0200 @@ -76,7 +76,7 @@ fi fi -AC_CHECK_LIB(pthread, pthread_create, [echo "found library pthread"], AC_MSG_ERROR([*** Unable to find pthread library]), ) +#AC_CHECK_LIB(pthread, pthread_create, [echo "found library pthread"], AC_MSG_ERROR([*** Unable to find pthread library]), ) AC_CHECK_LIB(sqlite3, sqlite3_open,[echo "found library sqlite3"] , AC_MSG_ERROR([*** Unable to find sqlite3 library]), ) AC_CHECK_LIB(crypto, SHA1_Init, [echo "found library crypto"], AC_MSG_ERROR([*** Unable to find openssl crypto library]), ) @@ -98,6 +98,7 @@ PTHREAD_LIBS=-lpthread fi +PTHREAD_LIBS= AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_LIBS) @@ -153,6 +154,8 @@ LIB_DIRWATCH= fi +LIB_RESOLV="" + AC_SUBST(LIB_WS32) AC_SUBST(LIB_GDI32) AC_SUBST(LIB_RT) ================================================ FILE: packages/ccrypt/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://ccrypt.sourceforge.net/ TERMUX_PKG_DESCRIPTION="Secure encryption and decryption of files and streams utility" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.11 TERMUX_PKG_SHA256=b19c47500a96ee5fbd820f704c912f6efcc42b638c0a6aa7a4e3dc0a6b51a44f TERMUX_PKG_SRCURL=http://ccrypt.sourceforge.net/download/$TERMUX_PKG_VERSION/ccrypt-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_DEPENDS="libcrypt" ================================================ FILE: packages/cgdb/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://cgdb.github.io/ TERMUX_PKG_DESCRIPTION="A lightweight curses (terminal-based) interface to the GNU Debugger (GDB)" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=0.7.1 TERMUX_PKG_SRCURL=https://cgdb.me/files/cgdb-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=bb723be58ec68cb59a598b8e24a31d10ef31e0e9c277a4de07b2f457fe7de198 TERMUX_PKG_DEPENDS="libc++, ncurses, readline, gdb" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" ac_cv_lib_ncursesw6_addnwstr=yes ac_cv_file__dev_ptmx=yes ac_cv_func_setpgrp_void=true ac_cv_rl_version=7 ac_cv_file__proc_self_status=yes " TERMUX_PKG_RM_AFTER_INSTALL="share/applications share/pixmaps" ================================================ FILE: packages/cgdb/cgdb.cpp.patch ================================================ --- ../cache/cgdb-0.7.0/cgdb/cgdb.cpp 2017-03-10 16:44:18.000000000 +0000 +++ ./cgdb/cgdb.cpp 2018-10-10 05:05:23.164961985 +0000 @@ -1523,10 +1523,10 @@ /* Shut down debugger */ tgdb_shutdown(tgdb); - +#if !defined(__ANDROID__) if (tty_set_attributes(STDIN_FILENO, &term_attributes) == -1) clog_error(CLOG_CGDB, "tty_reset error"); - +#endif /* Close our logfiles */ tgdb_close_logfiles(); @@ -1577,10 +1577,10 @@ masterfd = pty_pair_get_masterfd(pty_pair); if (masterfd == -1) return -1; - +#if !defined(__ANDROID__) if (tty_off_xon_xoff(slavefd) == -1) - return -1; - + return -1; +#endif /* The 16 is because I don't know how many char's the directory separator * is going to be, I expect it to be 1, but who knows. */ length = strlen(cgdb_home_dir) + strlen(readline_history_filename) + 16; @@ -1768,12 +1768,12 @@ clog_error(CLOG_CGDB, "Unable to init readline"); cgdb_cleanup_and_exit(-1); } - +#if !defined(__ANDROID__) if (tty_cbreak(STDIN_FILENO, &term_attributes) == -1) { clog_error(CLOG_CGDB, "tty_cbreak error"); cgdb_cleanup_and_exit(-1); } - +#endif if (init_kui() == -1) { clog_error(CLOG_CGDB, "init_kui error"); cgdb_cleanup_and_exit(-1); ================================================ FILE: packages/chromaprint/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://acoustid.org/chromaprint TERMUX_PKG_DESCRIPTION="C library for generating audio fingerprints used by AcoustID" TERMUX_PKG_LICENSE="LGPL-2.1, MIT" TERMUX_PKG_VERSION=1.4.3 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/acoustid/chromaprint/releases/download/v${TERMUX_PKG_VERSION}/chromaprint-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=ea18608b76fb88e0203b7d3e1833fb125ce9bb61efe22c6e169a50c52c457f82 TERMUX_PKG_DEPENDS=ffmpeg TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-DCMAKE_BUILD_TYPE=Release -DBUILD_TOOLS=ON -DBUILD_SHARED_LIBS=ON" termux_step_post_make_install() { ln -sf "${TERMUX_PREFIX}/lib/libchromaprint.so" "${TERMUX_PREFIX}/lib/libchromaprint.so.${TERMUX_PKG_VERSION:0:1}" ln -sf "${TERMUX_PREFIX}/lib/libchromaprint.so" "${TERMUX_PREFIX}/lib/libchromaprint.so.${TERMUX_PKG_VERSION}" } ================================================ FILE: packages/clamav/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.clamav.net/ TERMUX_PKG_DESCRIPTION="Anti-virus toolkit for Unix" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.102.1 TERMUX_PKG_SRCURL=https://www.clamav.net/downloads/production/clamav-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=0dbda8d0d990d068732966f13049d112a26dce62145d234383467c1d877dedd6 TERMUX_PKG_DEPENDS="json-c, libandroid-support, libbz2, libc++, libcurl, libltdl, liblzma, libxml2, openssl, pcre2, zlib" TERMUX_PKG_BREAKS="clamav-dev" TERMUX_PKG_REPLACES="clamav-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --sysconfdir=$TERMUX_PREFIX/etc/clamav --with-libcurl=$TERMUX_PREFIX --with-pcre=$TERMUX_PREFIX --with-libjson=$TERMUX_PREFIX --with-openssl=$TERMUX_PREFIX --with-xml=$TERMUX_PREFIX --with-zlib=$TERMUX_PREFIX --disable-clamonacc --disable-llvm --disable-dns" TERMUX_PKG_RM_AFTER_INSTALL=" share/man/man5/clamav-milter.conf.5 share/man/man8/clamav-milter.8" TERMUX_PKG_CONFFILES=" etc/clamav/clamd.conf etc/clamav/freshclam.conf" termux_step_pre_configure() { export OBJC=$CC LDFLAGS+=" -llog" } termux_step_post_make_install() { for conf in clamd.conf freshclam.conf; do sed "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|" \ "$TERMUX_PKG_BUILDER_DIR"/$conf.in \ > "$TERMUX_PREFIX"/etc/clamav/$conf done unset conf } termux_step_post_massage() { mkdir -p "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX"/var/lib/clamav mkdir -p "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX"/var/log/clamav } ================================================ FILE: packages/clamav/clamd.conf.in ================================================ ## ## Please read the clamd.conf(5) manual for more information about ## available options. ## ## Server configuration. LocalSocket @TERMUX_PREFIX@/var/run/clamd.sock LocalSocketMode 600 PidFile @TERMUX_PREFIX@/var/run/clamd.pid TemporaryDirectory @TERMUX_PREFIX@/tmp DatabaseDirectory @TERMUX_PREFIX@/var/lib/clamav ## Scanner configuration. ExcludePath ^/proc/ ExcludePath ^/sys/ FollowDirectorySymlinks no FollowFileSymlinks yes CrossFilesystems no ExtendedDetectionInfo yes AllowAllMatchScan yes AlertOLE2Macros yes DetectPUA yes IncludePUA Packed IncludePUA RAT IncludePUA Spy MaxScanSize 128M MaxFileSize 128M Bytecode yes ## Logging. LogSyslog no LogVerbose no LogFile @TERMUX_PREFIX@/var/log/clamav/clamd.log LogTime yes LogRotate yes ================================================ FILE: packages/clamav/configure.patch ================================================ diff -uNr clamav-0.102.0/configure clamav-0.102.0.mod/configure --- clamav-0.102.0/configure 2019-10-01 20:24:08.000000000 +0300 +++ clamav-0.102.0.mod/configure 2019-11-02 23:32:29.043631184 +0200 @@ -26711,7 +26711,7 @@ have_fanotify="no" if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" + THREAD_LIBS="" TH_SAFE="-thread-safe" if test "$want_fanotify" = "yes"; then ac_fn_c_check_header_mongrel "$LINENO" "sys/fanotify.h" "ac_cv_header_sys_fanotify_h" "$ac_includes_default" ================================================ FILE: packages/clamav/fix-hardcoded-paths.patch ================================================ diff -uNr clamav-0.102.0/clamd/others.c clamav-0.102.0.mod/clamd/others.c --- clamav-0.102.0/clamd/others.c 2019-10-01 20:24:08.000000000 +0300 +++ clamav-0.102.0.mod/clamd/others.c 2019-11-02 23:33:45.510545519 +0200 @@ -159,7 +159,7 @@ /* We can only call async-signal-safe functions after fork(). */ pid = fork(); if (pid == 0) { /* child */ - exit(execle("/bin/sh", "sh", "-c", buffer_cmd, NULL, env)); + exit(execle("@TERMUX_PREFIX@/bin/sh", "sh", "-c", buffer_cmd, NULL, env)); } else if (pid > 0) { /* parent */ pthread_mutex_unlock(&virusaction_lock); while (waitpid(pid, NULL, 0) == -1 && errno == EINTR) continue; diff -uNr clamav-0.102.0/libclamav/others_common.c clamav-0.102.0.mod/libclamav/others_common.c --- clamav-0.102.0/libclamav/others_common.c 2019-10-01 20:24:09.000000000 +0300 +++ clamav-0.102.0.mod/libclamav/others_common.c 2019-11-02 23:33:19.087126614 +0200 @@ -460,7 +460,7 @@ #ifdef _WIN32 #define P_tmpdir "C:\\" #else -#define P_tmpdir "/tmp" +#define P_tmpdir "@TERMUX_PREFIX@/tmp" #endif /* _WIN32 */ #endif /* P_tmpdir */ diff -uNr clamav-0.102.0/shared/optparser.c clamav-0.102.0.mod/shared/optparser.c --- clamav-0.102.0/shared/optparser.c 2019-10-01 20:24:09.000000000 +0300 +++ clamav-0.102.0.mod/shared/optparser.c 2019-11-02 23:40:11.705398185 +0200 @@ -192,7 +192,7 @@ {"PreludeAnalyzerName", "prelude-analyzer-name", 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD, "Name of the analyzer as seen in prewikka", ""}, - {"LogFile", "log", 'l', CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD | OPT_MILTER | OPT_CLAMSCAN | OPT_CLAMDSCAN | OPT_CLAMONACC, "Save all reports to a log file.", "/tmp/clamav.log"}, + {"LogFile", "log", 'l', CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD | OPT_MILTER | OPT_CLAMSCAN | OPT_CLAMDSCAN | OPT_CLAMONACC, "Save all reports to a log file.", "@TERMUX_PREFIX@/tmp/clamav.log"}, {"LogFileUnlock", NULL, 0, CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_MILTER, "By default the log file is locked for writing and only a single\ndaemon process can write to it. This option disables the lock.", "yes"}, @@ -212,17 +212,17 @@ {"ExtendedDetectionInfo", NULL, 0, CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD, "Log additional information about the infected file, such as its\nsize and hash, together with the virus name.", "yes"}, - {"PidFile", "pid", 'p', CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM | OPT_MILTER, "Save the process ID to a file.", "/var/run/clam.pid"}, + {"PidFile", "pid", 'p', CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM | OPT_MILTER, "Save the process ID to a file.", "@TERMUX_PREFIX@/var/run/clam.pid"}, - {"TemporaryDirectory", "tempdir", 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD | OPT_MILTER | OPT_CLAMSCAN | OPT_SIGTOOL, "This option allows you to change the default temporary directory.", "/tmp"}, + {"TemporaryDirectory", "tempdir", 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD | OPT_MILTER | OPT_CLAMSCAN | OPT_SIGTOOL, "This option allows you to change the default temporary directory.", "@TERMUX_PREFIX@/tmp"}, - {"DatabaseDirectory", "datadir", 0, CLOPT_TYPE_STRING, NULL, -1, DATADIR, 0, OPT_CLAMD | OPT_FRESHCLAM | OPT_SIGTOOL, "This option allows you to change the default database directory.\nIf you enable it, please make sure it points to the same directory in\nboth clamd and freshclam.", "/var/lib/clamav"}, + {"DatabaseDirectory", "datadir", 0, CLOPT_TYPE_STRING, NULL, -1, DATADIR, 0, OPT_CLAMD | OPT_FRESHCLAM | OPT_SIGTOOL, "This option allows you to change the default database directory.\nIf you enable it, please make sure it points to the same directory in\nboth clamd and freshclam.", "@TERMUX_PREFIX@/var/lib/clamav"}, {"OfficialDatabaseOnly", "official-db-only", 0, CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_CLAMSCAN, "Only load the official signatures published by the ClamAV project.", "no"}, {"YaraRules", "yara-rules", 0, CLOPT_TYPE_STRING, NULL, 0, NULL, 0, OPT_CLAMSCAN, "By default, yara rules will be loaded. This option allows you to exclude yara rules when scanning and also to scan only using yara rules. Valid options are yes|no|only", "yes"}, - {"LocalSocket", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD, "Path to a local socket file the daemon will listen on.", "/tmp/clamd.socket"}, + {"LocalSocket", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD, "Path to a local socket file the daemon will listen on.", "@TERMUX_PREFIX@/tmp/clamd.socket"}, {"LocalSocketGroup", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD, "Sets the group ownership on the unix socket.", "virusgroup"}, @@ -271,7 +271,7 @@ {"DisableCache", "disable-cache", 0, CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_CLAMSCAN, "This option allows you to disable clamd's caching feature.", "no"}, - {"VirusEvent", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD, "Execute a command when a virus is found. In the command string %v will be\nreplaced with the virus name. Additionally, two environment variables will\nbe defined: $CLAM_VIRUSEVENT_FILENAME and $CLAM_VIRUSEVENT_VIRUSNAME.", "/usr/bin/mailx -s \"ClamAV VIRUS ALERT: %v\" alert < /dev/null"}, + {"VirusEvent", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD, "Execute a command when a virus is found. In the command string %v will be\nreplaced with the virus name. Additionally, two environment variables will\nbe defined: $CLAM_VIRUSEVENT_FILENAME and $CLAM_VIRUSEVENT_VIRUSNAME.", "@TERMUX_PREFIX@/bin/mailx -s \"ClamAV VIRUS ALERT: %v\" alert < /dev/null"}, {"ExitOnOOM", NULL, 0, CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD, "Stop the daemon when libclamav reports an out of memory condition.", "yes"}, @@ -447,7 +447,7 @@ /* Freshclam-only entries */ /* FIXME: drop this entry and use LogFile */ - {"UpdateLogFile", "log", 'l', CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_FRESHCLAM, "Save all reports to a log file.", "/var/log/freshclam.log"}, + {"UpdateLogFile", "log", 'l', CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_FRESHCLAM, "Save all reports to a log file.", "@TERMUX_PREFIX@/var/log/freshclam.log"}, {"DatabaseOwner", "user", 'u', CLOPT_TYPE_STRING, NULL, -1, CLAMAVUSER, FLAG_REQUIRED, OPT_FRESHCLAM, "When started by root freshclam will drop privileges and switch to the user\ndefined in this option.", CLAMAVUSER}, @@ -530,7 +530,7 @@ {"ClamdSocket", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, FLAG_MULTIPLE, OPT_MILTER, "Define the clamd socket to connect to for scanning.\nThis option is mandatory! Syntax:\n ClamdSocket unix:path\n ClamdSocket tcp:host:port\nThe first syntax specifies a local unix socket (needs an absolute path) e.g.:\n ClamdSocket unix:/var/run/clamd/clamd.socket\nThe second syntax specifies a tcp local or remote tcp socket: the\nhost can be a hostname or an ip address; the \":port\" field is only required\nfor IPv6 addresses, otherwise it defaults to 3310\n ClamdSocket tcp:192.168.0.1\nThis option can be repeated several times with different sockets or even\nwith the same socket: clamd servers will be selected in a round-robin fashion.", "tcp:scanner.mydomain:7357"}, - {"MilterSocket", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "Define the interface through which we communicate with sendmail.\nThis option is mandatory! Possible formats are:\n[[unix|local]:]/path/to/file - to specify a unix domain socket;\ninet:port@[hostname|ip-address] - to specify an ipv4 socket;\ninet6:port@[hostname|ip-address] - to specify an ipv6 socket.", "/tmp/clamav-milter.socket\ninet:7357"}, + {"MilterSocket", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "Define the interface through which we communicate with sendmail.\nThis option is mandatory! Possible formats are:\n[[unix|local]:]/path/to/file - to specify a unix domain socket;\ninet:port@[hostname|ip-address] - to specify an ipv4 socket;\ninet6:port@[hostname|ip-address] - to specify an ipv6 socket.", "@TERMUX_PREFIX@/tmp/clamav-milter.socket\ninet:7357"}, {"MilterSocketGroup", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "Define the group ownership for the (unix) milter socket.", "virusgroup"}, @@ -554,7 +554,7 @@ {"Chroot", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "Chroot to the specified directory.\nChrooting is performed just after reading the config file and before\ndropping privileges.", "/newroot"}, - {"Whitelist", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "This option specifies a file which contains a list of basic POSIX regular\nexpressions. Addresses (sent to or from - see below) matching these regexes\nwill not be scanned. Optionally each line can start with the string \"From:\"\nor \"To:\" (note: no whitespace after the colon) indicating if it is,\nrespectively, the sender or recipient that is to be whitelisted.\nIf the field is missing, \"To:\" is assumed.\nLines starting with #, : or ! are ignored.", "/etc/whitelisted_addresses"}, + {"Whitelist", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "This option specifies a file which contains a list of basic POSIX regular\nexpressions. Addresses (sent to or from - see below) matching these regexes\nwill not be scanned. Optionally each line can start with the string \"From:\"\nor \"To:\" (note: no whitespace after the colon) indicating if it is,\nrespectively, the sender or recipient that is to be whitelisted.\nIf the field is missing, \"To:\" is assumed.\nLines starting with #, : or ! are ignored.", "@TERMUX_PREFIX@/etc/clamav/whitelisted_addresses"}, {"SkipAuthenticated", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "Messages from authenticated SMTP users matching this extended POSIX\nregular expression (egrep-like) will not be scanned.\nAs an alternative, a file containing a plain (not regex) list of names (one\nper line) can be specified using the prefix \"file:\".\ne.g. SkipAuthenticated file:/etc/good_guys\n\nNote: this is the AUTH login name!", "SkipAuthenticated ^(tom|dick|henry)$"}, ================================================ FILE: packages/clamav/freshclam.conf.in ================================================ # Path to the database directory. DatabaseDirectory @TERMUX_PREFIX@/var/lib/clamav # database.clamav.net is now the primary domain name to be used world-wide. # Now that CloudFlare is being used as our Content Delivery Network (CDN), # this one domain name works world-wide to direct freshclam to the closest # geographic endpoint. DatabaseMirror database.clamav.net ================================================ FILE: packages/clamav/no-lutimes.patch ================================================ diff -uNr clamav-0.101.1/libclamunrar/os.hpp clamav-0.101.1.mod/libclamunrar/os.hpp --- clamav-0.101.1/libclamunrar/os.hpp 2018-12-19 22:48:30.000000000 +0200 +++ clamav-0.101.1.mod/libclamunrar/os.hpp 2019-01-28 16:34:22.808817627 +0200 @@ -167,7 +167,9 @@ #if defined(__linux) || defined(__FreeBSD__) #include -#define USE_LUTIMES +#ifdef __ANDROID__ +#undef USE_LUTIMES +#endif #endif #define ENABLE_ACCESS ================================================ FILE: packages/cmake/Modules-CMakeDetermineSystem.cmake.patch ================================================ diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index dc208c600..f3ec4da2d 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -43,7 +43,7 @@ if(CMAKE_HOST_UNIX) else() exec_program(${CMAKE_UNAME} ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION) endif() - if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*|Darwin|^GNU$") + if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*|Darwin|^GNU$|Android") exec_program(${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR RETURN_VALUE val) if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin" AND ================================================ FILE: packages/cmake/Modules-Platform-Android-Clang.cmake.patch ================================================ diff --git a/Modules/Platform/Android-Clang.cmake b/Modules/Platform/Android-Clang.cmake index 9ed1e01f9..6443512ee 100644 --- a/Modules/Platform/Android-Clang.cmake +++ b/Modules/Platform/Android-Clang.cmake @@ -24,6 +24,12 @@ if(CMAKE_SYSTEM_VERSION EQUAL 1) return() endif() +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android") + macro(__android_compiler_clang lang) + endmacro() + return() +endif() + include(Platform/Android-Common) # The NDK toolchain configuration files at: ================================================ FILE: packages/cmake/Modules-Platform-Android-Determine-Compiler.cmake.patch ================================================ diff --git a/Modules/Platform/Android/Determine-Compiler.cmake b/Modules/Platform/Android/Determine-Compiler.cmake index a03ebcc29..34d527741 100644 --- a/Modules/Platform/Android/Determine-Compiler.cmake +++ b/Modules/Platform/Android/Determine-Compiler.cmake @@ -31,6 +31,14 @@ elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") set(_ANDROID_HOST_EXT "") elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") set(_ANDROID_HOST_EXT ".exe") +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android") + macro(__android_determine_compiler lang) + # Do nothing + endmacro() + if(NOT CMAKE_CXX_COMPILER_NAMES) + set(CMAKE_CXX_COMPILER_NAMES c++) + endif() + return() else() message(FATAL_ERROR "Android: Builds hosted on '${CMAKE_HOST_SYSTEM_NAME}' not supported.") endif() ================================================ FILE: packages/cmake/Modules-Platform-Android-Determine.cmake.patch ================================================ diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake index bb42eedde..0e8229d5e 100644 --- a/Modules/Platform/Android-Determine.cmake +++ b/Modules/Platform/Android-Determine.cmake @@ -18,6 +18,10 @@ if(CMAKE_SYSTEM_VERSION EQUAL 1) return() endif() +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android") + return() +endif() + cmake_policy(PUSH) cmake_policy(SET CMP0057 NEW) # if IN_LIST ================================================ FILE: packages/cmake/Modules-Platform-Android-Initialize.cmake.patch ================================================ diff --git a/Modules/Platform/Android-Initialize.cmake b/Modules/Platform/Android-Initialize.cmake index a434f90ea..407ed3358 100644 --- a/Modules/Platform/Android-Initialize.cmake +++ b/Modules/Platform/Android-Initialize.cmake @@ -17,6 +17,10 @@ if(CMAKE_SYSTEM_VERSION EQUAL 1) return() endif() +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android") + return() +endif() + if(NOT CMAKE_SYSROOT) if(CMAKE_ANDROID_NDK) set(CMAKE_SYSROOT "${CMAKE_ANDROID_NDK}/platforms/android-${CMAKE_SYSTEM_VERSION}/arch-${CMAKE_ANDROID_ARCH}") ================================================ FILE: packages/cmake/Modules-Platform-Android.cmake.patch ================================================ diff --git a/Modules/Platform/Android.cmake b/Modules/Platform/Android.cmake index f08f84176..9e719df39 100644 --- a/Modules/Platform/Android.cmake +++ b/Modules/Platform/Android.cmake @@ -2,6 +2,10 @@ include(Platform/Linux) set(ANDROID 1) +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android") + return() +endif() + # Conventionally Android does not use versioned soname # But in modern versions it is acceptable if(NOT DEFINED CMAKE_PLATFORM_NO_VERSIONED_SONAME) ================================================ FILE: packages/cmake/Source-CMakeLists.txt.patch ================================================ diff -u -r ../cmake-3.15.2/Source/CMakeLists.txt ./Source/CMakeLists.txt --- ../cmake-3.15.2/Source/CMakeLists.txt 2019-08-07 16:58:29.000000000 +0000 +++ ./Source/CMakeLists.txt 2019-08-21 10:42:07.237355685 +0000 @@ -759,7 +759,7 @@ # GHS support # Works only for windows and linux -if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux") +if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android") set(SRCS ${SRCS} cmGlobalGhsMultiGenerator.cxx cmGlobalGhsMultiGenerator.h ================================================ FILE: packages/cmake/Source-cmExecProgramCommand.cxx.patch ================================================ diff -u -r ../cmake-3.15.2/Source/cmExecProgramCommand.cxx ./Source/cmExecProgramCommand.cxx --- ../cmake-3.15.2/Source/cmExecProgramCommand.cxx 2019-08-07 16:58:29.000000000 +0000 +++ ./Source/cmExecProgramCommand.cxx 2019-08-18 20:05:17.156753010 +0000 @@ -205,7 +205,7 @@ } fflush(stdout); fflush(stderr); - const char* cmd[] = { "/bin/sh", "-c", command.c_str(), nullptr }; + const char* cmd[] = { "@TERMUX_PREFIX@/bin/sh", "-c", command.c_str(), nullptr }; cmsysProcess_SetCommand(cp, cmd); #endif ================================================ FILE: packages/cmake/Source-cmLocalUnixMakefileGenerator3.cxx.patch ================================================ diff -u -r ../cmake-3.2.2/Source/cmLocalUnixMakefileGenerator3.cxx ./Source/cmLocalUnixMakefileGenerator3.cxx --- ../cmake-3.2.2/Source/cmLocalUnixMakefileGenerator3.cxx 2015-04-13 13:09:00.000000000 -0400 +++ ./Source/cmLocalUnixMakefileGenerator3.cxx 2015-05-24 16:04:48.182697757 -0400 @@ -743,7 +743,7 @@ #if !defined(__VMS) makefileStream << "# The shell in which to execute make rules.\n" - << "SHELL = /bin/sh\n" + << "SHELL = @TERMUX_PREFIX@/bin/sh\n" << "\n"; #endif } ================================================ FILE: packages/cmake/Source-cmStateSnapshot.cxx.patch ================================================ diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index 63bec710b..19286c50e 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -316,11 +316,15 @@ void cmStateSnapshot::SetDefaultDefinitions() this->SetDefinition("UNIX", "1"); this->SetDefinition("CMAKE_HOST_UNIX", "1"); +#if defined(__ANDROID__) + this->SetDefinition("CMAKE_HOST_SYSTEM_NAME", "Android"); +#else struct utsname uts_name; if (uname(&uts_name) >= 0) { this->SetDefinition("CMAKE_HOST_SYSTEM_NAME", uts_name.sysname); } #endif +#endif #if defined(__CYGWIN__) std::string legacy; if (cmSystemTools::GetEnv("CMAKE_LEGACY_CYGWIN_WIN32", legacy) && ================================================ FILE: packages/cmake/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://cmake.org/ TERMUX_PKG_DESCRIPTION="Family of tools designed to build, test and package software" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=3.15.5 TERMUX_PKG_SRCURL=https://www.cmake.org/files/v${TERMUX_PKG_VERSION:0:4}/cmake-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=fbdd7cef15c0ced06bb13024bfda0ecc0dedbcaaaa6b8a5d368c75255243beb4 TERMUX_PKG_DEPENDS="libarchive, libc++, libcurl, libexpat, jsoncpp, libuv, rhash, make, clang, zlib" TERMUX_PKG_FORCE_CMAKE=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-DKWSYS_LFS_WORKS=ON -DBUILD_CursesDialog=ON" ================================================ FILE: packages/cmake/cmake-curses-gui.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="bin/ccmake" TERMUX_SUBPKG_DESCRIPTION="Curses based user interface for CMake (ccmake)" TERMUX_SUBPKG_DEPENDS="ncurses-ui-libs" ================================================ FILE: packages/cmark/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/github/cmark TERMUX_PKG_DESCRIPTION="CommonMark parsing and rendering program" TERMUX_PKG_LICENSE="BSD 2-Clause" TERMUX_PKG_VERSION=0.29.0.gfm.0 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=6a94aeaa59a583fadcbf28de81dea8641b3f56d935dda5b2447a3c8df6c95fea TERMUX_PKG_BREAKS="cmark-dev" TERMUX_PKG_REPLACES="cmark-dev" TERMUX_PKG_SRCURL=https://github.com/github/cmark/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-DCMAKE_INSTALL_LIBDIR=$TERMUX_PREFIX/lib" termux_step_post_make_install() { cd $TERMUX_PREFIX/bin ln -f -s cmark-gfm cmark cd $TERMUX_PREFIX/share/man/man1 ln -f -s cmark-gfm.1 cmark.1 } ================================================ FILE: packages/cmatrix/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/abishekvashok/cmatrix TERMUX_PKG_DESCRIPTION="Command producing a Matrix-style animation" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=2.0 TERMUX_PKG_SHA256=ad93ba39acd383696ab6a9ebbed1259ecf2d3cf9f49d6b97038c66f80749e99a TERMUX_PKG_SRCURL=https://github.com/abishekvashok/cmatrix/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--mandir=$TERMUX_PREFIX/share/man" TERMUX_PKG_DEPENDS="ncurses" termux_step_pre_configure() { autoreconf -i export ac_cv_file__usr_lib_kbd_consolefonts=no export ac_cv_file__usr_share_consolefonts=no export ac_cv_file__usr_lib_X11_fonts_misc=no export ac_cv_file__usr_X11R6_lib_X11_fonts_misc=no } ================================================ FILE: packages/cmus/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://cmus.github.io/ TERMUX_PKG_DESCRIPTION="Small, fast and powerful console music player" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.8.0 TERMUX_PKG_REVISION=5 TERMUX_PKG_DEPENDS="libandroid-support, libiconv, ncurses, pulseaudio, ffmpeg, libmad, opusfile, libflac, libvorbis" TERMUX_PKG_SRCURL=https://github.com/cmus/cmus/archive/2748d40bb670558b523d5b47b4af442e82c7ffd2.tar.gz TERMUX_PKG_SHA256=37b5a1889a97cdfd319880bc5925c179119330163315dc3f408145c66d352f6b TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { LD=$CC export CUE_LIBS=" -lm" export CONFIG_OSS=n } termux_step_configure() { ./configure prefix=$TERMUX_PREFIX } ================================================ FILE: packages/cmus/checks.patch ================================================ --- ./scripts/checks.sh.orig 2015-07-13 10:00:56.000000000 +0000 +++ ./scripts/checks.sh 2017-03-08 01:07:20.393468934 +0000 @@ -450,8 +450,8 @@ __exe=`tmp_file prog` echo "$1" > $__src || exit 1 shift - __cmd="$CC $__src -o $__exe $CFLAGS $LDFLAGS $@" - $CC $__src -o $__exe $CFLAGS $LDFLAGS "$@" 2>/dev/null + __cmd="$CC $__src -o $__exe $CFLAGS $CPPFLAGS $LDFLAGS $@" + $CC $__src -o $__exe $CFLAGS $CPPFLAGS $LDFLAGS "$@" 2>/dev/null ;; cxx) __src=`tmp_file prog.cc` ================================================ FILE: packages/cmus/configure.patch ================================================ --- ./configure.orig 2015-07-13 10:00:56.000000000 +0000 +++ ./configure 2017-03-07 21:29:44.492136734 +0000 @@ -117,7 +117,7 @@ msg_checking "for working ncurses setup" for flag in "" "-I/usr/include/ncurses" "-I/usr/include/ncursesw" do - if try_compile_link "$ncurses_code" $flag $NCURSES_LIBS + if try_compile_link "$ncurses_code" $NCURSES_CFLAGS $flag $NCURSES_LIBS then NCURSES_CFLAGS="$NCURSES_CFLAGS $flag" msg_result yes ================================================ FILE: packages/cmusfm/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/Arkq/cmusfm TERMUX_PKG_DESCRIPTION="Last.fm standalone scrobbler for the cmus music player" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=0.3.3 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/Arkq/cmusfm/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=9d9fa7df01c3dd7eecd72656e61494acc3b0111c07ddb18be0ad233110833b63 TERMUX_PKG_DEPENDS=libcurl termux_step_pre_configure() { autoreconf --install } ================================================ FILE: packages/codecrypt/autogen.sh.patch ================================================ diff -uNr codecrypt-1.8/autogen.sh codecrypt-1.8.mod/autogen.sh --- codecrypt-1.8/autogen.sh 2017-10-31 22:42:06.000000000 +0200 +++ codecrypt-1.8.mod/autogen.sh 2019-04-25 01:43:13.982529470 +0300 @@ -3,10 +3,10 @@ # simple autogen script that generates basic layout for autotools. NAME="ccr" -COMMON_CPPFLAGS="-I/usr/local/include" +COMMON_CPPFLAGS="" COMMON_CFLAGS="-Wall" COMMON_CXXFLAGS="${COMMON_CFLAGS} -std=c++11" -COMMON_LDFLAGS="-L/usr/local/lib" +COMMON_LDFLAGS="" COMMON_LDADD="" OUT=Makefile.am ================================================ FILE: packages/codecrypt/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://e-x-a.org/codecrypt/ TERMUX_PKG_DESCRIPTION="The post-quantum cryptography tool" TERMUX_PKG_LICENSE="LGPL-3.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.8 TERMUX_PKG_REVISION=8 TERMUX_PKG_SRCURL=https://github.com/exaexa/codecrypt/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=25f11bc361b4f8aca7245698334b5715b7d594d708a75e8cdb2aa732dc46eb96 TERMUX_PKG_DEPENDS="cryptopp, fftw, libgmp" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-cryptopp" termux_step_pre_configure() { ./autogen.sh export LIBS="-lm" export CRYPTOPP_CFLAGS="-I$TERMUX_PREFIX/include" export CRYPTOPP_LIBS="-L$TERMUX_PREFIX/lib -lcryptopp" } ================================================ FILE: packages/codecrypt/getpass.patch ================================================ diff -uNr codecrypt-1.8/src/pwrng.cpp codecrypt-1.8.mod/src/pwrng.cpp --- codecrypt-1.8/src/pwrng.cpp 2017-10-31 22:42:06.000000000 +0200 +++ codecrypt-1.8.mod/src/pwrng.cpp 2019-04-24 22:56:36.290265068 +0300 @@ -23,38 +23,17 @@ #include "iohelpers.h" #include -#if (HAVE_READPASSPHRASE == 1) -#include -#elif (HAVE_BSDREADPASSPHRASE == 1) -#include -#else -#warning "Falling back to getpass(3), which is marked obsolete!" -/* If you see this, you might as well want to take the readpassphrase() - * implementation from e.g. openssh's openbsd-compat and put it here. */ #include -#endif #define MAX_PW_LEN 1024 //like if someone enjoyed typing that. + static bool read_password (const std::string&prompt, std::string&pw) { -#if (HAVE_READPASSPHRASE == 1 || HAVE_BSDREADPASSPHRASE==1) - /* readpassphrase reads at most bufsiz-1 bytes and gets the terminating - * zero just right */ - std::vector pwbuf; - pwbuf.resize (MAX_PW_LEN, 0); - if (!readpassphrase (prompt.c_str(), pwbuf.data(), MAX_PW_LEN, - RPP_REQUIRE_TTY)) - return false; - - pw = pwbuf.data(); - return true; -#else char* pass = getpass (prompt.c_str()); if (!pass) return false; pw = pass; return true; -#endif } bool pw_rng::seed_from_user_password (const std::string&reason, ================================================ FILE: packages/colordiff/Makefile.patch ================================================ diff -u -r ../colordiff-1.0.18/Makefile ./Makefile --- ../colordiff-1.0.18/Makefile 2016-11-12 13:12:14.000000000 +0100 +++ ./Makefile 2017-06-06 22:31:52.645026869 +0200 @@ -37,8 +37,6 @@ install -d ${DESTDIR}${ETC_DIR}; \ fi cp colordiffrc ${DESTDIR}${ETC_DIR}/colordiffrc - -chown root.root ${DESTDIR}${ETC_DIR}/colordiffrc - chmod 644 ${DESTDIR}${ETC_DIR}/colordiffrc .PHONY: uninstall uninstall: ================================================ FILE: packages/colordiff/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.colordiff.org/ TERMUX_PKG_DESCRIPTION="Tool to colorize 'diff' output" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Oliver Schmidhauser @Neo-Oli" TERMUX_PKG_VERSION=1.0.18 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=http://www.colordiff.org/colordiff-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=29cfecd8854d6e19c96182ee13706b84622d7b256077df19fbd6a5452c30d6e0 TERMUX_PKG_DEPENDS="perl" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_PLATFORM_INDEPENDENT=true termux_step_make() { # Skip the 'make' invocation as it only tries to # rebuild the documentation. continue } termux_step_post_configure() { export INSTALL_DIR=${PREFIX}/bin export MAN_DIR=${PREFIX}/share/man/man1 export ETC_DIR=${PREFIX}/etc } ================================================ FILE: packages/command-not-found/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/termux/command-not-found TERMUX_PKG_DESCRIPTION="Suggest installation of packages in interactive shell sessions" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_VERSION=1.42 TERMUX_PKG_SRCURL=https://github.com/termux/command-not-found/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=eb3b5c23bb574f7e4c5c78d9e97fb54af2fbe98a589efe6eb629287089e5efc2 ================================================ FILE: packages/coreutils/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/coreutils/ TERMUX_PKG_DESCRIPTION="Basic file, shell and text manipulation utilities from the GNU project" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=8.31 TERMUX_PKG_REVISION=8 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/coreutils/coreutils-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=ff7a9c918edce6b4f4b2725e3f9b37b0c4d193531cac49a48b56c4d0d3a9e9fd TERMUX_PKG_DEPENDS="libandroid-support, libgmp, libiconv" TERMUX_PKG_BREAKS="chroot, busybox (<< 1.30.1-4)" TERMUX_PKG_REPLACES="chroot, busybox (<< 1.30.1-4)" TERMUX_PKG_ESSENTIAL=true # pinky has no usage on Android. # df does not work either, let system binary prevail. # $PREFIX/bin/env is provided by busybox for shebangs to work directly. # users and who doesn't work and does not make much sense for Termux. # uptime is provided by procps. TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" gl_cv_host_operating_system=Android ac_cv_func_getpass=yes --disable-xattr --enable-no-install-program=pinky,df,users,who,uptime --enable-single-binary=symlinks --with-gmp " termux_step_pre_configure() { CPPFLAGS+=" -DDEFAULT_TMPDIR=\\\"$TERMUX_PREFIX/tmp\\\"" CPPFLAGS+=" -D__USE_FORTIFY_LEVEL=0" # On device build is unsupported as it removes utility 'ln' (and maybe # something else) in the installation process. if $TERMUX_ON_DEVICE_BUILD; then termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds." fi } ================================================ FILE: packages/coreutils/configure.patch ================================================ diff -u -r ../coreutils-8.31/configure ./configure --- ../coreutils-8.31/configure 2019-03-10 23:35:43.000000000 +0000 +++ ./configure 2019-04-18 14:08:40.316645642 +0000 @@ -43326,7 +43326,7 @@ # Determine how to get the list of mounted file systems. - ac_list_mounted_fs= + ac_list_mounted_fs=found # If the getmntent function is available but not in the standard library, # make sure LIBS contains the appropriate -l option. ================================================ FILE: packages/coreutils/fix-paths.patch ================================================ diff -uNr coreutils-8.30/lib/getusershell.c coreutils-8.30.mod/lib/getusershell.c --- coreutils-8.30/lib/getusershell.c 2018-05-14 07:20:31.000000000 +0300 +++ coreutils-8.30.mod/lib/getusershell.c 2019-03-01 20:16:36.731319198 +0200 @@ -56,7 +56,7 @@ static char const* const default_shells[] = { ADDITIONAL_DEFAULT_SHELLS - "/bin/sh", "/bin/csh", "/usr/bin/sh", "/usr/bin/csh", NULL + "@TERMUX_PREFIX@/bin/sh", "@TERMUX_PREFIX@/bin/bash", "@TERMUX_PREFIX@/bin/ash", "@TERMUX_PREFIX@/bin/csh", NULL }; /* Index of the next shell in 'default_shells' to return. diff -uNr coreutils-8.30/lib/tempname.c coreutils-8.30.mod/lib/tempname.c --- coreutils-8.30/lib/tempname.c 2018-05-14 07:22:38.000000000 +0300 +++ coreutils-8.30.mod/lib/tempname.c 2019-03-01 20:14:04.073892964 +0200 @@ -33,7 +33,7 @@ #include #ifndef P_tmpdir -# define P_tmpdir "/tmp" +# define P_tmpdir "@TERMUX_PREFIX@/tmp" #endif #ifndef TMP_MAX # define TMP_MAX 238328 @@ -149,8 +149,8 @@ { if (direxists (P_tmpdir)) dir = P_tmpdir; - else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp")) - dir = "/tmp"; + else if (strcmp (P_tmpdir, "@TERMUX_PREFIX@/tmp") != 0 && direxists ("@TERMUX_PREFIX@/tmp")) + dir = "@TERMUX_PREFIX@/tmp"; else { __set_errno (ENOENT); diff -uNr coreutils-8.30/src/mktemp.c coreutils-8.30.mod/src/mktemp.c --- coreutils-8.30/src/mktemp.c 2018-05-14 07:20:24.000000000 +0300 +++ coreutils-8.30.mod/src/mktemp.c 2019-03-01 20:12:37.923442265 +0200 @@ -270,7 +270,7 @@ else if (dest_dir_arg && *dest_dir_arg) dest_dir = dest_dir_arg; else - dest_dir = "/tmp"; + dest_dir = "@TERMUX_PREFIX@/tmp"; if (last_component (template) != template) die (EXIT_FAILURE, 0, @@ -284,7 +284,7 @@ else { char *env = getenv ("TMPDIR"); - dest_dir = (env && *env ? env : "/tmp"); + dest_dir = (env && *env ? env : "@TERMUX_PREFIX@/tmp"); } if (IS_ABSOLUTE_FILE_NAME (template)) die (EXIT_FAILURE, 0, diff -uNr coreutils-8.30/src/sort.c coreutils-8.30.mod/src/sort.c --- coreutils-8.30/src/sort.c 2018-05-14 07:20:24.000000000 +0300 +++ coreutils-8.30.mod/src/sort.c 2019-03-01 20:13:40.883773368 +0200 @@ -105,7 +105,7 @@ #endif #ifndef DEFAULT_TMPDIR -# define DEFAULT_TMPDIR "/tmp" +# define DEFAULT_TMPDIR "@TERMUX_PREFIX@/tmp" #endif /* Maximum number of lines to merge every time a NODE is taken from diff -uNr coreutils-8.30/src/split.c coreutils-8.30.mod/src/split.c --- coreutils-8.30/src/split.c 2018-05-14 07:20:24.000000000 +0300 +++ coreutils-8.30.mod/src/split.c 2019-03-01 20:15:52.004434545 +0200 @@ -481,7 +481,7 @@ pid_t child_pid; char const *shell_prog = getenv ("SHELL"); if (shell_prog == NULL) - shell_prog = "/bin/sh"; + shell_prog = "@TERMUX_PREFIX@/bin/sh"; if (setenv ("FILE", name, 1) != 0) die (EXIT_FAILURE, errno, _("failed to set FILE environment variable")); diff -uNr coreutils-8.30/src/tac.c coreutils-8.30.mod/src/tac.c --- coreutils-8.30/src/tac.c 2018-05-14 07:20:24.000000000 +0300 +++ coreutils-8.30.mod/src/tac.c 2019-03-01 20:13:29.470380749 +0200 @@ -67,7 +67,7 @@ #ifndef DEFAULT_TMPDIR -# define DEFAULT_TMPDIR "/tmp" +# define DEFAULT_TMPDIR "@TERMUX_PREFIX@/tmp" #endif /* The number of bytes per atomic read. */ ================================================ FILE: packages/coreutils/nohup.c.patch ================================================ Fix error: call to '__umask_invalid_mode' declared with attribute error: umask called with invalid mode on android-21 diff -u -r ../coreutils-8.23/src/nohup.c ./src/nohup.c --- ../coreutils-8.23/src/nohup.c 2014-07-11 07:00:07.000000000 -0400 +++ ./src/nohup.c 2014-12-14 15:22:47.939242789 -0500 @@ -141,7 +141,7 @@ char const *file = "nohup.out"; int flags = O_CREAT | O_WRONLY | O_APPEND; mode_t mode = S_IRUSR | S_IWUSR; - mode_t umask_value = umask (~mode); + mode_t umask_value = umask (0777 & ~mode); out_fd = (redirecting_stdout ? fd_reopen (STDOUT_FILENO, file, flags, mode) : open (file, flags, mode)); ================================================ FILE: packages/coreutils/pwd.c.patch ================================================ diff -u -r ../coreutils-8.23/src/pwd.c ./src/pwd.c --- ../coreutils-8.23/src/pwd.c 2014-07-13 18:09:52.000000000 -0400 +++ ./src/pwd.c 2015-05-17 19:58:20.692454980 -0400 @@ -366,7 +366,7 @@ if (optind < argc) error (0, 0, _("ignoring non-option arguments")); - if (logical) + if (true) /* Termux: Always try logical, to avoid permission denied on /data/data */ { wd = logical_getcwd (); if (wd) ================================================ FILE: packages/coreutils/src-ls.c.patch ================================================ diff -u -r ../coreutils-8.26/src/ls.c ./src/ls.c --- ../coreutils-8.26/src/ls.c 2016-11-22 15:04:32.000000000 -0500 +++ ./src/ls.c 2016-11-30 20:27:28.910732105 -0500 @@ -1749,6 +1749,9 @@ } } + /* Termux patch: Default to colors if terminal. The --color option may override this. */ + print_with_color = isatty(STDOUT_FILENO); + while (true) { int oi = -1; ================================================ FILE: packages/coreutils/tests/tails-c-flag.sh ================================================ # https://github.com/termux/termux-app/issues/232 set -e -u RESULT=$(echo -n 123456 | tail -c 3) if [ "$RESULT" != 456 ]; then echo "Test failed - expectd 456, got $RESULT" exit 1 fi ================================================ FILE: packages/corkscrew/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://wiki.linuxquestions.org/wiki/Corkscrew TERMUX_PKG_DESCRIPTION="A tool for tunneling SSH through HTTP proxies" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_DEPENDS="openssh" TERMUX_PKG_VERSION=2.0 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://dl.bintray.com/termux/upstream/corkscrew-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=0d0fcbb41cba4a81c4ab494459472086f377f9edb78a2e2238ed19b58956b0be termux_step_post_make_install() { # Corkscrew does not distribute a man page, use one from debian: mkdir -p $TERMUX_PREFIX/share/man/man1 cp $TERMUX_PKG_BUILDER_DIR/corkscrew.1 $TERMUX_PREFIX/share/man/man1 } ================================================ FILE: packages/corkscrew/corkscrew.1 ================================================ .\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" ======================================================================== .\" .IX Title "corkscrew 1" .TH corkscrew 1 "2013-05-23" "corkscrew" "Networking" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" corkscrew \- Tunnel TCP connections through HTTP proxies .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& corkscrew PROXY PROXYPORT TARGETHOST TARGETPORT [AUTH_FILE] .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" corkscrew is a simple tool to tunnel \s-1TCP\s0 connections through an \s-1HTTP\s0 proxy supporting the \s-1CONNECT\s0 method. It reads stdin and writes to std\- out during the connection, just like netcat. It can be used for instance to connect to an \s-1SSH\s0 server running on a remote 443 port through a strict \s-1HTTPS\s0 proxy. .IP "\s-1PROXY\s0" 4 .IX Item "PROXY" The name of the host running the \s-1HTTP\s0 proxy. .IP "\s-1PROXYPORT\s0" 4 .IX Item "PROXYPORT" The port on which to connect on the proxy. .IP "\s-1TARGET\s0" 4 .IX Item "TARGET" The host to reach through the proxy. .IP "\s-1TARGETPORT\s0" 4 .IX Item "TARGETPORT" The port to connect to on the target host. .IP "\s-1AUTH_\s0 \s-1FILE\s0" 4 .IX Item "AUTH_ FILE" The auth file is made of one single line containing your username and password in the form .Sp .Vb 1 \& username:password .Ve .SH "OPTIONS" .IX Header "OPTIONS" None. .SH "EXAMPLES" .IX Header "EXAMPLES" The common usage of corkscrew is to put the following line in ~/.ssh/ssh_config: .PP .Vb 1 \& ProxyCommand corkscrew proxy proxyport %h %p [] .Ve .PP This will let the ssh connection go through the proxy with the help of corkscrew. .SH "ENVIRONMENT" .IX Header "ENVIRONMENT" None. .SH "FILES" .IX Header "FILES" None. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIssh_config\fR\|(5) .SH "AUTHORS" .IX Header "AUTHORS" Program was written by Pat Padgett . .PP This manual page was written by Laurent Fousse for the Debian \s-1GNU\s0 system (but may be used by others). Updated by Jari Aalto . Released under license \s-1GNU\s0 \s-1GPL\s0 version 2 or (at your option) any later version. For more information about license, visit . ================================================ FILE: packages/cowsay/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://en.wikipedia.org/wiki/Cowsay TERMUX_PKG_DESCRIPTION="Program which generates ASCII pictures of a cow with a message" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=3.04 TERMUX_PKG_SRCURL=http://http.debian.net/debian/pool/main/c/cowsay/cowsay_3.03+dfsg1.orig.tar.gz TERMUX_PKG_SHA256=10bae895d9afb2d720d2211db58f396352b00fe1386c369ca3608cbf6497b839 TERMUX_PKG_DEPENDS="perl" TERMUX_PKG_PLATFORM_INDEPENDENT=true termux_step_make_install() { cd $TERMUX_PKG_SRCDIR sh install.sh } ================================================ FILE: packages/cowsay/install.sh.patch ================================================ Only in .: install.pl diff -u -r ../cowsay-3.03+dfsg1/install.sh ./install.sh --- ../cowsay-3.03+dfsg1/install.sh 1999-11-01 15:19:21.000000000 -0500 +++ ./install.sh 2016-04-14 21:14:44.715683710 -0400 @@ -14,55 +14,8 @@ filelist='cows' -cat </dev/null 2>&1; then - echo Found a good perl in $perl - goodperls="$goodperls $perl" - fi -done -echo The following perl executables will run cowsay: -echo $goodperls -echo I recommend the latest stable perl you can find. -set $goodperls -if [ -z "$1" ]; then - echo Ack! You do not have Perl 5 installed correctly! - echo Get thee to CPAN! - exit 1 -fi -usethisperl=$1 -echo I will be using $1 because I know it will work. - -echo Now I need an installation prefix. I will use /usr/local unless -printf "you give me a better idea here: " -if [ -n "$backdoor" ]; then - prefix=$backdoor - printf "%s (specified on command line)\n" $prefix -else - read prefix -fi - -PREFIX=${prefix:-/usr/local} +usethisperl=@TERMUX_PREFIX@/bin/perl +PREFIX=@TERMUX_PREFIX@ echo Okay, time to install this puppy. @@ -70,13 +23,13 @@ echo s,%PREFIX%,$PREFIX,\; >> install.pl set -x mkdir -p $PREFIX/bin || (mkdir $PREFIX; mkdir $PREFIX/bin) -$usethisperl -p install.pl cowsay > $PREFIX/bin/cowsay +perl -p install.pl cowsay > $PREFIX/bin/cowsay chmod a+x $PREFIX/bin/cowsay ln -s cowsay $PREFIX/bin/cowthink -mkdir -p $PREFIX/man/man1 || ($mkdir $PREFIX; mkdir $PREFIX/man; mkdir $PREFIX/man/man1) -$usethisperl -p install.pl cowsay.1 > $PREFIX/man/man1/cowsay.1 -chmod a+r $PREFIX/man/man1/cowsay.1 -ln -s cowsay.1 $PREFIX/man/man1/cowthink.1 +mkdir -p $PREFIX/share/man/man1 +perl -p install.pl cowsay.1 > $PREFIX/share/man/man1/cowsay.1 +chmod a+r $PREFIX/share/man/man1/cowsay.1 +(cd $PREFIX/share/man/man1; ln -f -s cowsay.1 cowthink.1 ) mkdir -p $PREFIX/share/cows || (mkdir $PREFIX; mkdir $PREFIX/share; mkdir $PREFIX/share/cows) tar -cf - $filelist | (cd $PREFIX/share && tar -xvf -) set +x ================================================ FILE: packages/cpio/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/cpio/ TERMUX_PKG_DESCRIPTION="CPIO implementation from the GNU project" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.12 TERMUX_PKG_SHA256=70998c5816ace8407c8b101c9ba1ffd3ebbecba1f5031046893307580ec1296e TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/cpio/cpio-$TERMUX_PKG_VERSION.tar.bz2 TERMUX_PKG_DEPENDS="tar" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-rmt=$TERMUX_PREFIX/libexec/rmt" ================================================ FILE: packages/cppi/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/cppi/ TERMUX_PKG_DESCRIPTION="Indents C preprocessor directives to reflect their nesting, among other regularizations" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=1.18 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/cppi/cppi-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=12a505b98863f6c5cf1f749f9080be3b42b3eac5a35b59630e67bea7241364ca ================================================ FILE: packages/crunch/Makefile.patch ================================================ diff -uNr crunch-3.6/Makefile crunch-3.6.mod/Makefile --- crunch-3.6/Makefile 2014-05-03 20:04:11.000000000 +0300 +++ crunch-3.6.mod/Makefile 2019-01-31 00:31:33.642061600 +0200 @@ -28,7 +28,7 @@ # General variables PACKAGE = crunch VERSION = 3.6 -PREFIX = /usr +PREFIX ?= /usr DISTDIR = $(PACKAGE)-$(VERSION) DISTFILES = crunch.c crunch.1 charset.lst BINDIR = $(PREFIX)/bin @@ -37,8 +37,8 @@ DOCDIR = $(PREFIX)/share/doc/$(PACKAGE) MANDIR = $(PREFIX)/share/man/man1 -INSTALL = sudo $(shell which install) -CC = $(shell which gcc) +INSTALL = $(shell which install) +CC ?= $(shell which gcc) LIBFLAGS = -lm THREADFLAGS = -pthread OPTFLAGS = -g -o0 @@ -56,7 +56,7 @@ LFS="" else #non-mac as you were - INSTALL_OPTIONS = -g root -o root + INSTALL_OPTIONS = endif # Default target ================================================ FILE: packages/crunch/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://sourceforge.net/projects/crunch-wordlist TERMUX_PKG_DESCRIPTION="Highly customizable wordlist generator" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=3.6 TERMUX_PKG_REVISION=4 TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/crunch-wordlist/crunch-wordlist/crunch-${TERMUX_PKG_VERSION}.tgz TERMUX_PKG_SHA256=6a8f6c3c7410cc1930e6854d1dadc6691bfef138760509b33722ff2de133fe55 TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/cryptopp/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.cryptopp.com/ TERMUX_PKG_DESCRIPTION="A free C++ class library of cryptographic schemes" TERMUX_PKG_LICENSE="BSL-1.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=8.2.0 TERMUX_PKG_REVISION=5 TERMUX_PKG_SRCURL=https://www.cryptopp.com/cryptopp${TERMUX_PKG_VERSION//./}.zip TERMUX_PKG_SHA256=03f0e2242e11b9d19b28d0ec5a3fa8ed5cc7b27640e6bed365744f593e858058 TERMUX_PKG_BREAKS="cryptopp-dev" TERMUX_PKG_REPLACES="cryptopp-dev" TERMUX_PKG_SKIP_SRC_EXTRACT=true TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_RM_AFTER_INSTALL=" bin/ share/cryptopp/ " termux_step_extract_package() { mkdir -p $TERMUX_PKG_CACHEDIR termux_download $TERMUX_PKG_SRCURL $TERMUX_PKG_CACHEDIR/cryptopp.zip \ $TERMUX_PKG_SHA256 mkdir -p $TERMUX_PKG_SRCDIR cd $TERMUX_PKG_SRCDIR unzip $TERMUX_PKG_CACHEDIR/cryptopp.zip } termux_step_make() { CXXFLAGS+=" -fPIC -DCRYPTOPP_DISABLE_ASM" make -j $TERMUX_MAKE_PROCESSES dynamic libcryptopp.pc CC=$CC CXX=$CXX } termux_step_make_install() { make install-lib PREFIX=$TERMUX_PREFIX } ================================================ FILE: packages/cryptopp/cpu.cpp.patch ================================================ diff -uNr cryptopp/cpu.cpp cryptopp.mod/cpu.cpp --- cryptopp/cpu.cpp 2019-04-28 23:36:50.000000000 +0000 +++ cryptopp.mod/cpu.cpp 2019-05-10 14:47:58.091890446 +0000 @@ -47,7 +47,7 @@ // "$ANDROID_NDK_ROOT/sources/android/cpufeatures". // setenv-android.sh will copy the header and source file // into PWD and the makefile will build it in place. -#if defined(__ANDROID__) +#if 0 # include "cpu-features.h" #endif @@ -548,264 +548,64 @@ inline bool CPU_QueryARMv7() { -#if defined(__aarch32__) || defined(__aarch64__) - // ARMv7 or above +#if defined(__arm__) || defined(__aarch32__) || defined(__aarch64__) return true; -#elif defined(__ANDROID__) && defined(__arm__) - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_ARMv7) != 0)) - return true; -#elif defined(__linux__) && defined(__arm__) - if ((getauxval(AT_HWCAP) & HWCAP_ARMv7) != 0) - return true; -#elif defined(__APPLE__) && defined(__arm__) - // Apple hardware is ARMv7 or above. - return true; -#endif +#else return false; +#endif } inline bool CPU_QueryNEON() { -#if defined(__ANDROID__) && defined(__aarch64__) - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_ASIMD) != 0)) - return true; -#elif defined(__ANDROID__) && defined(__arm__) - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0)) - return true; -#elif defined(__linux__) && defined(__aarch64__) - if ((getauxval(AT_HWCAP) & HWCAP_ASIMD) != 0) - return true; -#elif defined(__linux__) && defined(__aarch32__) - if ((getauxval(AT_HWCAP2) & HWCAP2_ASIMD) != 0) - return true; -#elif defined(__linux__) && defined(__arm__) - if ((getauxval(AT_HWCAP) & HWCAP_ARM_NEON) != 0) - return true; -#elif defined(__APPLE__) && defined(__aarch64__) - // Core feature set for Aarch32 and Aarch64. +#if defined(__arm__) || defined(__aarch32__) || defined(__aarch64__) return true; -#endif +#else return false; +#endif } inline bool CPU_QueryCRC32() { -#if defined(__ANDROID__) && defined(__aarch64__) - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_CRC32) != 0)) - return true; -#elif defined(__ANDROID__) && defined(__aarch32__) - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_CRC32) != 0)) - return true; -#elif defined(__linux__) && defined(__aarch64__) - if ((getauxval(AT_HWCAP) & HWCAP_CRC32) != 0) - return true; -#elif defined(__linux__) && defined(__aarch32__) - if ((getauxval(AT_HWCAP2) & HWCAP2_CRC32) != 0) - return true; -#elif defined(__APPLE__) && defined(__aarch64__) - // No compiler support. CRC intrinsics result in a failed compiled. - return false; -#endif return false; } inline bool CPU_QueryPMULL() { -#if defined(__ANDROID__) && defined(__aarch64__) - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_PMULL) != 0)) - return true; -#elif defined(__ANDROID__) && defined(__aarch32__) - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_PMULL) != 0)) - return true; -#elif defined(__linux__) && defined(__aarch64__) - if ((getauxval(AT_HWCAP) & HWCAP_PMULL) != 0) - return true; -#elif defined(__linux__) && defined(__aarch32__) - if ((getauxval(AT_HWCAP2) & HWCAP2_PMULL) != 0) - return true; -#elif defined(__APPLE__) && defined(__aarch64__) - // No compiler support. PMULL intrinsics result in a failed compiled. - return false; -#endif return false; } inline bool CPU_QueryAES() { -#if defined(__ANDROID__) && defined(__aarch64__) - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_AES) != 0)) - return true; -#elif defined(__ANDROID__) && defined(__aarch32__) - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_AES) != 0)) - return true; -#elif defined(__linux__) && defined(__aarch64__) - if ((getauxval(AT_HWCAP) & HWCAP_AES) != 0) - return true; -#elif defined(__linux__) && defined(__aarch32__) - if ((getauxval(AT_HWCAP2) & HWCAP2_AES) != 0) - return true; -#elif defined(__APPLE__) && defined(__aarch64__) - unsigned int device, version; - GetAppleMachineInfo(device, version); - return IsAppleMachineARMv8(device, version); -#endif return false; } inline bool CPU_QuerySHA1() { -#if defined(__ANDROID__) && defined(__aarch64__) - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SHA1) != 0)) - return true; -#elif defined(__ANDROID__) && defined(__aarch32__) - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SHA1) != 0)) - return true; -#elif defined(__linux__) && defined(__aarch64__) - if ((getauxval(AT_HWCAP) & HWCAP_SHA1) != 0) - return true; -#elif defined(__linux__) && defined(__aarch32__) - if ((getauxval(AT_HWCAP2) & HWCAP2_SHA1) != 0) - return true; -#elif defined(__APPLE__) && defined(__aarch64__) - unsigned int device, version; - GetAppleMachineInfo(device, version); - return IsAppleMachineARMv8(device, version); -#endif return false; } inline bool CPU_QuerySHA2() { -#if defined(__ANDROID__) && defined(__aarch64__) - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SHA2) != 0)) - return true; -#elif defined(__ANDROID__) && defined(__aarch32__) - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SHA2) != 0)) - return true; -#elif defined(__linux__) && defined(__aarch64__) - if ((getauxval(AT_HWCAP) & HWCAP_SHA2) != 0) - return true; -#elif defined(__linux__) && defined(__aarch32__) - if ((getauxval(AT_HWCAP2) & HWCAP2_SHA2) != 0) - return true; -#elif defined(__APPLE__) && defined(__aarch64__) - unsigned int device, version; - GetAppleMachineInfo(device, version); - return IsAppleMachineARMv8(device, version); -#endif return false; } inline bool CPU_QuerySHA512() { -// Some ARMv8.4 features are disabled at the moment -#if defined(__ANDROID__) && defined(__aarch64__) && 0 - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SHA512) != 0)) - return true; -#elif defined(__ANDROID__) && defined(__aarch32__) && 0 - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SHA512) != 0)) - return true; -#elif defined(__linux__) && defined(__aarch64__) - if ((getauxval(AT_HWCAP) & HWCAP_SHA512) != 0) - return true; -#elif defined(__linux__) && defined(__aarch32__) - if ((getauxval(AT_HWCAP2) & HWCAP2_SHA512) != 0) - return true; -#elif defined(__APPLE__) && defined(__aarch64__) && 0 - unsigned int device, version; - GetAppleMachineInfo(device, version); - return IsAppleMachineARMv84(device, version); -#endif return false; } inline bool CPU_QuerySHA3() { -// Some ARMv8.4 features are disabled at the moment -#if defined(__ANDROID__) && defined(__aarch64__) && 0 - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SHA3) != 0)) - return true; -#elif defined(__ANDROID__) && defined(__aarch32__) && 0 - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SHA3) != 0)) - return true; -#elif defined(__linux__) && defined(__aarch64__) - if ((getauxval(AT_HWCAP) & HWCAP_SHA3) != 0) - return true; -#elif defined(__linux__) && defined(__aarch32__) - if ((getauxval(AT_HWCAP2) & HWCAP2_SHA3) != 0) - return true; -#elif defined(__APPLE__) && defined(__aarch64__) && 0 - unsigned int device, version; - GetAppleMachineInfo(device, version); - return IsAppleMachineARMv84(device, version); -#endif return false; } inline bool CPU_QuerySM3() { -// Some ARMv8.4 features are disabled at the moment -#if defined(__ANDROID__) && defined(__aarch64__) && 0 - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SM3) != 0)) - return true; -#elif defined(__ANDROID__) && defined(__aarch32__) && 0 - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SM3) != 0)) - return true; -#elif defined(__linux__) && defined(__aarch64__) - if ((getauxval(AT_HWCAP) & HWCAP_SM3) != 0) - return true; -#elif defined(__linux__) && defined(__aarch32__) - if ((getauxval(AT_HWCAP2) & HWCAP2_SM3) != 0) - return true; -#elif defined(__APPLE__) && defined(__aarch64__) && 0 - unsigned int device, version; - GetAppleMachineInfo(device, version); - return IsAppleMachineARMv84(device, version); -#endif return false; } inline bool CPU_QuerySM4() { -// Some ARMv8.4 features are disabled at the moment -#if defined(__ANDROID__) && defined(__aarch64__) && 0 - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SM4) != 0)) - return true; -#elif defined(__ANDROID__) && defined(__aarch32__) && 0 - if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) && - ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SM4) != 0)) - return true; -#elif defined(__linux__) && defined(__aarch64__) - if ((getauxval(AT_HWCAP) & HWCAP_SM4) != 0) - return true; -#elif defined(__linux__) && defined(__aarch32__) - if ((getauxval(AT_HWCAP2) & HWCAP2_SM4) != 0) - return true; -#elif defined(__APPLE__) && defined(__aarch64__) && 0 - unsigned int device, version; - GetAppleMachineInfo(device, version); - return IsAppleMachineARMv84(device, version); -#endif return false; } ================================================ FILE: packages/cryptopp/fix-lib-symlinks.patch ================================================ diff -uNr cryptopp/GNUmakefile cryptopp.mod/GNUmakefile --- cryptopp/GNUmakefile 2019-04-29 02:36:50.000000000 +0300 +++ cryptopp.mod/GNUmakefile 2019-09-15 22:24:49.562595722 +0300 @@ -1256,7 +1256,7 @@ $(CHMOD) 0755 $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_VERSION_SUFFIX) ifeq ($(HAS_SOLIB_VERSION),1) -$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so - $(LDCONF) $(DESTDIR)$(LIBDIR) + -$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_COMPAT_SUFFIX) endif endif ifneq ($(wildcard libcryptopp.pc),) ================================================ FILE: packages/cscope/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://cscope.sourceforge.net/ TERMUX_PKG_DESCRIPTION="A developers tool for browsing program code" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=15.9 TERMUX_PKG_SHA256=c5505ae075a871a9cd8d9801859b0ff1c09782075df281c72c23e72115d9f159 TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/cscope-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="ncurses" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" hw_cv_func_snprintf_c99=yes hw_cv_func_vsnprintf_c99=yes --with-ncurses=$TERMUX_PREFIX " termux_step_pre_configure() { export LEXLIB="" } ================================================ FILE: packages/cscope/errno.patch ================================================ --- src/src/snprintf.c 2009-04-10 13:39:23.000000000 +0000 +++ patches/snprintf.c 2017-05-19 07:45:08.926751318 +0000 @@ -522,7 +522,9 @@ static UINTMAX_T myround(LDOUBLE); static LDOUBLE mypow10(int); +#ifndef __ANDROID__ extern int errno; +#endif int rpl_vsnprintf(char *str, size_t size, const char *format, va_list args) ================================================ FILE: packages/cscope/src-main.c.patch ================================================ diff -u -r ../cscope-15.8b/src/main.c ./src/main.c --- ../cscope-15.8b/src/main.c 2014-11-20 22:12:54.000000000 +0100 +++ ./src/main.c 2017-05-22 14:30:00.303282400 +0200 @@ -62,9 +62,9 @@ #define HOME "/" /* no $HOME --> use root directory */ #define SHELL "sh" #define LINEFLAG "+%s" /* default: used by vi and emacs */ -#define TMPDIR "/tmp" +#define TMPDIR "@TERMUX_PREFIX@/tmp" #ifndef DFLT_INCDIR -#define DFLT_INCDIR "/usr/include" +#define DFLT_INCDIR "@TERMUX_PREFIX@/include" #endif static char const rcsid[] = "$Id: main.c,v 1.57 2014/11/20 21:12:54 broeker Exp $"; ================================================ FILE: packages/ctags/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://ctags.io/ TERMUX_PKG_DESCRIPTION="Universal ctags: Source code index builder" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=0.0.20190412 TERMUX_PKG_REVISION=1 local _COMMIT=61cc66cfc796e707cfb13c5fed493af280378c75 TERMUX_PKG_SHA256=479abda4686fafd11cae40f646c2b692cc0209783d233b2534b339b838af9acc TERMUX_PKG_SRCURL=https://github.com/universal-ctags/ctags/archive/${_COMMIT}.zip TERMUX_PKG_DEPENDS="libiconv" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-tmpdir=$TERMUX_PREFIX/tmp" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_HOSTBUILD=true termux_step_post_extract_package() { export regcomp_works=yes ./autogen.sh } termux_step_pre_configure() { ./autogen.sh cp $TERMUX_PKG_HOSTBUILD_DIR/packcc $TERMUX_PKG_BUILDDIR/ touch -d "next hour" $TERMUX_PKG_BUILDDIR/packcc } ================================================ FILE: packages/ctags/configure.ac.patch ================================================ diff -u -r ../ctags-61cc66cfc796e707cfb13c5fed493af280378c75/configure.ac ./configure.ac --- ../ctags-61cc66cfc796e707cfb13c5fed493af280378c75/configure.ac 2019-04-12 19:56:22.000000000 +0000 +++ ./configure.ac 2019-04-13 07:08:50.478780864 +0000 @@ -7,7 +7,14 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.59]) -AC_INIT([universal-ctags],[0.0.0]) +# Avoid identifying as +# Universal Ctags 0.0.0, Copyright (C) 2015 Universal Ctags Team +# Universal Ctags is derived from Exuberant Ctags. +# Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert +# since that causes at least vim-easytags to identify the ctags +# version as 0.0.0, see +# https://github.com/xolox/vim-easytags/blob/master/autoload/xolox/easytags.vim +AC_INIT([universal-ctags],[5.8]) AM_INIT_AUTOMAKE([foreign subdir-objects tar-ustar]) AM_SILENT_RULES([yes]) AC_CONFIG_HEADERS([config.h]) @@ -409,7 +416,7 @@ sprintf(buffer, "%zu", i); return !(buffer[0] == '9' && buffer[1] == '9' && buffer[2] == '9'); } -]])],[have_zu_formatter=yes],[have_zu_formatter=no]) +]])],[have_zu_formatter=yes],[have_zu_formatter=no], [have_zu_formatter=yes]) AC_MSG_RESULT($have_zu_formatter) if test x$have_zu_formatter != xyes; then @@ -594,16 +601,7 @@ AH_TEMPLATE([HAVE_LIBXML], [Define this value if libxml is available.]) -dnl About the condition of version -dnl see https://mail.gnome.org/archives/xml/2010-February/msg00008.html -AS_IF([test "x$enable_xml" != "xno"], [ - PKG_CHECK_MODULES(LIBXML, [libxml-2.0 >= 2.7.7], - [have_libxml=yes - AC_DEFINE(HAVE_LIBXML)], - [AS_IF([test "x$enable_xml" = "xyes"], [ - AC_MSG_ERROR([libxml2 not found])])]) -]) -AM_CONDITIONAL(HAVE_LIBXML, test "x$have_libxml" = xyes) +AM_CONDITIONAL(HAVE_LIBXML, [test true = false]) AC_ARG_ENABLE([json], [AS_HELP_STRING([--disable-json], ================================================ FILE: packages/cvs/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.nongnu.org/cvs/ TERMUX_PKG_DESCRIPTION="Concurrent Versions System" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION="1.12.13+real-26" TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=0eda91f5e8091b676c90b2a171f24f9293acb552f4e4f77b590ae8d92a547256 TERMUX_PKG_SRCURL="https://dl.bintray.com/termux/upstream/cvs-$TERMUX_PKG_VERSION.tar.xz" TERMUX_PKG_DEPENDS="zlib" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" cvs_cv_func_printf_ptr=yes ac_cv_header_syslog_h=no --disable-server --with-external-zlib " TERMUX_PKG_RM_AFTER_INSTALL="bin/cvsbug share/man/man8/cvsbug.8" ================================================ FILE: packages/cvs/src-log.c.patch ================================================ diff -u -r ../cvs-1.12.13+real-26/src/log.c ./src/log.c --- ../cvs-1.12.13+real-26/src/log.c 2018-06-26 04:32:38.051089628 +0200 +++ ./src/log.c 2018-06-26 04:42:11.865303837 +0200 @@ -1790,12 +1790,14 @@ int buftag = 'M'; static char has_logm = 0; +#ifdef SERVER_SUPPORT if (server_active) { if (!has_logm) has_logm = supported_response("LOGM") ? 1 : 2; if (has_logm == 1) buftag = CVS_OUTPUT_EX_LOGM; } +#endif cvs_output_ex(str, len, buftag); if (/*len > 0 &&*/ str[len - 1] != '\n') ================================================ FILE: packages/daemonize/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://software.clapper.org/daemonize/ TERMUX_PKG_DESCRIPTION="Run a command as a Unix daemon" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=1.7.8 TERMUX_PKG_SHA256=20c4fc9925371d1ddf1b57947f8fb93e2036eb9ccc3b43a1e3678ea8471c4c60 TERMUX_PKG_SRCURL=https://github.com/bmc/daemonize/archive/release-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_func_setpgrp_void=yes" ================================================ FILE: packages/daemonize/daemonize.c.patch ================================================ diff -u -r ../daemonize-release-1.7.7/daemonize.c ./daemonize.c --- ../daemonize-release-1.7.7/daemonize.c 2015-12-11 23:54:43.000000000 +0100 +++ ./daemonize.c 2017-07-07 00:33:39.931635851 +0200 @@ -24,6 +24,7 @@ #include #include #include +#include /* For initgroups(3). */ #include "config.h" #include "version.h" @@ -38,7 +39,10 @@ static bool be_verbose = FALSE; static const char *user = NULL; static char **cmd = NULL; -static const char *cwd = "/"; +/* Termux patch: Use a readable directory for e.g. runsvdir to work, + as / is not readable starting from Android 7: + https://github.com/termux/termux-packages/issues/614 */ +static const char *cwd = "@TERMUX_PREFIX@"; static int null_fd = -1; static int out_fd = -1; static int err_fd = -1; ================================================ FILE: packages/darkhttpd/Makefile.patch ================================================ diff --git a/Makefile b/Makefile index 7059a14..b09a8a7 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,9 @@ all: darkhttpd darkhttpd: darkhttpd.c $(CC) $(CFLAGS) $(LIBS) darkhttpd.c -o $@ +install: all + install darkhttpd "$(DESTDIR)$(PREFIX)/bin/darkhttpd" + clean: rm -f darkhttpd core darkhttpd.core ================================================ FILE: packages/darkhttpd/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://unix4lyfe.org/darkhttpd TERMUX_PKG_DESCRIPTION="A simple webserver, implemented in a single .c file." TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_VERSION=1.12 TERMUX_PKG_REVISION=1 TERMUX_PKG_MAINTAINER="David Paskevic @casept" TERMUX_PKG_SRCURL=https://fossies.org/linux/www/darkhttpd-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=2652bc7e3dab35fcb64453616771016017a135e4b263ef73a36d29662593d472 TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { CFLAGS+=" $LDFLAGS" } ================================================ FILE: packages/dart/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.dartlang.org/ TERMUX_PKG_DESCRIPTION="Dart is a general-purpose programming language" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_VERSION=2.4.1 TERMUX_PKG_BUILD_IN_SRC=true # Dart uses tar and gzip to extract downloaded packages. # Busybox-based versions of such utilities cause issues so # complete ones should be used. TERMUX_PKG_DEPENDS="gzip, tar" termux_step_extract_package() { mkdir -p $TERMUX_PKG_SRCDIR cd $TERMUX_PKG_SRCDIR git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git export PATH="$(pwd)/depot_tools:${PATH}" fetch dart cd sdk git checkout $TERMUX_PKG_VERSION cd ../ echo "target_os = ['android']" >> .gclient gclient sync -D --force --reset } termux_step_make() { cd sdk local DEST_CPU if [ $TERMUX_ARCH = "arm" ]; then DEST_CPU="arm" elif [ $TERMUX_ARCH = "i686" ]; then DEST_CPU="ia32" elif [ $TERMUX_ARCH = "aarch64" ]; then DEST_CPU="arm64" elif [ $TERMUX_ARCH = "x86_64" ]; then DEST_CPU="x64" else termux_error_exit "Unsupported arch '$TERMUX_ARCH'" fi rm -f ./out/*/args.gn DART_MAKE_PLATFORM_SDK=true python2 ./tools/build.py --mode release --arch=$DEST_CPU --os=android create_sdk } termux_step_make_install() { cd sdk local DEST_CPU if [ $TERMUX_ARCH = "arm" ]; then DEST_CPU="ARM" elif [ $TERMUX_ARCH = "i686" ]; then DEST_CPU="IA32" elif [ $TERMUX_ARCH = "aarch64" ]; then DEST_CPU="ARM64" elif [ $TERMUX_ARCH = "x86_64" ]; then DEST_CPU="X64" else termux_error_exit "Unsupported arch '$TERMUX_ARCH'" fi chmod +x ./out/ReleaseAndroid${DEST_CPU}/dart-sdk/bin/* cp -r ./out/ReleaseAndroid${DEST_CPU}/dart-sdk ${TERMUX_PREFIX}/lib for file in ${TERMUX_PREFIX}/lib/dart-sdk/bin/*; do if [[ -f "$file" ]]; then echo -e "#!${TERMUX_PREFIX}/bin/sh\nexec $file \"\$@\"" > ${TERMUX_PREFIX}/bin/$(basename $file) chmod +x ${TERMUX_PREFIX}/bin/$(basename $file) fi done } termux_step_post_make_install() { install -Dm600 $TERMUX_PKG_BUILDER_DIR/dart-pub-bin.sh \ $TERMUX_PREFIX/etc/profile.d/dart-pub-bin.sh } ================================================ FILE: packages/dart/dart-pub-bin.sh ================================================ # Executables installed with 'pub global activate' are available # in directory $HOME/.pub-cache/bin. export PATH="$HOME/.pub-cache/bin:$PATH" ================================================ FILE: packages/dart/fix-shell-path.patch ================================================ diff -uNr src/sdk/pkg/front_end/lib/src/api_prototype/terminal_color_support.dart src.mod/sdk/pkg/front_end/lib/src/api_prototype/terminal_color_support.dart --- src/sdk/pkg/front_end/lib/src/api_prototype/terminal_color_support.dart 2019-05-22 18:59:58.264004304 +0000 +++ src.mod/sdk/pkg/front_end/lib/src/api_prototype/terminal_color_support.dart 2019-05-22 19:21:02.019682122 +0000 @@ -55,7 +55,7 @@ // Check if stdin is a terminal (TTY). ProcessResult result = - Process.runSync("/bin/sh", ["-c", "tty > /dev/null 2> /dev/null"]); + Process.runSync("@TERMUX_PREFIX@/bin/sh", ["-c", "tty > /dev/null 2> /dev/null"]); if (result.exitCode != 0) { if (debug) { @@ -67,7 +67,7 @@ // The `-S` option of `tput` allows us to query multiple capabilities at // once. result = Process.runSync( - "/bin/sh", ["-c", "printf '%s' '$TERMINAL_CAPABILITIES' | tput -S"]); + "@TERMUX_PREFIX@/bin/sh", ["-c", "printf '%s' '$TERMINAL_CAPABILITIES' | tput -S"]); if (result.exitCode != 0) { if (debug) { diff -uNr src/sdk/pkg/front_end/lib/src/fasta/colors.dart src.mod/sdk/pkg/front_end/lib/src/fasta/colors.dart --- src/sdk/pkg/front_end/lib/src/fasta/colors.dart 2019-05-22 18:59:58.267004322 +0000 +++ src.mod/sdk/pkg/front_end/lib/src/fasta/colors.dart 2019-05-22 19:19:14.722850300 +0000 @@ -154,7 +154,7 @@ // The `-S` option of `tput` allows us to query multiple capabilities at // once. ProcessResult result = Process.runSync( - "/bin/sh", ["-c", "printf '%s' '$TERMINAL_CAPABILITIES' | tput -S"]); + "@TERMUX_PREFIX@/bin/sh", ["-c", "printf '%s' '$TERMINAL_CAPABILITIES' | tput -S"]); if (result.exitCode != 0) { if (context.options.verbose) { diff -uNr src/sdk/runtime/bin/process_patch.dart src.mod/sdk/runtime/bin/process_patch.dart --- src/sdk/runtime/bin/process_patch.dart 2019-05-22 18:59:58.641006510 +0000 +++ src.mod/sdk/runtime/bin/process_patch.dart 2019-05-22 19:15:52.594173281 +0000 @@ -321,7 +321,7 @@ if (Platform.isWindows) { return 'cmd.exe'; } - return '/bin/sh'; + return '@TERMUX_PREFIX@/bin/sh'; } static List _getShellArguments( ================================================ FILE: packages/dart/sdk-runtime-bin-directory_android.cc.patch ================================================ --- ./sdk/runtime/bin/directory_android.cc 2019-06-14 00:27:54.559512261 +0530 +++ ./sdk/runtime/bin/directory_android.cc 2019-06-14 00:32:21.470848945 +0530 @@ -429,7 +429,7 @@ // TODO(4413): In the long run, when running in an application we should // probably use the appropriate directory from the Android API, // probably what File.createTempFile uses. - const char* kAndroidTempDir = "/data/local/tmp"; + const char* kAndroidTempDir = "@TERMUX_PREFIX@/tmp"; struct stat st; if (stat(kAndroidTempDir, &st) != 0) { mkdir(kAndroidTempDir, 0777); --- ./sdk/runtime/vm/os_android.cc 2019-06-14 23:47:25.713639563 +0530 +++ ./sdk/runtime/vm/os_android.cc 2019-06-14 23:47:19.743694949 +0530 @@ -42,7 +42,7 @@ return; } intptr_t pid = getpid(); - char* filename = OS::SCreate(NULL, "/tmp/perf-%" Pd ".map", pid); + char* filename = OS::SCreate(NULL, "@TERMUX_PREFIX@/tmp/perf-%" Pd ".map", pid); out_file_ = (*file_open)(filename, true); free(filename); } ================================================ FILE: packages/dash/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://gondor.apana.org.au/~herbert/dash/ TERMUX_PKG_DESCRIPTION="Small POSIX-compliant implementation of /bin/sh" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=0.5.10.2 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=http://gondor.apana.org.au/~herbert/dash/files/dash-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=3c663919dc5c66ec991da14c7cf7e0be8ad00f3db73986a987c118862b5f6071 TERMUX_PKG_ESSENTIAL=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-static" termux_step_post_make_install() { # Symlink sh -> dash ln -sfr $TERMUX_PREFIX/bin/{dash,sh} ln -sfr $TERMUX_PREFIX/share/man/man1/{dash,sh}.1 } ================================================ FILE: packages/dash/etc-profile.patch ================================================ diff --git a/src/main.c b/src/main.c index fcd3e7d..39b6e70 100644 --- a/src/main.c +++ b/src/main.c @@ -146,7 +146,7 @@ main(int argc, char **argv) login = procargs(argc, argv); if (login) { state = 1; - read_profile("/etc/profile"); + read_profile("@TERMUX_PREFIX@/etc/profile"); state1: state = 2; read_profile("$HOME/.profile"); ================================================ FILE: packages/dash/mktokens.patch ================================================ On-device build support. diff -uNr dash-0.5.10.2/src/mktokens dash-0.5.10.2.mod/src/mktokens --- dash-0.5.10.2/src/mktokens 2014-09-28 11:19:32.000000000 +0300 +++ dash-0.5.10.2.mod/src/mktokens 2019-08-16 03:05:06.422193420 +0300 @@ -37,7 +37,7 @@ # token marks the end of a list. The third column is the name to print in # error messages. -cat > /tmp/ka$$ <<\! +cat > ${TMPDIR:-/tmp}/ka$$ <<\! TEOF 1 end of file TNL 0 newline TSEMI 0 ";" @@ -68,28 +68,28 @@ TBEGIN 0 "{" TEND 1 "}" ! -nl=`wc -l /tmp/ka$$` +nl=`wc -l ${TMPDIR:-/tmp}/ka$$` exec > token.h -awk '{print "#define " $1 " " NR-1}' /tmp/ka$$ +awk '{print "#define " $1 " " NR-1}' ${TMPDIR:-/tmp}/ka$$ exec > token_vars.h echo ' /* Array indicating which tokens mark the end of a list */ static const char tokendlist[] = {' -awk '{print "\t" $2 ","}' /tmp/ka$$ +awk '{print "\t" $2 ","}' ${TMPDIR:-/tmp}/ka$$ echo '}; static const char *const tokname[] = {' sed -e 's/"/\\"/g' \ -e 's/[^ ]*[ ][ ]*[^ ]*[ ][ ]*\(.*\)/ "\1",/' \ - /tmp/ka$$ + ${TMPDIR:-/tmp}/ka$$ echo '}; ' -sed 's/"//g' /tmp/ka$$ | awk ' -/TNOT/{print "#define KWDOFFSET " NR-1; print ""; +sed 's/"//g' ${TMPDIR:-/tmp}/ka$$ | awk ' +/TNOT/{print "#define KWDOFFSET " NR-1; print ""; print "static const char *const parsekwd[] = {"} /TNOT/,/neverfound/{if (last) print " \"" last "\","; last = $3} END{print " \"" last "\"\n};"}' -rm /tmp/ka$$ +rm ${TMPDIR:-/tmp}/ka$$ ================================================ FILE: packages/dash/src-var.c.patch ================================================ diff -uNr dash-0.5.10.2/src/var.c dash-0.5.10.2.mod/src/var.c --- dash-0.5.10.2/src/var.c 2018-05-17 14:10:58.000000000 +0300 +++ dash-0.5.10.2.mod/src/var.c 2018-06-21 10:46:49.260059837 +0300 @@ -74,7 +74,7 @@ MKINIT struct localvar_list *localvar_stack; const char defpathvar[] = - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"; + "PATH=@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets"; #ifdef IFS_BROKEN const char defifsvar[] = "IFS= \t\n"; #else ================================================ FILE: packages/dasm/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://dasm-dillon.sourceforge.io/ TERMUX_PKG_DESCRIPTION="Macro assembler with support for several 8-bit microprocessors" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.20.11 TERMUX_PKG_SHA256=c69bbe192159dcf75677ca13bba65c3318dc443f2df45fccd3c060b2e092c7f5 TERMUX_PKG_SRCURL=https://github.com/dasm-assembler/dasm/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_BUILD_IN_SRC=true termux_step_make_install() { cp $TERMUX_PKG_SRCDIR/bin/* $TERMUX_PREFIX/bin/ } ================================================ FILE: packages/datamash/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/datamash/ TERMUX_PKG_DESCRIPTION="GNU datamash performs basic numeric,textual and statistical operations" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.5 TERMUX_PKG_SHA256=226249d5fe54024f96404798778f45963a3041714229d4225cd5d9acdaba21ad TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/datamash/datamash-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { if $TERMUX_DEBUG; then # When doing debug build, -D_FORTIFY_SOURCE=2 gives this error: # /home/builder/.termux-build/_cache/19b-aarch64-24-v5/bin/../sysroot/usr/include/bits/fortify/stdio.h:51:53: error: use of undeclared identifier '__USE_FORTIFY_LEVEL' # return __builtin___vsnprintf_chk(dest, size, 0, __bos(dest), format, ap); # ^ # lib/cdefs.h:123:48: note: expanded from macro '__bos' # #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) # ^ export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/} fi } ================================================ FILE: packages/dcraw/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.cybercom.net/~dcoffin/dcraw/ TERMUX_PKG_DESCRIPTION="Raw digital camera images decoding utility" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=9.28.0 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=2890c3da2642cd44c5f3bfed2c9b2c1db83da5cec09cc17e0fa72e17541fb4b9 #TERMUX_PKG_SRCURL=http://www.cybercom.net/~dcoffin/dcraw/archive/dcraw-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SRCURL=https://mirrors.dotsrc.org/pub/mirrors/exherbo/dcraw-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_DEPENDS="littlecms, libjasper, libjpeg-turbo" termux_step_make_install() { # See the "install" script for flags: $CC $CFLAGS $CPPFLAGS $LDFLAGS dcraw.c $TERMUX_PKG_BUILDER_DIR/swab.c -lm -ljasper -ljpeg -llcms2 -o $TERMUX_PREFIX/bin/dcraw chmod +w dcraw.1 # Add missing write permission cp dcraw.1 $TERMUX_PREFIX/share/man/man1/ } ================================================ FILE: packages/dcraw/swab.c ================================================ /* Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include void swab (const void *bfrom, void *bto, ssize_t n) { const char *from = (const char *) bfrom; char *to = (char *) bto; n &= ~((ssize_t) 1); while (n > 1) { const char b0 = from[--n], b1 = from[--n]; to[n] = b0; to[n + 1] = b1; } } ================================================ FILE: packages/ddrescue/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/ddrescue/ TERMUX_PKG_DESCRIPTION="GNU data recovery tool" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=1.24 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/ddrescue/ddrescue-${TERMUX_PKG_VERSION}.tar.lz TERMUX_PKG_SHA256=4b5d3feede70e3657ca6b3c7844f23131851cbb6af0cecc9721500f7d7021087 TERMUX_PKG_DEPENDS="libc++" ================================================ FILE: packages/ddrescue/fix-configure.patch ================================================ diff -u -r ../ddrescue-1.23/configure ./configure --- ../ddrescue-1.23/configure 2018-02-13 12:54:43.000000000 +0000 +++ ./configure 2018-02-18 21:07:51.862861331 +0000 @@ -15,23 +15,15 @@ LC_ALL=C export LC_ALL srcdir= -prefix=/usr/local +prefix?=/usr/local exec_prefix='$(prefix)' bindir='$(exec_prefix)/bin' datarootdir='$(prefix)/share' infodir='$(datarootdir)/info' mandir='$(datarootdir)/man' -CXX=g++ +CXX?=g++ CPPFLAGS= -CXXFLAGS='-Wall -W -O2' -LDFLAGS= - -# checking whether we are using GNU C++. -/bin/sh -c "${CXX} --version" > /dev/null 2>&1 || - { - CXX=c++ - CXXFLAGS=-O2 - } +CXXFLAGS?='-Wall -W -O2' # Loop over all args args= ================================================ FILE: packages/debianutils/add-shell.patch ================================================ diff -u -r ../debianutils-4.4/add-shell ./add-shell --- ../debianutils-4.4/add-shell 2013-07-28 03:30:26.000000000 +0200 +++ ./add-shell 2014-05-30 16:07:00.000000000 +0200 @@ -6,7 +6,7 @@ exit 1 fi -file=/etc/shells +file=@TERMUX_PREFIX@/etc/shells # I want this to be GUARANTEED to be on the same filesystem as $file tmpfile=${file}.tmp ================================================ FILE: packages/debianutils/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://packages.debian.org/debianutils TERMUX_PKG_DESCRIPTION="Small utilities which are used primarily by the installation scripts of Debian packages" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=4.9.1 TERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/d/debianutils/debianutils_${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=af826685d9c56abfa873e84cd392539cd363cb0ba04a09d21187377e1b764091 TERMUX_PKG_RM_AFTER_INSTALL="bin/installkernel share/man/man8/installkernel.8" ================================================ FILE: packages/debianutils/remove-shell.patch ================================================ diff -u -r ../debianutils-4.4/remove-shell ./remove-shell --- ../debianutils-4.4/remove-shell 2013-07-28 03:30:26.000000000 +0200 +++ ./remove-shell 2014-05-30 16:38:24.000000000 +0200 @@ -6,7 +6,7 @@ exit 1 fi -file=/etc/shells +file=@TERMUX_PREFIX@/etc/shells # I want this to be GUARANTEED to be on the same filesystem as $file tmpfile=${file}.tmp otmpfile=${file}.tmp2 ================================================ FILE: packages/debootstrap/Makefile.patch ================================================ diff -uNr debootstrap-1.0.106/Makefile debootstrap-1.0.106.mod/Makefile --- debootstrap-1.0.106/Makefile 2018-07-05 11:48:22.000000000 +0300 +++ debootstrap-1.0.106.mod/Makefile 2018-07-10 15:33:41.289906934 +0300 @@ -5,14 +5,12 @@ clean: -DSDIR=$(DESTDIR)/usr/share/debootstrap +DSDIR=$(DESTDIR)$(PREFIX)/share/debootstrap install: mkdir -p $(DSDIR)/scripts - mkdir -p $(DESTDIR)/usr/sbin cp -a scripts/* $(DSDIR)/scripts/ - install -o root -g root -m 0644 functions $(DSDIR)/ + install -m 0644 functions $(DSDIR)/ - sed 's/@VERSION@/$(VERSION)/g' debootstrap >$(DESTDIR)/usr/sbin/debootstrap - chown root:root $(DESTDIR)/usr/sbin/debootstrap - chmod 0755 $(DESTDIR)/usr/sbin/debootstrap + sed 's/@VERSION@/$(VERSION)/g' debootstrap >$(DESTDIR)$(PREFIX)/bin/debootstrap + chmod 0755 $(DESTDIR)$(PREFIX)/bin/debootstrap ================================================ FILE: packages/debootstrap/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://wiki.debian.org/Debootstrap TERMUX_PKG_DESCRIPTION="Bootstrap a basic Debian system" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Pierre Rudloff @Rudloff" TERMUX_PKG_VERSION=1.0.116 TERMUX_PKG_SRCURL=http://http.debian.net/debian/pool/main/d/debootstrap/debootstrap_${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=cb33272d8f21b5cb8b26e9cc29be9d4627786ee53c5b7ec478973aa4273cf019 TERMUX_PKG_DEPENDS="wget, proot, perl" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_PLATFORM_INDEPENDENT=true termux_step_post_make_install() { mkdir -p ${TERMUX_PREFIX}/share/man/man8/ install ${TERMUX_PKG_SRCDIR}/debootstrap.8 ${TERMUX_PREFIX}/share/man/man8/ } ================================================ FILE: packages/debootstrap/debootstrap.patch ================================================ diff -u -r ../debootstrap-1.0.108/debootstrap ./debootstrap --- ../debootstrap-1.0.108/debootstrap 2018-08-12 08:58:37.000000000 +0000 +++ ./debootstrap 2018-08-27 19:44:25.479843110 +0000 @@ -3,7 +3,7 @@ VERSION='@VERSION@' -unset TMP TEMP TMPDIR || true +unset LD_PRELOAD TMP TEMP TMPDIR || true # might not be exported if we're running from init=/bin/sh or similar export PATH @@ -14,7 +14,7 @@ if [ -x /debootstrap/debootstrap ]; then DEBOOTSTRAP_DIR=/debootstrap else - DEBOOTSTRAP_DIR=/usr/share/debootstrap + DEBOOTSTRAP_DIR=$PREFIX/share/debootstrap fi fi @@ -500,14 +500,31 @@ if in_path dpkg && \ dpkg --print-architecture >/dev/null 2>&1; then - HOST_ARCH=$(/usr/bin/dpkg --print-architecture) + HOST_ARCH=$($PREFIX/bin/dpkg --print-architecture) elif in_path udpkg && \ udpkg --print-architecture >/dev/null 2>&1; then - HOST_ARCH=$(/usr/bin/udpkg --print-architecture) + HOST_ARCH=$($PREFIX/bin/udpkg --print-architecture) elif [ -e "$DEBOOTSTRAP_DIR/arch" ]; then HOST_ARCH=$(cat "$DEBOOTSTRAP_DIR/arch") fi HOST_OS="$HOST_ARCH" + +# Translate Termux arch names to those of Debian: +case $HOST_ARCH in + arm) + HOST_ARCH=armel + ;; + aarch64) + HOST_ARCH=arm64 + ;; + i686) + HOST_ARCH=i386 + ;; + x86_64) + HOST_ARCH=amd64 + ;; +esac + # basic host OS guessing for non-Debian systems if [ -z "$HOST_OS" ]; then case $(uname) in @@ -544,12 +561,8 @@ if [ "$TARGET" = "/" ]; then CHROOT_CMD="" else - CHROOT_CMD="chroot \"$TARGET\"" -fi - -# fakeroot cannot check /proc/1/environ -if [ "$HOST_OS" = Linux ] && ! doing_variant fakechroot && [ "$CONTAINER" = "lxc-libvirt" ]; then - CHROOT_CMD="unshare --net $CHROOT_CMD" + PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin + CHROOT_CMD="proot -w /home -b /dev -b /proc --link2symlink -0 -r $TARGET" fi if [ -z "$SHA_SIZE" ]; then @@ -563,16 +576,6 @@ export ARCH SUITE TARGET CHROOT_CMD SHA_SIZE DEBOOTSTRAP_CHECKSUM_FIELD -if am_doing_phase first_stage second_stage; then - if in_path id && [ "$(id -u)" -ne 0 ]; then - error 1 NEEDROOT "debootstrap can only run as root" - fi - # Ensure that we can create working devices and executables on the target. - if ! check_sane_mount "$TARGET"; then - error 1 NOEXEC "Cannot install into target '$TARGET' mounted with noexec or nodev" - fi -fi - if [ ! -e "$SCRIPT" ]; then error 1 NOSCRIPT "No such script: %s" "$SCRIPT" fi ================================================ FILE: packages/debootstrap/fix-keyring-paths.patch ================================================ diff -uNr debootstrap/scripts/aequorea debootstrap.mod/scripts/aequorea --- debootstrap/scripts/aequorea 2018-11-20 20:55:53.000000000 +0200 +++ debootstrap.mod/scripts/aequorea 2019-01-19 00:01:31.279213294 +0200 @@ -2,7 +2,7 @@ download_style apt finddebs_style from-indices variants - buildd fakechroot minbase -keyring /usr/share/keyrings/tanglu-archive-keyring.gpg +keyring @TERMUX_PREFIX@/share/keyrings/tanglu-archive-keyring.gpg default_mirror http://archive.tanglu.org/tanglu if doing_variant fakechroot; then diff -uNr debootstrap/scripts/etch debootstrap.mod/scripts/etch --- debootstrap/scripts/etch 2018-11-20 20:55:53.000000000 +0200 +++ debootstrap.mod/scripts/etch 2019-01-19 00:01:37.295931992 +0200 @@ -3,7 +3,7 @@ finddebs_style from-indices variants - buildd fakechroot minbase default_mirror http://archive.debian.org/debian -keyring /usr/share/keyrings/debian-archive-removed-keys.gpg +keyring @TERMUX_PREFIX@/share/keyrings/debian-archive-removed-keys.gpg force_md5 # include common settings diff -uNr debootstrap/scripts/gutsy debootstrap.mod/scripts/gutsy --- debootstrap/scripts/gutsy 2018-11-20 20:55:53.000000000 +0200 +++ debootstrap.mod/scripts/gutsy 2019-01-19 00:01:43.295983852 +0200 @@ -27,7 +27,7 @@ download_style apt finddebs_style from-indices variants - buildd fakechroot minbase -keyring /usr/share/keyrings/ubuntu-archive-keyring.gpg +keyring @TERMUX_PREFIX@/share/keyrings/ubuntu-archive-keyring.gpg if doing_variant fakechroot; then test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started" diff -uNr debootstrap/scripts/kali debootstrap.mod/scripts/kali --- debootstrap/scripts/kali 2018-11-20 20:55:53.000000000 +0200 +++ debootstrap.mod/scripts/kali 2019-01-19 00:01:47.792689365 +0200 @@ -2,7 +2,7 @@ download_style apt finddebs_style from-indices variants - buildd fakechroot minbase -keyring /usr/share/keyrings/kali-archive-keyring.gpg +keyring @TERMUX_PREFIX@/share/keyrings/kali-archive-keyring.gpg default_mirror http://http.kali.org/kali # include common settings diff -uNr debootstrap/scripts/potato debootstrap.mod/scripts/potato --- debootstrap/scripts/potato 2018-11-20 20:55:53.000000000 +0200 +++ debootstrap.mod/scripts/potato 2019-01-19 00:01:52.366062187 +0200 @@ -1,7 +1,7 @@ mirror_style release download_style apt var-state default_mirror http://archive.debian.org/debian -keyring /usr/share/keyrings/debian-archive-removed-keys.gpg +keyring @TERMUX_PREFIX@/share/keyrings/debian-archive-removed-keys.gpg force_md5 LIBC=libc6 diff -uNr debootstrap/scripts/sarge debootstrap.mod/scripts/sarge --- debootstrap/scripts/sarge 2018-11-20 20:55:53.000000000 +0200 +++ debootstrap.mod/scripts/sarge 2019-01-19 00:01:56.512764645 +0200 @@ -1,7 +1,7 @@ mirror_style release download_style apt default_mirror http://archive.debian.org/debian -keyring /usr/share/keyrings/debian-archive-removed-keys.gpg +keyring @TERMUX_PREFIX@/share/keyrings/debian-archive-removed-keys.gpg force_md5 LIBC=libc6 diff -uNr debootstrap/scripts/sid debootstrap.mod/scripts/sid --- debootstrap/scripts/sid 2018-11-20 20:55:53.000000000 +0200 +++ debootstrap.mod/scripts/sid 2019-01-19 00:02:00.832801917 +0200 @@ -2,7 +2,7 @@ download_style apt finddebs_style from-indices variants - buildd fakechroot minbase -keyring /usr/share/keyrings/debian-archive-keyring.gpg +keyring @TERMUX_PREFIX@/share/keyrings/debian-archive-keyring.gpg # include common settings if [ -e "$DEBOOTSTRAP_DIR/scripts/debian-common" ]; then diff -uNr debootstrap/scripts/woody debootstrap.mod/scripts/woody --- debootstrap/scripts/woody 2018-11-20 20:55:53.000000000 +0200 +++ debootstrap.mod/scripts/woody 2019-01-19 00:02:06.079513823 +0200 @@ -1,7 +1,7 @@ mirror_style release download_style apt default_mirror http://archive.debian.org/debian -keyring /usr/share/keyrings/debian-archive-removed-keys.gpg +keyring @TERMUX_PREFIX@/share/keyrings/debian-archive-removed-keys.gpg force_md5 LIBC=libc6 diff -uNr debootstrap/scripts/woody.buildd debootstrap.mod/scripts/woody.buildd --- debootstrap/scripts/woody.buildd 2018-11-20 20:55:53.000000000 +0200 +++ debootstrap.mod/scripts/woody.buildd 2019-01-19 00:02:24.623006862 +0200 @@ -1,7 +1,7 @@ mirror_style release download_style apt default_mirror http://archive.debian.org/debian -keyring /usr/share/keyrings/debian-archive-removed-keys.gpg +keyring @TERMUX_PREFIX@/share/keyrings/debian-archive-removed-keys.gpg force_md5 LIBC=libc6 ================================================ FILE: packages/debootstrap/functions.patch ================================================ diff -u -r ../debootstrap-1.0.108/functions ./functions --- ../debootstrap-1.0.108/functions 2018-08-12 08:58:37.000000000 +0000 +++ ./functions 2018-08-27 19:32:04.844265965 +0000 @@ -230,17 +230,7 @@ } detect_container () { - if [ "$container" = lxc ]; then - CONTAINER="lxc" - elif grep -qs container=lxc-libvirt /proc/1/environ; then - CONTAINER="lxc-libvirt" - elif grep -qs ^systemd-nspawn$ /run/systemd/container || [ "$container" = "systemd-nspawn" ]; then - CONTAINER="systemd-nspawn" - elif grep -qs '[[:space:]]/docker/.*/sys/fs/cgroup' /proc/1/mountinfo; then - CONTAINER="docker" - else - CONTAINER="" - fi + CONTAINER="" } ########################################################## variant handling @@ -945,7 +935,7 @@ extract_dpkg_deb_data () { local pkg="$1" - dpkg-deb --fsys-tarfile "$pkg" | tar $EXTRACT_DEB_TAR_OPTIONS -xf - || error 1 FILEEXIST "Tried to extract package, but file already exists. Exit..." + dpkg-deb --fsys-tarfile "$pkg" | proot --link2symlink tar $EXTRACT_DEB_TAR_OPTIONS -xf - || error 1 FILEEXIST "Tried to extract package, but file already exists. Exit..." } # Raw .deb extractors @@ -985,7 +975,7 @@ esac if in_path "$cat_cmd"; then - ar -p "$pkg" "$tarball" | "$cat_cmd" | tar $EXTRACT_DEB_TAR_OPTIONS -xf - + ar -p "$pkg" "$tarball" | "$cat_cmd" | proot --link2symlink tar $EXTRACT_DEB_TAR_OPTIONS -xf - else error 1 UNPACKCMDUNVL "Extracting %s requires the %s command, which is not available" "$pkg" "$cat_cmd" fi @@ -1041,7 +1031,7 @@ ); } in_target_nofail () { - if ! PATH=/sbin:/usr/sbin:/bin:/usr/bin eval "$CHROOT_CMD \"\$@\"" 2>/dev/null; then + if ! PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin $CHROOT_CMD "$@" 2>/dev/null; then true fi return 0 @@ -1053,7 +1043,7 @@ msg="$2" arg="$3" shift; shift; shift - if ! PATH=/sbin:/usr/sbin:/bin:/usr/bin eval "$CHROOT_CMD \"\$@\""; then + if ! PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin $CHROOT_CMD "$@"; then warning "$code" "$msg" "$arg" # Try to point user at actual failing package. msg="See %s for details" @@ -1209,7 +1199,6 @@ return 0 fi - setup_devices_simple ;; esac } ================================================ FILE: packages/debootstrap/scripts-debian-common.patch ================================================ diff -uNr debootstrap-1.0.106/scripts/debian-common debootstrap-1.0.106.mod/scripts/debian-common --- debootstrap-1.0.106/scripts/debian-common 2018-07-05 11:48:22.000000000 +0300 +++ debootstrap-1.0.106.mod/scripts/debian-common 2018-07-10 15:33:41.289906934 +0300 @@ -60,7 +60,7 @@ setup_etc if [ ! -e "$TARGET/etc/fstab" ]; then echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" - chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" + chmod 644 "$TARGET/etc/fstab" fi setup_devices @@ -102,7 +102,6 @@ } if ! doing_variant fakechroot; then - setup_proc in_target /sbin/ldconfig fi @@ -172,6 +171,20 @@ echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" chmod 755 "$TARGET/sbin/start-stop-daemon" + # Replace problematic binaries with a stub + echo "" > "$TARGET/bin/chown" + echo "" > "$TARGET/usr/sbin/groupadd" + echo "" > "$TARGET/usr/sbin/groupdel" + echo "" > "$TARGET/usr/sbin/groupmod" + echo "" > "$TARGET/usr/sbin/useradd" + echo "" > "$TARGET/usr/sbin/userdel" + echo "" > "$TARGET/usr/sbin/usermod" + echo "" > "$TARGET/usr/bin/chage" + echo "" > "$TARGET/usr/bin/chfn" + echo "" > "$TARGET/usr/bin/dpkg-statoverride" + + echo "nameserver 8.8.8.8\nnameserver 8.8.4.4" > "$TARGET/etc/resolv.conf" + setup_dselect_method apt smallyes '' | ================================================ FILE: packages/deutex/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/Doom-Utils/deutex/ TERMUX_PKG_DESCRIPTION="WAD composer for Doom, Heretic, Hexen, and Strife" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=5.2.1 TERMUX_PKG_SRCURL=https://github.com/Doom-Utils/deutex/releases/download/v$TERMUX_PKG_VERSION/deutex-$TERMUX_PKG_VERSION.tar.xz TERMUX_PKG_SHA256=d61c0d5b1fce3f8271c2358d35b41f70a08da662e387edb8a03ca1deb156831f TERMUX_PKG_DEPENDS="libpng, zlib" ================================================ FILE: packages/dialog/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://invisible-island.net/dialog/ TERMUX_PKG_DESCRIPTION="Application used in shell scripts which displays text user interface widgets" TERMUX_PKG_LICENSE="LGPL-2.1" TERMUX_PKG_DEPENDS="ncurses" TERMUX_PKG_VERSION="1.3-20191110" TERMUX_PKG_SRCURL=https://invisible-mirror.net/archives/dialog/dialog-$TERMUX_PKG_VERSION.tgz TERMUX_PKG_SHA256=d92a7d0910404c02c908e3ce774ac652edc822f45c6536c7d72fafa10e1d0e63 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-ncursesw --enable-widec --with-pkg-config" termux_step_pre_configure() { # Certain packages are not safe to build on device because their # build.sh script deletes specific files in $TERMUX_PREFIX. if $TERMUX_ON_DEVICE_BUILD; then termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds." fi # Put a temporary link for libtinfo.so ln -s -f $TERMUX_PREFIX/lib/libncursesw.so $TERMUX_PREFIX/lib/libtinfo.so } termux_step_post_make_install() { rm $TERMUX_PREFIX/lib/libtinfo.so cd $TERMUX_PREFIX/bin ln -f -s dialog whiptail } ================================================ FILE: packages/dialog/configure.patch ================================================ diff -u -r ../dialog-1.3-20170509/configure ./configure --- ../dialog-1.3-20170509/configure 2017-05-09 23:27:22.000000000 +0000 +++ ./configure 2017-07-07 07:23:30.678552568 +0000 @@ -11650,7 +11650,7 @@ int main (void) { -initscr(); tgoto("?", 0,0) +initscr(); ; return 0; } @@ -13449,7 +13449,7 @@ int main (void) { -initscr(); tgoto("?", 0,0) +initscr(); ; return 0; } ================================================ FILE: packages/dictd/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://sourceforge.net/projects/dict/ TERMUX_PKG_DESCRIPTION="Online dictionary client and server" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.12.1 TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/dict/dictd/dictd-${TERMUX_PKG_VERSION}/dictd-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=a237f6ecdc854ab10de5145ed42eaa2d9b6d51ffdc495f7daee59b05cc363656 TERMUX_PKG_DEPENDS="libmaa, zlib" ================================================ FILE: packages/dictd/dictd.patch ================================================ diff -u -r ../dictd-1.12.1.orig/Makefile.in ./Makefile.in --- ../dictd-1.12.1.orig/Makefile.in 2011-03-07 02:52:54.000000000 +0900 +++ ./Makefile.in 2018-02-08 18:50:15.790039388 +0900 @@ -123,7 +123,7 @@ %: %.o $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ -static \ - $^ $(OBJS) $(LDFLAGS) -lz ${LIBS} + $(^:.o=.lo) $(OBJS) $(LDFLAGS) -lz ${LIBS} include $(srcdir)/deps diff -u -r ../dictd-1.12.1.orig/dictd.c ./dictd.c --- ../dictd-1.12.1.orig/dictd.c 2011-01-10 01:53:27.000000000 +0900 +++ ./dictd.c 2018-02-08 18:50:19.980039386 +0900 @@ -75,7 +75,7 @@ const char *logFile = NULL; int logFile_set; /* 1 if set by command line option */ -const char *pidFile = "/var/run/dictd.pid"; +const char *pidFile = "@TERMUX_PREFIX@/var/run/dictd.pid"; int pidFile_set; /* 1 if set by command line option */ const char *daemon_service = DICT_DEFAULT_SERVICE; Only in .: dictd.patch diff -u -r ../dictd-1.12.1.orig/net.c ./net.c --- ../dictd-1.12.1.orig/net.c 2010-08-22 02:55:40.000000000 +0900 +++ ./net.c 2018-02-08 18:50:22.640039385 +0900 @@ -65,7 +65,9 @@ { struct hostent *hostEntry; struct servent *serviceEntry; + /* struct protoent *protocolEntry; + */ struct sockaddr_in ssin; int s; int hosts = 0; @@ -79,8 +81,10 @@ } else if (!(ssin.sin_port = htons(atoi(service)))) return NET_NOSERVICE; + /* if (!(protocolEntry = getprotobyname("tcp"))) return NET_NOPROTOCOL; + */ if ((hostEntry = gethostbyname(host))) { ++hosts; @@ -92,7 +96,7 @@ memcpy( &ssin.sin_addr.s_addr, *current, hostEntry->h_length ); PRINTF(DBG_VERBOSE, ("Trying %s (%s)\n",host,inet_ntoa(ssin.sin_addr))); - if ((s = socket(PF_INET, SOCK_STREAM, protocolEntry->p_proto)) < 0) + if ((s = socket(PF_INET, SOCK_STREAM, 6)) < 0) err_fatal_errno( __func__, "Can't open socket on port %d\n", ntohs(ssin.sin_port) ); if (connect(s, (struct sockaddr *)&ssin, sizeof(ssin)) >= 0) @@ -100,7 +104,7 @@ close(s); } } else { - if ((s = socket(PF_INET, SOCK_STREAM, protocolEntry->p_proto)) < 0) + if ((s = socket(PF_INET, SOCK_STREAM, 6)) < 0) err_fatal_errno( __func__, "Can't open socket on port %d\n", ntohs(ssin.sin_port) ); if (connect(s, (struct sockaddr *)&ssin, sizeof(ssin)) >= 0) @@ -117,7 +121,9 @@ int queueLength) { struct servent *serviceEntry; + /* struct protoent *protocolEntry; + */ struct sockaddr_in ssin; int s; const int one = 1; @@ -131,10 +137,12 @@ } else if (!(ssin.sin_port = htons(atoi(service)))) err_fatal( __func__, "Can't get \"%s\" service entry\n", service ); + /* if (!(protocolEntry = getprotobyname("tcp"))) err_fatal( __func__, "Can't get \"tcp\" protocol entry\n" ); + */ - if ((s = socket(PF_INET, SOCK_STREAM, protocolEntry->p_proto)) < 0) + if ((s = socket(PF_INET, SOCK_STREAM, 6)) < 0) err_fatal_errno( __func__, "Can't open socket on port %d\n", ntohs(ssin.sin_port) ); diff -u -r ../dictd-1.12.1.orig/parse.c ./parse.c --- ../dictd-1.12.1.orig/parse.c 2008-12-08 01:50:05.000000000 +0900 +++ ./parse.c 2018-02-08 18:52:46.640039330 +0900 @@ -90,10 +90,9 @@ char *buffer; const char **pt; static const char *cpp = NULL; - static const char *cpps[] = { "/lib/cpp", - "/usr/lib/cpp", - "/usr/ccs/lib/cpp", /* Solaris */ - "/usr/lang/cpp", + static const char *cpps[] = { "@TERMUX_PREFIX@/lib/cpp", + "@TERMUX_PREFIX@/ccs/lib/cpp", /* Solaris */ + "@TERMUX_PREFIX@/lang/cpp", 0 }; static const char *extra_options = ""; FILE *tmp; ================================================ FILE: packages/diffutils/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/diffutils/ TERMUX_PKG_DESCRIPTION="Programs (cmp, diff, diff3 and sdiff) related to finding differences between files" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=3.7 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/diffutils/diffutils-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=b3a7a6221c3dc916085f0d205abf6b8e1ba443d4dd965118da364a1dc1cb3a26 TERMUX_PKG_DEPENDS="libiconv" TERMUX_PKG_ESSENTIAL=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_path_PR_PROGRAM=${TERMUX_PREFIX}/bin/pr" termux_step_pre_configure() { if $TERMUX_DEBUG; then # When doing debug build, -D_FORTIFY_SOURCE=2 gives an # error: use of undeclared identifier '__USE_FORTIFY_LEVEL' export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/} fi } ================================================ FILE: packages/direnv/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/direnv/direnv TERMUX_PKG_DESCRIPTION="Environment switcher for shell" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=2.20.1 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/direnv/direnv/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=dd54393661602bb989ee880f14c41f7a7b47a153777999509127459edae52e47 TERMUX_PKG_BUILD_IN_SRC=true termux_step_make() { termux_setup_golang make } termux_step_make_install() { make install DESTDIR=$TERMUX_PREFIX } ================================================ FILE: packages/direvent/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org.ua/software/direvent/ TERMUX_PKG_DESCRIPTION="Monitor of events in file system directories" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=5.2 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/direvent/direvent-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=239822cdda9ecbbbc41a69181b34505b2d3badd4df5367e765a0ceb002883b55 TERMUX_PKG_DEPENDS="libandroid-glob" termux_step_pre_configure() { export LIBS="-landroid-glob -llog" } ================================================ FILE: packages/direvent/preproc.c.patch ================================================ "The getdtablesize functions has been deprecated by Posix and has been removed from Android's LB64 ABI. Replace calls to it with the modern equivalent sysconf(_SC_OPEN_MAX)." - https://groups.google.com/a/chromium.org/forum/#!topic/chromium-reviews/AXhZapYuHi8 diff -u -r ../direvent-5.0/grecs/src/preproc.c ./grecs/src/preproc.c --- ../direvent-5.0/grecs/src/preproc.c 2013-12-17 16:32:57.000000000 -0500 +++ ./grecs/src/preproc.c 2016-01-03 08:46:26.663047361 -0500 @@ -679,7 +679,7 @@ } /* Close unneeded descripitors */ - for (i = getdtablesize(); i > 2; i--) + for (i = sysconf(_SC_OPEN_MAX); i > 2; i--) close(i); if (!grecs_log_to_stderr) { ================================================ FILE: packages/diskus/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/sharkdp/diskus TERMUX_PKG_DESCRIPTION="A minimal, fast alternative to 'du -sh'" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.6.0 TERMUX_PKG_SRCURL=https://github.com/sharkdp/diskus/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=661687edefa3218833677660a38ccd4e2a3c45c4a66055c5bfa4667358b97500 TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/dnsutils/bin-delv-delv.c.patch ================================================ diff -u -r ../bind-9.10.3/bin/delv/delv.c ./bin/delv/delv.c --- ../bind-9.10.3/bin/delv/delv.c 2015-09-08 22:23:40.000000000 -0400 +++ ./bin/delv/delv.c 2015-09-18 09:20:21.037363830 -0400 @@ -869,7 +869,7 @@ if (result != ISC_R_SUCCESS) fatal("Couldn't parse port number"); - result = irs_resconf_load(mctx, "/etc/resolv.conf", &resconf); + result = irs_resconf_load(mctx, RESOLV_CONF, &resconf); if (result != ISC_R_SUCCESS && result != ISC_R_FILENOTFOUND) { delv_log(ISC_LOG_ERROR, "irs_resconf_load: %s", isc_result_totext(result)); ================================================ FILE: packages/dnsutils/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.isc.org/downloads/bind/ TERMUX_PKG_DESCRIPTION="Clients provided with BIND" TERMUX_PKG_LICENSE="MPL-2.0" TERMUX_PKG_VERSION=9.14.8 TERMUX_PKG_SRCURL="ftp://ftp.isc.org/isc/bind9/${TERMUX_PKG_VERSION}/bind-${TERMUX_PKG_VERSION}.tar.gz" TERMUX_PKG_SHA256=e545aa75ced6695a9bf4b591606ef00260fb3c055c2865b299cfe0fe6eeea076 TERMUX_PKG_DEPENDS="openssl, readline, resolv-conf, zlib" TERMUX_PKG_BREAKS="dnsutils-dev" TERMUX_PKG_REPLACES="dnsutils-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-linux-caps --without-python --with-ecdsa=no --with-gost=no --with-gssapi=no --with-libjson=no --with-libtool --with-libxml2=no --with-openssl=$TERMUX_PREFIX --with-randomdev=/dev/random --with-readline=-lreadline --with-eddsa=no " termux_step_pre_configure() { export BUILD_AR=ar export BUILD_CC=gcc export BUILD_CFLAGS= export BUILD_CPPFLAGS= export BUILD_LDFLAGS= export BUILD_RANLIB= _RESOLV_CONF=$TERMUX_PREFIX/etc/resolv.conf CFLAGS+=" $CPPFLAGS -DRESOLV_CONF=\\\"$_RESOLV_CONF\\\"" LDFLAGS+=" -llog" } termux_step_make() { make -C lib/isc make -C lib/dns make -C lib/ns make -C lib/isccc make -C lib/isccfg make -C lib/bind9 make -C lib/irs make -C bin/dig make -C bin/delv make -C bin/nsupdate } termux_step_make_install() { make -C lib/isc install make -C lib/dns install make -C lib/ns install make -C lib/isccc install make -C lib/isccfg install make -C lib/bind9 install make -C lib/irs install make -C bin/dig install make -C bin/delv install make -C bin/nsupdate install } ================================================ FILE: packages/dnsutils/lib-irs-context.c.patch ================================================ diff -uNr bind-9.13.6/lib/irs/context.c bind-9.13.6.mod/lib/irs/context.c --- bind-9.13.6/lib/irs/context.c 2019-02-07 01:44:09.000000000 +0200 +++ bind-9.13.6.mod/lib/irs/context.c 2019-03-02 02:39:12.188552664 +0200 @@ -42,7 +42,7 @@ #ifndef DNS_CONF /*% location of dns.conf */ -#define DNS_CONF "/etc/dns.conf" +#define DNS_CONF "@TERMUX_PREFIX@/etc/dns.conf" #endif static bool thread_key_initialized = false; ================================================ FILE: packages/dnsutils/lib-isc-pthreads-thread.c.patch ================================================ diff -u -r ../bind-9.13.4/lib/isc/pthreads/thread.c ./lib/isc/pthreads/thread.c --- ../bind-9.13.4/lib/isc/pthreads/thread.c 2018-11-22 00:20:34.000000000 +0000 +++ ./lib/isc/pthreads/thread.c 2018-11-26 22:56:50.905945958 +0000 @@ -73,7 +73,9 @@ void isc_thread_setconcurrency(unsigned int level) { +#ifndef __ANDROID__ (void)pthread_setconcurrency(level); +#endif } void ================================================ FILE: packages/docbook-xml/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.oasis-open.org/docbook/ TERMUX_PKG_DESCRIPTION="A widely used XML scheme for writing documentation and help" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=4.5 TERMUX_PKG_REVISION=2 TERMUX_PKG_DEPENDS="libxml2-utils" TERMUX_PKG_PLATFORM_INDEPENDENT=true TERMUX_PKG_BUILD_IN_SRC=true termux_step_extract_package() { mkdir -p $TERMUX_PKG_SRCDIR cd $TERMUX_PKG_SRCDIR termux_download "https://docbook.org/xml/4.1.2/docbkx412.zip" \ $TERMUX_PKG_CACHEDIR/docbkx412.zip \ 30f0644064e0ea71751438251940b1431f46acada814a062870f486c772e7772 termux_download "https://docbook.org/xml/4.2/docbook-xml-4.2.zip" \ $TERMUX_PKG_CACHEDIR/docbook-xml-4.2.zip \ acc4601e4f97a196076b7e64b368d9248b07c7abf26b34a02cca40eeebe60fa2 termux_download "https://docbook.org/xml/4.3/docbook-xml-4.3.zip" \ $TERMUX_PKG_CACHEDIR/docbook-xml-4.3.zip \ 23068a94ea6fd484b004c5a73ec36a66aa47ea8f0d6b62cc1695931f5c143464 termux_download "https://docbook.org/xml/4.4/docbook-xml-4.4.zip" \ $TERMUX_PKG_CACHEDIR/docbook-xml-4.4.zip \ 02f159eb88c4254d95e831c51c144b1863b216d909b5ff45743a1ce6f5273090 termux_download "https://docbook.org/xml/4.5/docbook-xml-4.5.zip" \ $TERMUX_PKG_CACHEDIR/docbook-xml-4.5.zip \ 4e4e037a2b83c98c6c94818390d4bdd3f6e10f6ec62dd79188594e26190dc7b4 unzip -d docbook-xml-4.1.2 $TERMUX_PKG_CACHEDIR/docbkx412.zip local ver for ver in 4.{2..5}; do unzip -d docbook-xml-${ver} $TERMUX_PKG_CACHEDIR/docbook-xml-${ver}.zip done } termux_step_make_install() { mkdir -p $TERMUX_PREFIX/etc/xml xmlcatalog --noout --create "$TERMUX_PREFIX/etc/xml/docbook-xml" local ver for ver in 4.1.2 4.{2..5}; do pushd docbook-xml-$ver mkdir -p "$TERMUX_PREFIX/share/xml/docbook/xml-dtd-$ver" cp -dr docbook.cat *.dtd ent/ *.mod \ "$TERMUX_PREFIX/share/xml/docbook/xml-dtd-$ver" popd xml= case $ver in 4.1.2) xml=' XML' ;;& *) xmlcatalog --noout --add "public" \ "-//OASIS//DTD DocBook XML V$ver//EN" \ "http://www.oasis-open.org/docbook/xml/$ver/docbookx.dtd" \ "$TERMUX_PREFIX/etc/xml/docbook-xml" xmlcatalog --noout --add "public" \ "-//OASIS//DTD DocBook$xml CALS Table Model V$ver//EN" \ "http://www.oasis-open.org/docbook/xml/$ver/calstblx.dtd" \ "$TERMUX_PREFIX/etc/xml/docbook-xml" xmlcatalog --noout --add "public" \ "-//OASIS//DTD XML Exchange Table Model 19990315//EN" \ "http://www.oasis-open.org/docbook/xml/$ver/soextblx.dtd" \ "$TERMUX_PREFIX/etc/xml/docbook-xml" xmlcatalog --noout --add "public" \ "-//OASIS//ELEMENTS DocBook$xml Information Pool V$ver//EN" \ "http://www.oasis-open.org/docbook/xml/$ver/dbpoolx.mod" \ "$TERMUX_PREFIX/etc/xml/docbook-xml" xmlcatalog --noout --add "public" \ "-//OASIS//ELEMENTS DocBook$xml Document Hierarchy V$ver//EN" \ "http://www.oasis-open.org/docbook/xml/$ver/dbhierx.mod" \ "$TERMUX_PREFIX/etc/xml/docbook-xml" xmlcatalog --noout --add "public" \ "-//OASIS//ENTITIES DocBook$xml Additional General Entities V$ver//EN" \ "http://www.oasis-open.org/docbook/xml/$ver/dbgenent.mod" \ "$TERMUX_PREFIX/etc/xml/docbook-xml" xmlcatalog --noout --add "public" \ "-//OASIS//ENTITIES DocBook$xml Notations V$ver//EN" \ "http://www.oasis-open.org/docbook/xml/$ver/dbnotnx.mod" \ "$TERMUX_PREFIX/etc/xml/docbook-xml" xmlcatalog --noout --add "public" \ "-//OASIS//ENTITIES DocBook$xml Character Entities V$ver//EN" \ "http://www.oasis-open.org/docbook/xml/$ver/dbcentx.mod" \ "$TERMUX_PREFIX/etc/xml/docbook-xml" ;;& 4.[45]) xmlcatalog --noout --add "public" \ "-//OASIS//ELEMENTS DocBook XML HTML Tables V$ver//EN" \ "http://www.oasis-open.org/docbook/xml/$ver/htmltblx.mod" \ "$TERMUX_PREFIX/etc/xml/docbook-xml" ;;& *) xmlcatalog --noout --add "rewriteSystem" \ "http://www.oasis-open.org/docbook/xml/$ver" \ "$TERMUX_PREFIX/share/xml/docbook/xml-dtd-$ver" \ "$TERMUX_PREFIX/etc/xml/docbook-xml" xmlcatalog --noout --add "rewriteURI" \ "http://www.oasis-open.org/docbook/xml/$ver" \ "$TERMUX_PREFIX/share/xml/docbook/xml-dtd-$ver" \ "$TERMUX_PREFIX/etc/xml/docbook-xml" ;;& esac done } termux_step_create_debscripts() { cat <<- EOF > ./postinst #!$TERMUX_PREFIX/bin/sh if [ "\$1" = "configure" ]; then if [ ! -e "$TERMUX_PREFIX/etc/xml/catalog" ]; then xmlcatalog --noout --create "$TERMUX_PREFIX/etc/xml/catalog" else xmlcatalog --noout --del "file://$TERMUX_PREFIX/etc/xml/docbook-xml" \ $TERMUX_PREFIX/etc/xml/catalog fi xmlcatalog --noout --add "delegatePublic" \ "-//OASIS//ENTITIES DocBook XML" \ "file://$TERMUX_PREFIX/etc/xml/docbook-xml" \ $TERMUX_PREFIX/etc/xml/catalog xmlcatalog --noout --add "delegatePublic" \ "-//OASIS//DTD DocBook XML" \ "file://$TERMUX_PREFIX/etc/xml/docbook-xml" \ $TERMUX_PREFIX/etc/xml/catalog xmlcatalog --noout --add "delegateSystem" \ "http://www.oasis-open.org/docbook/" \ "file://$TERMUX_PREFIX/etc/xml/docbook-xml" \ $TERMUX_PREFIX/etc/xml/catalog xmlcatalog --noout --add "delegateURI" \ "http://www.oasis-open.org/docbook/" \ "file://$TERMUX_PREFIX/etc/xml/docbook-xml" \ $TERMUX_PREFIX/etc/xml/catalog fi EOF cat <<- EOF > ./prerm #!$TERMUX_PREFIX/bin/sh if [ "\$1" = "remove" ]; then xmlcatalog --noout --del "file://$TERMUX_PREFIX/etc/xml/docbook-xml" \ $TERMUX_PREFIX/etc/xml/catalog fi EOF } ================================================ FILE: packages/docbook-xsl/765567_non-recursive_string_subst.patch ================================================ Description: use EXSLT "replace" function when available A recursive implementation of string.subst is problematic, long strings with many matches will cause stack overflows. Author: Peter De Wachter Bug-Debian: https://bugs.debian.org/750593 --- docbook-xsl-1.78.1+dfsg.orig/docbook-xsl/lib/lib.xsl +++ docbook-xsl-1.78.1+dfsg/docbook-xsl/lib/lib.xsl @@ -6,7 +6,11 @@ This module implements DTD-independent functions - ******************************************************************** --> + ******************************************************************** --> + @@ -52,6 +56,9 @@ + + + ================================================ FILE: packages/docbook-xsl/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://docbook.org/ TERMUX_PKG_DESCRIPTION="XML stylesheets for Docbook-xml transformations" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=1.79.2 TERMUX_PKG_DEPENDS="docbook-xml, libxml2-utils, xsltproc" TERMUX_PKG_PLATFORM_INDEPENDENT=true TERMUX_PKG_BUILD_IN_SRC=true termux_step_extract_package() { mkdir -p $TERMUX_PKG_SRCDIR cd $TERMUX_PKG_SRCDIR termux_download "https://github.com/docbook/xslt10-stylesheets/releases/download/release%2F${TERMUX_PKG_VERSION}/docbook-xsl-$TERMUX_PKG_VERSION.tar.gz" \ $TERMUX_PKG_CACHEDIR/docbook-xsl-$TERMUX_PKG_VERSION.tar.gz \ 966188d7c05fc76eaca115a55893e643dd01a3486f6368733c9ad974fcee7a26 tar xf $TERMUX_PKG_CACHEDIR/docbook-xsl-$TERMUX_PKG_VERSION.tar.gz termux_download "https://github.com/docbook/xslt10-stylesheets/releases/download/release%2F${TERMUX_PKG_VERSION}/docbook-xsl-nons-$TERMUX_PKG_VERSION.tar.gz" \ $TERMUX_PKG_CACHEDIR/docbook-xsl-nons-$TERMUX_PKG_VERSION.tar.gz \ f89425b44e48aad24319a2f0d38e0cb6059fdc7dbaf31787c8346c748175ca8e tar xf $TERMUX_PKG_CACHEDIR/docbook-xsl-nons-$TERMUX_PKG_VERSION.tar.gz } termux_step_patch_package() { cd $TERMUX_PKG_SRCDIR/docbook-xsl-$TERMUX_PKG_VERSION patch -Np2 -i $TERMUX_PKG_BUILDER_DIR/765567_non-recursive_string_subst.patch cd $TERMUX_PKG_SRCDIR/docbook-xsl-nons-$TERMUX_PKG_VERSION patch -Np2 -i $TERMUX_PKG_BUILDER_DIR/765567_non-recursive_string_subst.patch } termux_step_make_install() { local pkgroot ns dir for ns in -nons ''; do pkgroot="$TERMUX_PREFIX/share/xml/docbook/xsl-stylesheets-${TERMUX_PKG_VERSION}${ns}" dir=docbook-xsl${ns}-${TERMUX_PKG_VERSION} install -Dt "$pkgroot" -m600 $dir/VERSION{,.xsl} ( shopt -s nullglob # ignore missing files for fn in assembly common eclipse epub epub3 fo highlighting html \ htmlhelp javahelp lib manpages params profiling roundtrip template \ website xhtml xhtml-1_1 xhtml5 do install -Dt "${pkgroot}/${fn}" -m600 ${dir}/${fn}/*.{xml,xsl,dtd,ent} done ) done } termux_step_create_debscripts() { cat <<- EOF > ./postinst #!$TERMUX_PREFIX/bin/sh if [ "\$1" = "configure" ]; then if [ ! -e "$TERMUX_PREFIX/etc/xml/catalog" ]; then xmlcatalog --noout --create "$TERMUX_PREFIX/etc/xml/catalog" else xmlcatalog --noout --del "$TERMUX_PREFIX/share/xml/docbook/xsl-stylesheets-$TERMUX_PKG_VERSION" \ "$TERMUX_PREFIX/etc/xml/catalog" fi for ver in $TERMUX_PKG_VERSION current; do for x in rewriteSystem rewriteURI; do xmlcatalog --noout --add \$x http://cdn.docbook.org/release/xsl/\$ver \ "$TERMUX_PREFIX/share/xml/docbook/xsl-stylesheets-$TERMUX_PKG_VERSION" \ "$TERMUX_PREFIX/etc/xml/catalog" xmlcatalog --noout --add \$x http://docbook.sourceforge.net/release/xsl-ns/\$ver \ "$TERMUX_PREFIX/share/xml/docbook/xsl-stylesheets-$TERMUX_PKG_VERSION" \ "$TERMUX_PREFIX/etc/xml/catalog" xmlcatalog --noout --add \$x http://docbook.sourceforge.net/release/xsl/\$ver \ "$TERMUX_PREFIX/share/xml/docbook/xsl-stylesheets-${TERMUX_PKG_VERSION}-nons" \ "$TERMUX_PREFIX/etc/xml/catalog" done done fi EOF cat <<- EOF > ./prerm #!$TERMUX_PREFIX/bin/sh if [ "\$1" = "remove" ]; then xmlcatalog --noout --del "$TERMUX_PREFIX/share/xml/docbook/xsl-stylesheets-$TERMUX_PKG_VERSION" \ "$TERMUX_PREFIX/etc/xml/catalog" fi EOF } ================================================ FILE: packages/dos2unix/Makefile.patch ================================================ diff -u -r ../dos2unix-7.4.1/Makefile ./Makefile --- ../dos2unix-7.4.1/Makefile 2019-09-24 18:57:34.000000000 +0000 +++ ./Makefile 2019-10-06 09:21:39.309020574 +0000 @@ -50,7 +50,7 @@ UNIX2MAC = unix2mac # Native Language Support (NLS) -ENABLE_NLS = 1 +# ENABLE_NLS = 1 # Large File Support (LFS) LFS = 1 # DEBUG=1 adds the -g option to CFLAGS, for adding debug symbols. @@ -70,7 +70,7 @@ LINK = ln -sf LINK_MAN = $(LINK) -prefix = /usr +prefix = @TERMUX_PREFIX@ exec_prefix = $(prefix) bindir = $(exec_prefix)/bin datarootdir = $(prefix)/share @@ -357,8 +357,6 @@ EXTRA_CFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 endif -LDFLAGS_USER = -LDFLAGS = $(RPM_LD_FLAGS) $(LDFLAGS_EXTRA) $(LDFLAGS_USER) LIBS = $(LIBS_EXTRA) DEFS_USER = ================================================ FILE: packages/dos2unix/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://waterlan.home.xs4all.nl/dos2unix.html TERMUX_PKG_DESCRIPTION="Converts between DOS and Unix text files" TERMUX_PKG_LICENSE="BSD 2-Clause" TERMUX_PKG_VERSION=7.4.1 TERMUX_PKG_SRCURL=http://waterlan.home.xs4all.nl/dos2unix/dos2unix-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=1cd58a60b03ed28fa39046102a185c5e88c4f7665e1e0417c25de7f8b9f78623 TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_DEPENDS="libandroid-support" ================================================ FILE: packages/double-conversion/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/google/double-conversion TERMUX_PKG_DESCRIPTION="Binary-decimal and decimal-binary routines for IEEE doubles" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=3.1.5 TERMUX_PKG_SRCURL=https://github.com/google/double-conversion/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=a63ecb93182134ba4293fd5f22d6e08ca417caafa244afaa751cbfddf6415b13 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-DBUILD_SHARED_LIBS=ON" ================================================ FILE: packages/doxygen/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.doxygen.org TERMUX_PKG_DESCRIPTION="A documentation system for C++, C, Java, IDL and PHP" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="lokesh @hax4us" TERMUX_PKG_VERSION=1.8.16 TERMUX_PKG_SRCURL=https://github.com/doxygen/doxygen/archive/Release_${TERMUX_PKG_VERSION//./_}.tar.gz TERMUX_PKG_SHA256=75b18117f88ca1930ab74c05f6712690a26dd4fdcfc9d7d5324be43160645fb4 TERMUX_PKG_DEPENDS="libc++, libiconv" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DBISON_EXECUTABLE=$(which bison) -DCMAKE_BUILD_TYPE=Release -DFLEX_EXECUTABLE=$(which flex) -DPYTHON_EXECUTABLE=$(which python3) -Dbuild_parse=yes -Dbuild_xmlparser=yes " termux_step_post_make_install() { mkdir -p $TERMUX_PREFIX/share/man/man1 cp $TERMUX_PKG_SRCDIR/doc/doxygen.1 $TERMUX_PREFIX/share/man/man1 } ================================================ FILE: packages/doxygen/doxyparse.cpp.patch ================================================ diff -uNr doxygen-Release_1_8_16/addon/doxyparse/doxyparse.cpp doxygen-Release_1_8_16.mod/addon/doxyparse/doxyparse.cpp --- doxygen-Release_1_8_16/addon/doxyparse/doxyparse.cpp 2019-08-08 16:36:52.000000000 +0300 +++ doxygen-Release_1_8_16.mod/addon/doxyparse/doxyparse.cpp 2019-08-11 20:18:30.675734491 +0300 @@ -284,7 +284,7 @@ Argument * argument = iterator.toFirst(); if(argument != NULL) { temp = argumentData(argument); -// TODO: This is a workaround; better not include "void" in argList, in the first place. +// TODO: This is a workaround; better not include "void" in argList, in the first place. if(temp != "void") { printNumberOfArguments(argList->count()); } @@ -452,7 +452,7 @@ #else unsigned int pid = (uint)GetCurrentProcessId(); #endif - tmpdir << "/tmp/doxyparse-" << pid; + tmpdir << "@TERMUX_PREFIX@/tmp/doxyparse-" << pid; Config_getString(OUTPUT_DIRECTORY)= tmpdir.str().c_str(); // enable HTML (fake) output to omit warning about missing output format Config_getBool(GENERATE_HTML)=TRUE; ================================================ FILE: packages/dpkg/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://packages.debian.org/dpkg TERMUX_PKG_DESCRIPTION="Debian package management system" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.19.7 TERMUX_PKG_REVISION=9 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/debian/pool/main/d/dpkg/dpkg_${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=4c27fededf620c0aa522fff1a48577ba08144445341257502e7730f2b1a296e8 # with the extract.c.patch we remove the -p and --warning=no-timestamp tar options so we can use busybox tar TERMUX_PKG_DEPENDS="bzip2, coreutils, diffutils, gzip, less, libbz2, liblzma, tar, xz-utils, zlib" TERMUX_PKG_BREAKS="dpkg-dev" TERMUX_PKG_REPLACES="dpkg-dev" TERMUX_PKG_ESSENTIAL=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" ac_cv_lib_selinux_setexecfilecon=no --disable-dselect --disable-largefile --disable-shared --disable-start-stop-daemon dpkg_cv_c99_snprintf=yes HAVE_SETEXECFILECON_FALSE=# --host=${TERMUX_ARCH}-linux --without-selinux " TERMUX_PKG_RM_AFTER_INSTALL=" bin/dpkg-architecture bin/dpkg-buildflags bin/dpkg-buildpackage bin/dpkg-checkbuilddeps bin/dpkg-distaddfile bin/dpkg-genbuildinfo bin/dpkg-genchanges bin/dpkg-gencontrol bin/dpkg-gensymbols bin/dpkg-maintscript-helper bin/dpkg-mergechangelogs bin/dpkg-name bin/dpkg-parsechangelog bin/dpkg-scanpackages bin/dpkg-scansources bin/dpkg-shlibdeps bin/dpkg-source bin/dpkg-statoverride bin/dpkg-vendor include lib share/dpkg share/man/man1/dpkg-architecture.1 share/man/man1/dpkg-buildflags.1 share/man/man1/dpkg-buildpackage.1 share/man/man1/dpkg-checkbuilddeps.1 share/man/man1/dpkg-distaddfile.1 share/man/man1/dpkg-genbuildinfo.1 share/man/man1/dpkg-genchanges.1 share/man/man1/dpkg-gencontrol.1 share/man/man1/dpkg-gensymbols.1 share/man/man1/dpkg-maintscript-helper.1 share/man/man1/dpkg-mergechangelogs.1 share/man/man1/dpkg-name.1 share/man/man1/dpkg-parsechangelog.1 share/man/man1/dpkg-scanpackages.1 share/man/man1/dpkg-scansources.1 share/man/man1/dpkg-shlibdeps.1 share/man/man1/dpkg-source.1 share/man/man1/dpkg-statoverride.1 share/man/man1/dpkg-vendor.1 share/man/man3 share/man/man5 share/perl5 share/polkit-1 " termux_step_pre_configure() { export TAR=tar # To make sure dpkg tries to use "tar" instead of e.g. "gnutar" (which happens when building on OS X) perl -p -i -e "s/TERMUX_ARCH/$TERMUX_ARCH/" $TERMUX_PKG_SRCDIR/configure } termux_step_post_massage() { mkdir -p "${TERMUX_PKG_MASSAGEDIR}/${TERMUX_PREFIX}/var/lib/dpkg/alternatives" mkdir -p "${TERMUX_PKG_MASSAGEDIR}/${TERMUX_PREFIX}/var/lib/dpkg/info" mkdir -p "${TERMUX_PKG_MASSAGEDIR}/${TERMUX_PREFIX}/var/lib/dpkg/triggers" mkdir -p "${TERMUX_PKG_MASSAGEDIR}/${TERMUX_PREFIX}/var/lib/dpkg/updates" } ================================================ FILE: packages/dpkg/configure.patch ================================================ diff -u -r ../dpkg-1.18.15/configure ./configure --- ../dpkg-1.18.15/configure 2016-11-15 21:28:05.000000000 -0500 +++ ./configure 2016-11-26 10:44:53.214082696 -0500 @@ -25749,7 +25749,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dpkg cpu type" >&5 $as_echo_n "checking dpkg cpu type... " >&6; } - cpu_type=$(PERL=$PERL $srcdir/run-script scripts/dpkg-architecture.pl -t$host -qDEB_HOST_ARCH_CPU 2>/dev/null) + cpu_type=TERMUX_ARCH if test "x$cpu_type" = "x"; then : @@ -25800,7 +25800,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dpkg architecture name" >&5 $as_echo_n "checking dpkg architecture name... " >&6; } - dpkg_arch=$(PERL=$PERL $srcdir/run-script scripts/dpkg-architecture.pl -t$host -qDEB_HOST_ARCH 2>/dev/null) + dpkg_arch=TERMUX_ARCH if test "x$dpkg_arch" = "x"; then : ================================================ FILE: packages/dpkg/dbmodify_dont_require_root.patch ================================================ diff -u -r ../dpkg-1.17.6/lib/dpkg/dbmodify.c ./lib/dpkg/dbmodify.c --- ../dpkg-1.17.6/lib/dpkg/dbmodify.c 2013-12-14 06:36:07.000000000 +0100 +++ ./lib/dpkg/dbmodify.c 2014-02-25 18:12:15.000000000 +0100 @@ -253,8 +253,10 @@ switch (readwritereq) { case msdbrw_needsuperuser: case msdbrw_needsuperuserlockonly: +#ifndef __ANDROID__ if (getuid() || geteuid()) ohshit(_("requested operation requires superuser privilege")); +#endif /* Fall through. */ case msdbrw_write: case msdbrw_writeifposs: if (access(dpkg_db_get_dir(), W_OK)) { ================================================ FILE: packages/dpkg/extract.c.patch ================================================ Remove tar options not supported by busybox tar. diff -u -r ../dpkg-1.17.10/dpkg-deb/extract.c ./dpkg-deb/extract.c --- ../dpkg-1.17.10/dpkg-deb/extract.c 2014-06-04 02:02:54.000000000 +0200 +++ ./dpkg-deb/extract.c 2014-07-01 16:40:02.785848137 +0200 @@ -327,14 +327,20 @@ else internerr("unknown or missing tar action '%d'", taroption); +#ifndef __ANDROID__ + /* busybox tar does not support this */ if (taroption & DPKG_TAR_PERMS) command_add_arg(&cmd, "-p"); +#endif if (taroption & DPKG_TAR_NOMTIME) command_add_arg(&cmd, "-m"); command_add_arg(&cmd, "-f"); command_add_arg(&cmd, "-"); +#ifndef __ANDROID__ + /* busybox tar does not support this */ command_add_arg(&cmd, "--warning=no-timestamp"); +#endif m_dup2(p2[0],0); close(p2[0]); ================================================ FILE: packages/dpkg/lib-dpkg-atomic-file.c.patch ================================================ diff -u -r ../dpkg-1.18.2/lib/dpkg/atomic-file.c ./lib/dpkg/atomic-file.c --- ../dpkg-1.18.2/lib/dpkg/atomic-file.c 2015-07-12 22:38:47.000000000 -0400 +++ ./lib/dpkg/atomic-file.c 2015-08-25 18:06:51.689715379 -0400 @@ -90,8 +90,14 @@ if (unlink(name_old) && errno != ENOENT) ohshite(_("error removing old backup file '%s'"), name_old); - if (link(file->name, name_old) && errno != ENOENT) - ohshite(_("error creating new backup file '%s'"), name_old); +#ifdef __ANDROID__ + /* Termux: Use rename(2) since Android does not support hardlinks. */ + if (rename(file->name, name_old) && errno != ENOENT) { +#else + if (link(file->name, name_old) && errno != ENOENT) { +#endif + ohshite(_("error creating new backup file '%s'"), name_old); + } free(name_old); } ================================================ FILE: packages/dpkg/lib-dpkg-dpkg.h.patch ================================================ diff -u -r ../dpkg-1.18.4/lib/dpkg/dpkg.h ./lib/dpkg/dpkg.h --- ../dpkg-1.18.4/lib/dpkg/dpkg.h 2015-12-12 15:49:24.000000000 -0500 +++ ./lib/dpkg/dpkg.h 2016-03-03 17:30:57.812372682 -0500 @@ -92,7 +92,7 @@ #define MAXUPDATES 250 #define DEFAULTSHELL "sh" -#define DEFAULTPAGER "pager" +#define DEFAULTPAGER "less" #define MD5HASHLEN 32 #define MAXTRIGDIRECTIVE 256 ================================================ FILE: packages/dpkg/lib-dpkg-path-remove.c.patch ================================================ Handle EROFS. This is since path_remove_tree() will be called with '/data.dpkg-tmp' '/data/data.dpkg-tmp' '/data/data/com.termux.dpkg-tmp' '/data/data/com.termux/files.dpkg-tmp' '/data/data/com.termux/files/usr.dpkg-tmp' and the first call will get a EROFS, read-only file system error. diff -u -r ../dpkg-1.18.2/lib/dpkg/path-remove.c ./lib/dpkg/path-remove.c --- ../dpkg-1.18.2/lib/dpkg/path-remove.c 2015-07-30 00:39:24.000000000 -0400 +++ ./lib/dpkg/path-remove.c 2015-08-25 18:04:31.391421421 -0400 @@ -126,7 +126,7 @@ debug(dbg_eachfile, "%s '%s'", __func__, pathname); if (!rmdir(pathname)) return; /* Deleted it OK, it was a directory. */ - if (errno == ENOENT || errno == ELOOP) + if (errno == ENOENT || errno == ELOOP || errno == EROFS) return; if (errno == ENOTDIR) { /* Either it's a file, or one of the path components is. If ================================================ FILE: packages/dpkg/lib-dpkg-triglib.c.patch ================================================ diff -u -r ../dpkg-1.18.2/lib/dpkg/triglib.c ./lib/dpkg/triglib.c --- ../dpkg-1.18.2/lib/dpkg/triglib.c 2015-07-12 22:38:47.000000000 -0400 +++ ./lib/dpkg/triglib.c 2015-08-25 17:54:10.350853590 -0400 @@ -787,10 +787,13 @@ if (errno != EEXIST) ohshite(_("unable to create triggers state" " directory '%.250s'"), triggersdir); - } else if (chown(triggersdir, 0, 0)) { + } +#ifndef __ANDROID__ + else if (chown(triggersdir, 0, 0)) { ohshite(_("unable to set ownership of triggers state" " directory '%.250s'"), triggersdir); } +#endif ur = trigdef_update_start(tduf); } switch (ur) { ================================================ FILE: packages/dpkg/src-archives.c.patch ================================================ diff -u -r ../dpkg-1.19.2/src/archives.c ./src/archives.c --- ../dpkg-1.19.2/src/archives.c 2018-10-08 09:43:48.000000000 +0000 +++ ./src/archives.c 2018-11-11 02:17:28.534503365 +0000 @@ -389,9 +389,11 @@ namenode->statoverride->uid, namenode->statoverride->gid, namenode->statoverride->mode); +#ifndef __ANDROID__ rc = fchown(fd, st->uid, st->gid); if (forcible_nonroot_error(rc)) ohshite(_("error setting ownership of '%.255s'"), te->name); +#endif rc = fchmod(fd, st->mode & ~S_IFMT); if (forcible_nonroot_error(rc)) ohshite(_("error setting permissions of '%.255s'"), te->name); @@ -506,13 +508,17 @@ return; /* Already handled using the file descriptor. */ if (te->type == TAR_FILETYPE_SYMLINK) { +#ifndef __ANDROID__ rc = lchown(path, st->uid, st->gid); if (forcible_nonroot_error(rc)) ohshite(_("error setting ownership of symlink '%.255s'"), path); +#endif } else { +#ifndef __ANDROID__ rc = chown(path, st->uid, st->gid); if (forcible_nonroot_error(rc)) ohshite(_("error setting ownership of '%.255s'"), path); +#endif rc = chmod(path, st->mode & ~S_IFMT); if (forcible_nonroot_error(rc)) ohshite(_("error setting permissions of '%.255s'"), path); @@ -552,9 +558,11 @@ else if (linksize > stab->st_size) ohshit(_("symbolic link '%.250s' size has changed from %jd to %zd"), fn_old, (intmax_t)stab->st_size, linksize); +#ifndef __ANDROID__ else if (linksize < stab->st_size) warning(_("symbolic link '%.250s' size has changed from %jd to %zd"), fn_old, (intmax_t)stab->st_size, linksize); +#endif linkname[linksize] = '\0'; if (strcmp(linkname, te->linkname) == 0) { free(linkname); @@ -1041,20 +1049,29 @@ else if (r > stab.st_size) ohshit(_("symbolic link '%.250s' size has changed from %jd to %zd"), fnamevb.buf, (intmax_t)stab.st_size, r); +#ifndef __ANDROID__ else if (r < stab.st_size) warning(_("symbolic link '%.250s' size has changed from %jd to %zd"), fnamevb.buf, (intmax_t)stab.st_size, r); +#endif varbuf_trunc(&symlinkfn, r); varbuf_end_str(&symlinkfn); if (symlink(symlinkfn.buf,fnametmpvb.buf)) ohshite(_("unable to make backup symlink for '%.255s'"), ti->name); +#ifndef __ANDROID__ rc = lchown(fnametmpvb.buf, stab.st_uid, stab.st_gid); if (forcible_nonroot_error(rc)) ohshite(_("unable to chown backup symlink for '%.255s'"), ti->name); +#endif tarobject_set_se_context(fnamevb.buf, fnametmpvb.buf, stab.st_mode); } else { debug(dbg_eachfiledetail, "tarobject nondirectory, 'link' backup"); +#ifdef __ANDROID__ + /* Android does not support hardlinks. */ + if (rename(fnamevb.buf,fnametmpvb.buf)) +#else if (link(fnamevb.buf,fnametmpvb.buf)) +#endif ohshite(_("unable to make backup link of '%.255s' before installing new version"), ti->name); } ================================================ FILE: packages/dpkg/src-configure.c.patch ================================================ diff -u -r ../dpkg-1.18.15/src/configure.c ./src/configure.c --- ../dpkg-1.18.15/src/configure.c 2016-11-11 22:18:40.000000000 -0500 +++ ./src/configure.c 2016-12-03 16:32:43.719508056 -0500 @@ -497,8 +497,10 @@ pkg_name(pkg, pnaw_nonambig), cdr2.buf, strerror(errno)); if (!(what & CFOF_USER_DEL)) - if (link(cdr.buf, cdr2.buf)) - warning(_("%s: failed to link '%.250s' to '%.250s': %s"), + /** Termux modification: Use rename(2) instead of link(2), to avoid hard + links which does not work on Android 6.0 or later. */ + if (rename(cdr.buf, cdr2.buf)) + warning(_("%s: failed to rename '%.250s' to '%.250s': %s"), pkg_name(pkg, pnaw_nonambig), cdr.buf, cdr2.buf, strerror(errno)); /* Fall through. */ ================================================ FILE: packages/dpkg/src-help.c.patch ================================================ diff -u -r ../dpkg-1.19.2/src/help.c ./src/help.c --- ../dpkg-1.19.2/src/help.c 2018-10-07 22:07:52.000000000 +0000 +++ ./src/help.c 2018-11-11 02:13:05.133548711 +0000 @@ -127,8 +127,10 @@ "update_dyld_shared_cache", #elif defined(__GLIBC__) || defined(__UCLIBC__) || \ defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) +#ifndef __ANDROID__ "ldconfig", #endif +#endif #if BUILD_START_STOP_DAEMON "start-stop-daemon", #endif ================================================ FILE: packages/dpkg/src-statcmd.c.patch ================================================ diff -u -r ../dpkg-1.18.2/src/statcmd.c ./src/statcmd.c --- ../dpkg-1.18.2/src/statcmd.c 2015-07-12 22:38:47.000000000 -0400 +++ ./src/statcmd.c 2015-08-25 18:07:59.388890175 -0400 @@ -161,8 +161,10 @@ static void statdb_node_apply(const char *filename, struct file_stat *filestat) { +#ifndef __ANDROID__ if (chown(filename, filestat->uid, filestat->gid) < 0) ohshite(_("error setting ownership of '%.255s'"), filename); +#endif if (chmod(filename, filestat->mode & ~S_IFMT)) ohshite(_("error setting permissions of '%.255s'"), filename); ================================================ FILE: packages/dropbear/Makefile.in.patch ================================================ diff -uNr dropbear-2018.76/Makefile.in dropbear-2018.76.mod/Makefile.in --- dropbear-2018.76/Makefile.in 2018-02-27 16:25:10.000000000 +0200 +++ dropbear-2018.76.mod/Makefile.in 2018-04-21 14:05:03.923792282 +0300 @@ -9,7 +9,7 @@ # dbclient functionality, and includes the progress-bar functionality in scp. ifndef PROGRAMS - PROGRAMS=dropbear dbclient dropbearkey dropbearconvert + PROGRAMS=dropbear dbclient dropbearkey dropbearconvert scp endif STATIC_LTC=libtomcrypt/libtomcrypt.a ================================================ FILE: packages/dropbear/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://matt.ucc.asn.au/dropbear/dropbear.html TERMUX_PKG_DESCRIPTION="Small SSH server and client" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_VERSION=2019.78 TERMUX_PKG_REVISION=2 TERMUX_PKG_SHA256=525965971272270995364a0eb01f35180d793182e63dd0b0c3eb0292291644a4 TERMUX_PKG_SRCURL=https://matt.ucc.asn.au/dropbear/releases/dropbear-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_DEPENDS="termux-auth, zlib" TERMUX_PKG_CONFLICTS="openssh" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-syslog --disable-utmp --disable-utmpx --disable-wtmp --disable-static" # Avoid linking to libcrypt for server password authentication: TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_lib_crypt_crypt=no" # build a multi-call binary & enable progress info in 'scp' TERMUX_PKG_EXTRA_MAKE_ARGS="MULTI=1 SCPPROGRESS=1" termux_step_pre_configure() { export LIBS="-ltermux-auth" } termux_step_post_make_install() { ln -sf "dropbearmulti" "${TERMUX_PREFIX}/bin/ssh" } termux_step_create_debscripts() { { echo "#!$TERMUX_PREFIX/bin/sh" echo "mkdir -p $TERMUX_PREFIX/etc/dropbear" echo "for a in rsa dss ecdsa; do" echo " KEYFILE=$TERMUX_PREFIX/etc/dropbear/dropbear_\${a}_host_key" echo " test ! -f \$KEYFILE && dropbearkey -t \$a -f \$KEYFILE" echo "done" echo "exit 0" } > postinst chmod 0755 postinst } ================================================ FILE: packages/dropbear/common-session.c.patch ================================================ diff -u -r ../dropbear-2019.77/common-session.c ./common-session.c --- ../dropbear-2019.77/common-session.c 2019-03-23 13:46:29.000000000 +0000 +++ ./common-session.c 2019-03-24 22:46:36.558021934 +0000 @@ -68,16 +68,6 @@ /* Sets it to lowdelay */ update_channel_prio(); -#if !DROPBEAR_SVR_MULTIUSER - /* A sanity check to prevent an accidental configuration option - leaving multiuser systems exposed */ - errno = 0; - getuid(); - if (errno != ENOSYS) { - dropbear_exit("Non-multiuser Dropbear requires a non-multiuser kernel"); - } -#endif - now = monotonic_now(); ses.connect_time = now; ses.last_packet_time_keepalive_recv = now; @@ -600,7 +590,7 @@ const char* get_user_shell() { /* an empty shell should be interpreted as "/bin/sh" */ if (ses.authstate.pw_shell[0] == '\0') { - return "/bin/sh"; + return "@TERMUX_PREFIX@/bin/sh"; } else { return ses.authstate.pw_shell; } ================================================ FILE: packages/dropbear/compat.c.patch ================================================ diff -uNr dropbear-2018.76/compat.c dropbear-2018.76.mod/compat.c --- dropbear-2018.76/compat.c 2018-02-27 16:25:10.000000000 +0200 +++ dropbear-2018.76.mod/compat.c 2018-04-21 13:47:36.443738351 +0300 @@ -232,7 +232,7 @@ static char **initshells() { /* don't touch this list. */ - static const char *okshells[] = { "/bin/sh", "/bin/csh", NULL }; + static const char *okshells[] = { "@TERMUX_PREFIX@/bin/sh", "@TERMUX_PREFIX@/bin/csh", NULL }; register char **sp, *cp; register FILE *fp; struct stat statb; @@ -244,7 +244,7 @@ if (strings != NULL) free(strings); strings = NULL; - if ((fp = fopen("/etc/shells", "rc")) == NULL) + if ((fp = fopen("@TERMUX_PREFIX@/etc/shells", "rc")) == NULL) return (char **) okshells; if (fstat(fileno(fp), &statb) == -1) { (void)fclose(fp); ================================================ FILE: packages/dropbear/default_options.h.patch ================================================ diff -u -r ../dropbear-2019.77/default_options.h ./default_options.h --- ../dropbear-2019.77/default_options.h 2019-03-23 13:46:29.000000000 +0000 +++ ./default_options.h 2019-03-24 22:37:39.284638278 +0000 @@ -13,15 +13,15 @@ IMPORTANT: Some options will require "make clean" after changes */ -#define DROPBEAR_DEFPORT "22" +#define DROPBEAR_DEFPORT "8022" /* Listen on all interfaces */ #define DROPBEAR_DEFADDRESS "" /* Default hostkey paths - these can be specified on the command line */ -#define DSS_PRIV_FILENAME "/etc/dropbear/dropbear_dss_host_key" -#define RSA_PRIV_FILENAME "/etc/dropbear/dropbear_rsa_host_key" -#define ECDSA_PRIV_FILENAME "/etc/dropbear/dropbear_ecdsa_host_key" +#define DSS_PRIV_FILENAME "@TERMUX_PREFIX@/etc/dropbear/dropbear_dss_host_key" +#define RSA_PRIV_FILENAME "@TERMUX_PREFIX@/etc/dropbear/dropbear_rsa_host_key" +#define ECDSA_PRIV_FILENAME "@TERMUX_PREFIX@/etc/dropbear/dropbear_ecdsa_host_key" /* Set NON_INETD_MODE if you require daemon functionality (ie Dropbear listens * on chosen ports and keeps accepting connections. This is the default. @@ -44,7 +44,7 @@ * several kB in binary size however will make the symmetrical ciphers and hashes * slower, perhaps by 50%. Recommended for small systems that aren't doing * much traffic. */ -#define DROPBEAR_SMALL_CODE 1 +#undef DROPBEAR_SMALL_CODE /* Enable X11 Forwarding - server only */ #define DROPBEAR_X11FWD 1 @@ -175,7 +175,7 @@ /* Whether to print the message of the day (MOTD). */ #define DO_MOTD 0 -#define MOTD_FILENAME "/etc/motd" +#define MOTD_FILENAME "@TERMUX_PREFIX@/etc/motd" /* Authentication Types - at least one required. RFC Draft requires pubkey auth, and recommends password */ @@ -199,7 +199,7 @@ /* Set this to 0 if your system does not have multiple user support. (Linux kernel CONFIG_MULTIUSER option) The resulting binary will not run on a normal system. */ -#define DROPBEAR_SVR_MULTIUSER 1 +#define DROPBEAR_SVR_MULTIUSER 0 /* Client authentication options */ #define DROPBEAR_CLI_PASSWORD_AUTH 1 @@ -227,7 +227,7 @@ /* Set this to use PRNGD or EGD instead of /dev/urandom */ #define DROPBEAR_USE_PRNGD 0 -#define DROPBEAR_PRNGD_SOCKET "/var/run/dropbear-rng" +#define DROPBEAR_PRNGD_SOCKET "@TERMUX_PREFIX@/var/run/dropbear-rng" /* Specify the number of clients we will allow to be connected but * not yet authenticated. After this limit, connections are rejected */ @@ -244,22 +244,22 @@ /* The default file to store the daemon's process ID, for shutdown scripts etc. This can be overridden with the -P flag */ -#define DROPBEAR_PIDFILE "/var/run/dropbear.pid" +#define DROPBEAR_PIDFILE "@TERMUX_PREFIX@/var/run/dropbear.pid" /* The command to invoke for xauth when using X11 forwarding. * "-q" for quiet */ -#define XAUTH_COMMAND "/usr/bin/xauth -q" +#define XAUTH_COMMAND "@TERMUX_PREFIX@/bin/xauth -q" /* if you want to enable running an sftp server (such as the one included with * OpenSSH), set the path below and set DROPBEAR_SFTPSERVER. * The sftp-server program is not provided by Dropbear itself */ #define DROPBEAR_SFTPSERVER 1 -#define SFTPSERVER_PATH "/usr/libexec/sftp-server" +#define SFTPSERVER_PATH "@TERMUX_PREFIX@/libexec/sftp-server" /* This is used by the scp binary when used as a client binary. If you're * not using the Dropbear client, you'll need to change it */ -#define DROPBEAR_PATH_SSH_PROGRAM "/usr/bin/dbclient" +#define DROPBEAR_PATH_SSH_PROGRAM "@TERMUX_PREFIX@/bin/dbclient" /* Whether to log commands executed by a client. This only logs the * (single) command sent to the server, not what a user did in a @@ -295,6 +295,6 @@ #define DEFAULT_IDLE_TIMEOUT 0 /* The default path. This will often get replaced by the shell */ -#define DEFAULT_PATH "/usr/bin:/bin" +#define DEFAULT_PATH "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets" #endif /* DROPBEAR_DEFAULT_OPTIONS_H_ */ ================================================ FILE: packages/dropbear/gensignkey.c.patch ================================================ diff -uNr dropbear-2018.76/gensignkey.c dropbear-2018.76.mod/gensignkey.c --- dropbear-2018.76/gensignkey.c 2018-02-27 16:25:10.000000000 +0200 +++ dropbear-2018.76.mod/gensignkey.c 2018-04-21 13:45:22.973731479 +0300 @@ -140,6 +140,16 @@ goto out; } +#ifdef __ANDROID__ + /* Hard links are not possible and renam. */ + if (skip_exist && access(filename, F_OK) == 0) { + /* Ok. */ + } else if (rename(fn_temp, filename) < 0) { + dropbear_log(LOG_ERR, "Failed moving key file to %s: %s", filename, + strerror(errno)); + ret = DROPBEAR_FAILURE; + } +#else if (link(fn_temp, filename) < 0) { /* If generating keys on connection (skipexist) it's OK to get EEXIST - we probably just lost a race with another connection to generate the key */ @@ -151,6 +161,7 @@ goto out; } } +#endif out: if (buf) { ================================================ FILE: packages/dropbear/sshpty.c.patch ================================================ diff -uNr dropbear-2018.76/sshpty.c dropbear-2018.76.mod/sshpty.c --- dropbear-2018.76/sshpty.c 2018-02-27 16:25:12.000000000 +0200 +++ dropbear-2018.76.mod/sshpty.c 2018-04-21 13:45:06.703730641 +0300 @@ -22,6 +22,10 @@ #include "errno.h" #include "sshpty.h" +#ifdef __ANDROID__ +# define USE_DEV_PTMX 1 +#endif + /* Pty allocated with _getpty gets broken if we do I_PUSH:es to it. */ #if defined(HAVE__GETPTY) || defined(HAVE_OPENPTY) #undef HAVE_DEV_PTMX @@ -380,6 +384,7 @@ tty_name, strerror(errno)); } + /* if (st.st_uid != pw->pw_uid || st.st_gid != gid) { if (chown(tty_name, pw->pw_uid, gid) < 0) { if (errno == EROFS && @@ -409,4 +414,5 @@ } } } + */ } ================================================ FILE: packages/dropbear/svr-agentfwd.c.patch ================================================ diff -uNr dropbear-2018.76/svr-agentfwd.c dropbear-2018.76.mod/svr-agentfwd.c --- dropbear-2018.76/svr-agentfwd.c 2018-02-27 16:25:12.000000000 +0200 +++ dropbear-2018.76.mod/svr-agentfwd.c 2018-04-21 13:46:57.660403020 +0300 @@ -41,7 +41,7 @@ #include "listener.h" #include "auth.h" -#define AGENTDIRPREFIX "/tmp/dropbear-" +#define AGENTDIRPREFIX "@TERMUX_PREFIX@/tmp/dropbear-" static int send_msg_channel_open_agent(int fd); static int bindagent(int fd, struct ChanSess * chansess); ================================================ FILE: packages/dropbear/svr-auth.c.patch ================================================ diff -uNr dropbear-2018.76/svr-auth.c dropbear-2018.76.mod/svr-auth.c --- dropbear-2018.76/svr-auth.c 2018-02-27 16:25:12.000000000 +0200 +++ dropbear-2018.76.mod/svr-auth.c 2018-04-21 13:48:35.083741369 +0300 @@ -93,6 +93,9 @@ } username = buf_getstring(ses.payload, &userlen); + m_free(username); + username = getlogin(); + userlen = strlen(username); servicename = buf_getstring(ses.payload, &servicelen); methodname = buf_getstring(ses.payload, &methodlen); @@ -102,7 +105,6 @@ SSH_SERVICE_CONNECTION_LEN) != 0)) { /* TODO - disconnect here */ - m_free(username); m_free(servicename); m_free(methodname); dropbear_exit("unknown service in auth"); @@ -192,7 +194,6 @@ out: - m_free(username); m_free(servicename); m_free(methodname); } @@ -320,9 +321,10 @@ usershell = ses.authstate.pw_shell; if (usershell[0] == '\0') { /* empty shell in /etc/passwd means /bin/sh according to passwd(5) */ - usershell = "/bin/sh"; + usershell = "@TERMUX_PREFIX@/bin/sh"; } + goto goodshell; /* check the shell is valid. If /etc/shells doesn't exist, getusershell() * should return some standard shells like "/bin/sh" and "/bin/csh" (this * is platform-specific) */ @@ -343,7 +345,7 @@ return DROPBEAR_FAILURE; goodshell: - endusershell(); + //endusershell(); TRACE(("matching shell")) TRACE(("uid = %d", ses.authstate.pw_uid)) ================================================ FILE: packages/dropbear/svr-authpasswd.c.patch ================================================ diff -u -r ../dropbear-2019.77/svr-authpasswd.c ./svr-authpasswd.c --- ../dropbear-2019.77/svr-authpasswd.c 2019-03-23 13:46:29.000000000 +0000 +++ ./svr-authpasswd.c 2019-03-24 22:40:59.586161245 +0000 @@ -33,28 +33,13 @@ #if DROPBEAR_SVR_PASSWORD_AUTH -/* not constant time when strings are differing lengths. - string content isn't leaked, and crypt hashes are predictable length. */ -static int constant_time_strcmp(const char* a, const char* b) { - size_t la = strlen(a); - size_t lb = strlen(b); - - if (la != lb) { - return 1; - } - - return constant_time_memcmp(a, b, la); -} +#include /* Process a password auth request, sending success or failure messages as * appropriate */ void svr_auth_password(int valid_user) { - - char * passwdcrypt = NULL; /* the crypt from /etc/passwd or /etc/shadow */ - char * testcrypt = NULL; /* crypt generated from the user's password sent */ - char * password = NULL; - unsigned int passwordlen; - unsigned int changepw; + char *password; + unsigned int changepw, passwordlen; /* check if client wants to change password */ changepw = buf_getbool(ses.payload); @@ -65,47 +50,9 @@ } password = buf_getstring(ses.payload, &passwordlen); - if (valid_user && passwordlen <= DROPBEAR_MAX_PASSWORD_LEN) { - /* the first bytes of passwdcrypt are the salt */ - passwdcrypt = ses.authstate.pw_passwd; - testcrypt = crypt(password, passwdcrypt); - } - m_burn(password, passwordlen); - m_free(password); - - /* After we have got the payload contents we can exit if the username - is invalid. Invalid users have already been logged. */ - if (!valid_user) { - send_msg_userauth_failure(0, 1); - return; - } - - if (passwordlen > DROPBEAR_MAX_PASSWORD_LEN) { - dropbear_log(LOG_WARNING, - "Too-long password attempt for '%s' from %s", - ses.authstate.pw_name, - svr_ses.addrstring); - send_msg_userauth_failure(0, 1); - return; - } - - if (testcrypt == NULL) { - /* crypt() with an invalid salt like "!!" */ - dropbear_log(LOG_WARNING, "User account '%s' is locked", - ses.authstate.pw_name); - send_msg_userauth_failure(0, 1); - return; - } - - /* check for empty password */ - if (passwdcrypt[0] == '\0') { - dropbear_log(LOG_WARNING, "User '%s' has blank password, rejected", - ses.authstate.pw_name); - send_msg_userauth_failure(0, 1); - return; - } - if (constant_time_strcmp(testcrypt, passwdcrypt) == 0) { + /* check if password is valid */ + if (termux_auth(ses.authstate.pw_name, password)) { /* successful authentication */ dropbear_log(LOG_NOTICE, "Password auth succeeded for '%s' from %s", ================================================ FILE: packages/dropbear/svr-chansession.c.patch ================================================ diff -uNr dropbear-2018.76/svr-chansession.c dropbear-2018.76.mod/svr-chansession.c --- dropbear-2018.76/svr-chansession.c 2018-02-27 16:25:12.000000000 +0200 +++ dropbear-2018.76.mod/svr-chansession.c 2018-04-21 13:45:06.707063974 +0300 @@ -919,6 +919,8 @@ #endif /* clear environment */ + /* termux: do not clear environment on android */ +#ifndef __ANDROID__ /* if we're debugging using valgrind etc, we need to keep the LD_PRELOAD * etc. This is hazardous, so should only be used for debugging. */ #ifndef DEBUG_VALGRIND @@ -931,6 +933,7 @@ } #endif /* HAVE_CLEARENV */ #endif /* DEBUG_VALGRIND */ +#endif /* __ANDROID__ */ /* We can only change uid/gid as root ... */ if (getuid() == 0) { @@ -956,12 +959,14 @@ } } + /* termux: do not modify environment since we did not clean it */ +#ifndef __ANDROID__ /* set env vars */ addnewvar("USER", ses.authstate.pw_name); addnewvar("LOGNAME", ses.authstate.pw_name); addnewvar("HOME", ses.authstate.pw_dir); addnewvar("SHELL", get_user_shell()); - addnewvar("PATH", DEFAULT_PATH); +#endif /* __ANDROID__ */ if (chansess->term != NULL) { addnewvar("TERM", chansess->term); } ================================================ FILE: packages/dropbear/sysoptions.h.patch ================================================ diff -uNr dropbear-2018.76/sysoptions.h dropbear-2018.76.mod/sysoptions.h --- dropbear-2018.76/sysoptions.h 2018-02-27 16:25:12.000000000 +0200 +++ dropbear-2018.76.mod/sysoptions.h 2018-10-21 13:49:10.558094478 +0300 @@ -71,7 +71,7 @@ #define _PATH_TTY "/dev/tty" -#define _PATH_CP "/bin/cp" +#define _PATH_CP "@TERMUX_PREFIX@/bin/cp" #define DROPBEAR_ESCAPE_CHAR '~' @@ -233,10 +233,6 @@ #error "DROPBEAR_SVR_PATM_AUTH requires PAM headers. Perhaps ./configure --enable-pam ?" #endif -#if DROPBEAR_SVR_PASSWORD_AUTH && !HAVE_CRYPT - #error "DROPBEAR_SVR_PASSWORD_AUTH requires `crypt()'." -#endif - #if !(DROPBEAR_SVR_PASSWORD_AUTH || DROPBEAR_SVR_PAM_AUTH || DROPBEAR_SVR_PUBKEY_AUTH) #error "At least one server authentication type must be enabled. DROPBEAR_SVR_PUBKEY_AUTH and DROPBEAR_SVR_PASSWORD_AUTH are recommended." #endif ================================================ FILE: packages/dtc/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://git.kernel.org/pub/scm/utils/dtc/dtc TERMUX_PKG_DESCRIPTION="Device Tree Compiler" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.5.1 TERMUX_PKG_SRCURL=https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/dtc-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=45f9885f890c5feab8110a721410970deb8f83987d0125f1a2703bc8ec140e33 TERMUX_PKG_BREAKS="dtc-dev" TERMUX_PKG_REPLACES="dtc-dev" TERMUX_PKG_EXTRA_MAKE_ARGS="PREFIX=$TERMUX_PREFIX" TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/dte/build.sh ================================================ TERMUX_PKG_HOMEPAGE='https://craigbarnes.gitlab.io/dte/' TERMUX_PKG_DESCRIPTION='A small, configurable console text editor' TERMUX_PKG_LICENSE='GPL-2.0' TERMUX_PKG_VERSION=1.9.1 TERMUX_PKG_SRCURL="https://craigbarnes.gitlab.io/dist/dte/dte-${TERMUX_PKG_VERSION}.tar.gz" TERMUX_PKG_SHA256='80d2732269a308b5e1126ecc16c28cda032864f625a95184821a73c054f81a2d' TERMUX_PKG_DEPENDS="libandroid-support, libandroid-glob, libiconv, ncurses" TERMUX_PKG_BUILD_IN_SRC=true termux_step_make() { make \ -j$TERMUX_MAKE_PROCESSES V=1 \ LDLIBS='-landroid-support -landroid-glob -liconv -lcurses' } termux_step_make_install() { make install V=1 prefix="$TERMUX_PREFIX" } ================================================ FILE: packages/duc/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://duc.zevv.nl/ TERMUX_PKG_DESCRIPTION="High-performance disk usage analyzer" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.4.4 TERMUX_PKG_REVISION=8 TERMUX_PKG_SRCURL=https://github.com/zevv/duc/releases/download/$TERMUX_PKG_VERSION/duc-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=f4e7483dbeca4e26b003548f9f850b84ce8859bba90da89c55a7a147636ba922 TERMUX_PKG_DEPENDS="leveldb, ncurses" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-x11 --with-db-backend=leveldb --disable-cairo" ================================================ FILE: packages/duc/cmd-ls.c.patch ================================================ diff -uNr duc-1.4.4/src/duc/cmd-ls.c duc-1.4.4.mod/src/duc/cmd-ls.c --- duc-1.4.4/src/duc/cmd-ls.c 2018-09-08 22:27:41.000000000 +0300 +++ duc-1.4.4.mod/src/duc/cmd-ls.c 2019-02-05 21:37:24.412100024 +0200 @@ -221,6 +221,7 @@ duc_dir *dir = duc_dir_open(duc, path); if(dir == NULL) { duc_log(duc, DUC_LOG_FTL, "%s", duc_strerror(duc)); + return; } if(opt_directory) { ================================================ FILE: packages/dvtm/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/martanne/dvtm TERMUX_PKG_DESCRIPTION="Terminal tiling window manager" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=0.15 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/martanne/dvtm/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=496eada13d8abaa8d772279746f78b0c6fed11b560599490f3e70ebc21197bf0 TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_DEPENDS="ncurses" termux_step_pre_configure() { CFLAGS+=" $CPPFLAGS" } ================================================ FILE: packages/dvtm/fix-fifo-path.patch ================================================ diff -uNr dvtm-0.15/dvtm-status dvtm-0.15.mod/dvtm-status --- dvtm-0.15/dvtm-status 2016-01-09 13:40:12.000000000 +0200 +++ dvtm-0.15.mod/dvtm-status 2017-09-09 21:28:15.370807282 +0300 @@ -1,6 +1,6 @@ #!/bin/sh -FIFO="/tmp/dvtm-status.$$" +FIFO="@TERMUX_PREFIX@/tmp/dvtm-status.$$" [ -p "$FIFO" ] || mkfifo -m 600 "$FIFO" || exit 1 ================================================ FILE: packages/dvtm/vt.c.patch ================================================ diff -u -r ../dvtm-0.15/vt.c ./vt.c --- ../dvtm-0.15/vt.c 2016-01-09 06:40:56.000000000 -0500 +++ ./vt.c 2016-01-21 08:09:47.457953606 -0500 @@ -21,7 +21,9 @@ #include #include #include +#ifndef __ANDROID__ #include +#endif #include #include #include @@ -1309,10 +1311,14 @@ static void is_utf8_locale(void) { +#ifdef __ANDROID__ + is_utf8 = true; +#else const char *cset = nl_langinfo(CODESET); if (!cset) cset = "ANSI_X3.4-1968"; is_utf8 = !strcmp(cset, "UTF-8"); +#endif } static wchar_t get_vt100_graphic(char c) ================================================ FILE: packages/dx/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://developer.android.com/tools/help/index.html TERMUX_PKG_DESCRIPTION="Command which takes in class files and reformulates them for usage on Android" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_VERSION=$TERMUX_ANDROID_BUILD_TOOLS_VERSION TERMUX_PKG_SKIP_SRC_EXTRACT=true TERMUX_PKG_PLATFORM_INDEPENDENT=true termux_step_make_install() { # Rewrite packages to avoid using com.android.* classes which may clash with # classes in the Android runtime on devices (see #1801): local JARJAR=$TERMUX_PKG_CACHEDIR/jarjar.jar local RULEFILE=$TERMUX_PKG_TMPDIR/jarjar-rule.txt local REWRITTEN_DX=$TERMUX_PKG_TMPDIR/dx-rewritten.jar termux_download \ http://central.maven.org/maven2/com/googlecode/jarjar/jarjar/1.3/jarjar-1.3.jar \ $JARJAR \ 4225c8ee1bf3079c4b07c76fe03c3e28809a22204db6249c9417efa4f804b3a7 echo 'rule com.android.** dx.@1' > $RULEFILE java -jar $JARJAR process $RULEFILE \ $ANDROID_HOME/build-tools/${TERMUX_PKG_VERSION}/lib/dx.jar \ $REWRITTEN_DX # Dex the rewritten jar file: mkdir -p $TERMUX_PREFIX/share/dex $TERMUX_D8 \ --release \ --min-api $TERMUX_PKG_API_LEVEL \ --output $TERMUX_PKG_TMPDIR \ $REWRITTEN_DX cd $TERMUX_PKG_TMPDIR jar cf dx.jar classes.dex mv dx.jar $TERMUX_PREFIX/share/dex/dx.jar install $TERMUX_PKG_BUILDER_DIR/dx $TERMUX_PREFIX/bin/dx perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/dx } ================================================ FILE: packages/dx/dx ================================================ #!/bin/sh exec dalvikvm \ -Xmx256m \ -cp @TERMUX_PREFIX@/share/dex/dx.jar \ dx.dx.command.Main $@ ================================================ FILE: packages/e2fsprogs/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://e2fsprogs.sourceforge.net TERMUX_PKG_DESCRIPTION="EXT 2/3/4 filesystem utilities" TERMUX_PKG_LICENSE="GPL-2.0, LGPL-2.0, MIT" TERMUX_PKG_LICENSE_FILE="NOTICE" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.45.4 TERMUX_PKG_SRCURL=https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v$TERMUX_PKG_VERSION/e2fsprogs-$TERMUX_PKG_VERSION.tar.xz TERMUX_PKG_SHA256=65faf6b590ca1da97440d6446bd11de9e0914b42553740ba5d9d2a796fa0dc02 TERMUX_PKG_CONFFILES="etc/mke2fs.conf" TERMUX_PKG_NO_STATICSPLIT=true ## util-linux provides libblkid TERMUX_PKG_DEPENDS="libuuid, util-linux" TERMUX_PKG_BREAKS="e2fsprogs-dev" TERMUX_PKG_REPLACES="e2fsprogs-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --sbindir=${TERMUX_PREFIX}/bin --enable-symlink-install --enable-relative-symlinks --disable-defrag --disable-e2initrd-helper --disable-libuuid --disable-libblkid --disable-uuidd" # Remove com_err.h to avoid conflicting with krb5-dev: TERMUX_PKG_RM_AFTER_INSTALL=" bin/compile_et bin/mk_cmds include/com_err.h share/et share/ss share/man/man1/compile_et.1 share/man/man1/mk_cmds.1" termux_step_make_install() { make install install-libs install -Dm600 \ "$TERMUX_PKG_SRCDIR"/misc/mke2fs.conf.in \ "$TERMUX_PREFIX"/etc/mke2fs.conf } ================================================ FILE: packages/e2fsprogs/clang-compat.patch ================================================ diff -uNr e2fsprogs-1.45.1/debugfs/set_fields.c e2fsprogs-1.45.1.mod/debugfs/set_fields.c --- e2fsprogs-1.45.1/debugfs/set_fields.c 2019-05-13 04:23:53.000000000 +0300 +++ e2fsprogs-1.45.1.mod/debugfs/set_fields.c 2019-05-21 14:52:33.637119261 +0300 @@ -296,9 +296,11 @@ { "checksum", &set_mmp.mmp_checksum, NULL, 4, parse_uint }, { 0, 0, 0, 0 } }; +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 6) #pragma GCC diagnostic pop #endif +#endif #ifdef UNITTEST diff -uNr e2fsprogs-1.45.1/e2fsck/problem.c e2fsprogs-1.45.1.mod/e2fsck/problem.c --- e2fsprogs-1.45.1/e2fsck/problem.c 2019-05-13 04:23:53.000000000 +0300 +++ e2fsprogs-1.45.1.mod/e2fsck/problem.c 2019-05-21 14:52:33.640119278 +0300 @@ -102,10 +102,12 @@ "", /* 21 */ }; +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 6) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmissing-field-initializers" #endif +#endif static struct e2fsck_problem problem_table[] = { @@ -2107,9 +2109,11 @@ { PR_LATCH_OPTIMIZE_EXT, PR_1E_OPTIMIZE_EXT_HEADER, PR_1E_OPTIMIZE_EXT_END, 0 }, { -1, 0, 0, 0 }, }; +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 6) #pragma GCC diagnostic pop #endif +#endif static struct e2fsck_problem *find_problem(problem_t code) { diff -uNr e2fsprogs-1.45.1/lib/ext2fs/ext4_acl.h e2fsprogs-1.45.1.mod/lib/ext2fs/ext4_acl.h --- e2fsprogs-1.45.1/lib/ext2fs/ext4_acl.h 2019-05-13 04:23:53.000000000 +0300 +++ e2fsprogs-1.45.1.mod/lib/ext2fs/ext4_acl.h 2019-05-21 14:52:33.641119283 +0300 @@ -50,13 +50,17 @@ typedef struct { __le32 a_version; +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 8) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" #endif +#endif posix_acl_xattr_entry a_entries[0]; +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 8) #pragma GCC diagnostic pop #endif +#endif } posix_acl_xattr_header; diff -uNr e2fsprogs-1.45.1/lib/ext2fs/fiemap.h e2fsprogs-1.45.1.mod/lib/ext2fs/fiemap.h --- e2fsprogs-1.45.1/lib/ext2fs/fiemap.h 2019-05-13 04:23:53.000000000 +0300 +++ e2fsprogs-1.45.1.mod/lib/ext2fs/fiemap.h 2019-05-21 14:52:33.641119283 +0300 @@ -31,14 +31,18 @@ __u32 fm_mapped_extents;/* number of extents that were mapped (out) */ __u32 fm_extent_count; /* size of fm_extents array (in) */ __u32 fm_reserved; +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 8) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" #endif +#endif struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */ +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 8) #pragma GCC diagnostic pop #endif +#endif }; #if defined(__linux__) && !defined(FS_IOC_FIEMAP) diff -uNr e2fsprogs-1.45.1/lib/ext2fs/hashmap.c e2fsprogs-1.45.1.mod/lib/ext2fs/hashmap.c --- e2fsprogs-1.45.1/lib/ext2fs/hashmap.c 2019-05-13 04:23:53.000000000 +0300 +++ e2fsprogs-1.45.1.mod/lib/ext2fs/hashmap.c 2019-05-21 14:55:42.819113922 +0300 @@ -7,14 +7,18 @@ void(*free)(void*); struct ext2fs_hashmap_entry *first; struct ext2fs_hashmap_entry *last; +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 8) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" #endif +#endif struct ext2fs_hashmap_entry *entries[0]; +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 8) #pragma GCC diagnostic pop #endif +#endif }; uint32_t ext2fs_djb2_hash(const void *str, size_t size) diff -uNr e2fsprogs-1.45.1/lib/ext2fs/hashmap.h e2fsprogs-1.45.1.mod/lib/ext2fs/hashmap.h --- e2fsprogs-1.45.1/lib/ext2fs/hashmap.h 2019-05-13 04:23:53.000000000 +0300 +++ e2fsprogs-1.45.1.mod/lib/ext2fs/hashmap.h 2019-05-21 14:53:28.371429925 +0300 @@ -4,6 +4,7 @@ # include # include +#ifndef __ANDROID__ #ifndef __GNUC_PREREQ #if defined(__GNUC__) && defined(__GNUC_MINOR__) #define __GNUC_PREREQ(maj, min) \ @@ -12,6 +13,7 @@ #define __GNUC_PREREQ(maj, min) 0 #endif #endif +#endif struct ext2fs_hashmap; diff -uNr e2fsprogs-1.45.1/lib/ext2fs/mmp.c e2fsprogs-1.45.1.mod/lib/ext2fs/mmp.c --- e2fsprogs-1.45.1/lib/ext2fs/mmp.c 2019-05-13 04:23:53.000000000 +0300 +++ e2fsprogs-1.45.1.mod/lib/ext2fs/mmp.c 2019-05-21 14:52:33.641119283 +0300 @@ -34,12 +34,14 @@ #define O_DIRECT 0 #endif +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 6) #pragma GCC diagnostic push #ifndef CONFIG_MMP #pragma GCC diagnostic ignored "-Wunused-parameter" #endif #endif +#endif errcode_t ext2fs_mmp_read(ext2_filsys fs, blk64_t mmp_blk, void *buf) { @@ -467,6 +469,8 @@ return EXT2_ET_OP_NOT_SUPPORTED; #endif } +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 6) #pragma GCC diagnostic pop #endif +#endif diff -uNr e2fsprogs-1.45.1/lib/ext2fs/unix_io.c e2fsprogs-1.45.1.mod/lib/ext2fs/unix_io.c --- e2fsprogs-1.45.1/lib/ext2fs/unix_io.c 2019-05-13 04:23:53.000000000 +0300 +++ e2fsprogs-1.45.1.mod/lib/ext2fs/unix_io.c 2019-05-21 14:52:33.642119289 +0300 @@ -1152,10 +1152,12 @@ } /* parameters might not be used if OS doesn't support zeroout */ +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 6) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #endif +#endif static errcode_t unix_zeroout(io_channel channel, unsigned long long block, unsigned long long count) { @@ -1204,9 +1206,11 @@ unimplemented: return EXT2_ET_UNIMPLEMENTED; } +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 6) #pragma GCC diagnostic pop #endif +#endif static struct struct_io_manager struct_unix_manager = { .magic = EXT2_ET_MAGIC_IO_MANAGER, diff -uNr e2fsprogs-1.45.1/misc/filefrag.c e2fsprogs-1.45.1.mod/misc/filefrag.c --- e2fsprogs-1.45.1/misc/filefrag.c 2019-05-13 04:23:53.000000000 +0300 +++ e2fsprogs-1.45.1.mod/misc/filefrag.c 2019-05-21 14:52:33.642119289 +0300 @@ -537,10 +537,12 @@ char *end; blocksize = strtoul(optarg, &end, 0); if (end) { +#ifndef __ANDROID__ #if __GNUC_PREREQ (7, 0) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" #endif +#endif switch (end[0]) { case 'g': case 'G': @@ -557,9 +559,11 @@ default: break; } +#ifndef __ANDROID__ #if __GNUC_PREREQ (7, 0) #pragma GCC diagnostic pop #endif +#endif } } else { /* Allow -b without argument for compat. Remove * this eventually so "-b {blocksize}" works */ ================================================ FILE: packages/e2fsprogs/doc-Makefile.in.patch ================================================ diff -uNr e2fsprogs-1.44.4/doc/Makefile.in e2fsprogs-1.44.4.mod/doc/Makefile.in --- e2fsprogs-1.44.4/doc/Makefile.in 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/doc/Makefile.in 2018-09-22 15:22:14.779251149 +0300 @@ -17,7 +17,7 @@ HTML=makeinfo --html --no-split PS2PDF=ps2pdf -all:: libext2fs.info libext2fs.dvi libext2fs.html +all:: libext2fs.info install-doc-libs: libext2fs.info libext2fs.dvi $(Q) $(RM) -rf $(DESTDIR)$(infodir)/libext2fs.info* ================================================ FILE: packages/e2fsprogs/fix-hardcoded-paths.patch ================================================ diff -uNr e2fsprogs-1.44.4/debugfs/debugfs.c e2fsprogs-1.44.4.mod/debugfs/debugfs.c --- e2fsprogs-1.44.4/debugfs/debugfs.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/debugfs/debugfs.c 2018-09-22 15:22:14.775917803 +0300 @@ -87,7 +87,7 @@ */ tdb_dir = ss_safe_getenv("E2FSPROGS_UNDO_DIR"); if (!tdb_dir) - tdb_dir = "/var/lib/e2fsprogs"; + tdb_dir = "@TERMUX_PREFIX@/var/lib/e2fsprogs"; if (!strcmp(tdb_dir, "none") || (tdb_dir[0] == 0) || access(tdb_dir, W_OK)) diff -uNr e2fsprogs-1.44.4/debugfs/util.c e2fsprogs-1.44.4.mod/debugfs/util.c --- e2fsprogs-1.44.4/debugfs/util.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/debugfs/util.c 2018-09-22 15:22:14.779251149 +0300 @@ -61,7 +61,7 @@ } static const char *pager_search_list[] = { "pager", "more", "less", 0 }; -static const char *pager_dir_list[] = { "/usr/bin", "/bin", 0 }; +static const char *pager_dir_list[] = { "@TERMUX_PREFIX@/bin", "@TERMUX_PREFIX@/bin/applets", 0 }; static const char *find_pager(char *buf) { diff -uNr e2fsprogs-1.44.4/e2fsck/e2fsck.h e2fsprogs-1.44.4.mod/e2fsck/e2fsck.h --- e2fsprogs-1.44.4/e2fsck/e2fsck.h 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/e2fsck/e2fsck.h 2018-09-22 15:22:14.779251149 +0300 @@ -53,7 +53,7 @@ #define NLS_CAT_NAME "e2fsprogs" #endif #ifndef LOCALEDIR -#define LOCALEDIR "/usr/share/locale" +#define LOCALEDIR "@TERMUX_PREFIX@/share/locale" #endif #else #define _(a) (a) diff -uNr e2fsprogs-1.44.4/e2fsck/unix.c e2fsprogs-1.44.4.mod/e2fsck/unix.c --- e2fsprogs-1.44.4/e2fsck/unix.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/e2fsck/unix.c 2018-09-22 15:22:14.782584494 +0300 @@ -601,7 +601,7 @@ return 0; } -#define PATH_SET "PATH=/sbin" +#define PATH_SET "PATH=@TERMUX_PREFIX@/bin" /* * Make sure 0,1,2 file descriptors are open, so that we don't open @@ -1306,7 +1306,7 @@ tdb_dir = getenv("E2FSPROGS_UNDO_DIR"); if (!tdb_dir) { profile_get_string(ctx->profile, "defaults", - "undo_dir", 0, "/var/lib/e2fsprogs", + "undo_dir", 0, "@TERMUX_PREFIX@/var/lib/e2fsprogs", &tdb_dir); free_tdb_dir = 1; } diff -uNr e2fsprogs-1.44.4/ext2ed/init.c e2fsprogs-1.44.4.mod/ext2ed/init.c --- e2fsprogs-1.44.4/ext2ed/init.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/ext2ed/init.c 2018-09-22 15:22:14.789251186 +0300 @@ -613,8 +613,8 @@ mounted=0; - if ( (fp=fopen ("/etc/mtab","rt"))==NULL) { - wprintw (command_win,"Error - Failed to open /etc/mtab. Assuming filesystem is mounted.\n"); + if ( (fp=fopen ("@TERMUX_PREFIX@/etc/mtab","rt"))==NULL) { + wprintw (command_win,"Error - Failed to open @TERMUX_PREFIX@/etc/mtab. Assuming filesystem is mounted.\n"); refresh_command_win ();mounted=1;return; }; diff -uNr e2fsprogs-1.44.4/lib/blkid/blkidP.h e2fsprogs-1.44.4.mod/lib/blkid/blkidP.h --- e2fsprogs-1.44.4/lib/blkid/blkidP.h 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/lib/blkid/blkidP.h 2018-09-22 15:22:14.795917878 +0300 @@ -110,7 +110,7 @@ extern char *blkid_strdup(const char *s); extern char *blkid_strndup(const char *s, const int length); -#define BLKID_CACHE_FILE "/etc/blkid.tab" +#define BLKID_CACHE_FILE "@TERMUX_PREFIX@/etc/blkid.tab" #define BLKID_ERR_IO 5 #define BLKID_ERR_PROC 9 diff -uNr e2fsprogs-1.44.4/lib/support/nls-enable.h e2fsprogs-1.44.4.mod/lib/support/nls-enable.h --- e2fsprogs-1.44.4/lib/support/nls-enable.h 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/lib/support/nls-enable.h 2018-09-22 15:22:14.799251223 +0300 @@ -12,7 +12,7 @@ #define NLS_CAT_NAME "e2fsprogs" #endif #ifndef LOCALEDIR -#define LOCALEDIR "/usr/share/locale" +#define LOCALEDIR "@TERMUX_PREFIX@/share/locale" #endif #else #define _(a) (a) diff -uNr e2fsprogs-1.44.4/lib/uuid/gen_uuid.c e2fsprogs-1.44.4.mod/lib/uuid/gen_uuid.c --- e2fsprogs-1.44.4/lib/uuid/gen_uuid.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/lib/uuid/gen_uuid.c 2018-09-22 15:27:30.643742706 +0300 @@ -325,7 +325,7 @@ if (state_fd == -2) { save_umask = umask(0); - state_fd = open("/var/lib/libuuid/clock.txt", + state_fd = open("@TERMUX_PREFIX@/var/lib/libuuid/clock.txt", O_RDWR|O_CREAT, 0660); (void) umask(save_umask); if (state_fd >= 0) { @@ -484,12 +484,14 @@ } #endif /* defined(USE_UUIDD) && defined(HAVE_SYS_UN_H) */ +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 6) #pragma GCC diagnostic push #if !defined(USE_UUIDD) || !defined(HAVE_SYS_UN_H) #pragma GCC diagnostic ignored "-Wunused-parameter" #endif #endif +#endif /* * Try using the uuidd daemon to generate the UUID * @@ -572,9 +574,11 @@ #endif return -1; } +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 6) #pragma GCC diagnostic pop #endif +#endif void uuid__generate_time(uuid_t out, int *num) { diff -uNr e2fsprogs-1.44.4/lib/uuid/uuidd.h e2fsprogs-1.44.4.mod/lib/uuid/uuidd.h --- e2fsprogs-1.44.4/lib/uuid/uuidd.h 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/lib/uuid/uuidd.h 2018-09-22 15:22:14.802584569 +0300 @@ -35,10 +35,10 @@ #ifndef _UUID_UUIDD_H #define _UUID_UUIDD_H -#define UUIDD_DIR "/var/lib/libuuid" +#define UUIDD_DIR "@TERMUX_PREFIX@/var/lib/libuuid" #define UUIDD_SOCKET_PATH UUIDD_DIR "/request" #define UUIDD_PIDFILE_PATH UUIDD_DIR "/uuidd.pid" -#define UUIDD_PATH "/usr/sbin/uuidd" +#define UUIDD_PATH "@TERMUX_PREFIX@/bin/uuidd" #define UUIDD_OP_GETPID 0 #define UUIDD_OP_GET_MAXOP 1 diff -uNr e2fsprogs-1.44.4/misc/badblocks.c e2fsprogs-1.44.4.mod/misc/badblocks.c --- e2fsprogs-1.44.4/misc/badblocks.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/misc/badblocks.c 2018-09-22 15:22:14.802584569 +0300 @@ -1007,7 +1007,7 @@ fprintf(stderr, _("%s is mounted; "), device_name); if (force) { fputs(_("badblocks forced anyway. " - "Hope /etc/mtab is incorrect.\n"), stderr); + "Hope @TERMUX_PREFIX@/etc/mtab is incorrect.\n"), stderr); return; } abort_badblocks: diff -uNr e2fsprogs-1.44.4/misc/blkid.c e2fsprogs-1.44.4.mod/misc/blkid.c --- e2fsprogs-1.44.4/misc/blkid.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/misc/blkid.c 2018-09-22 15:22:14.805917914 +0300 @@ -53,7 +53,7 @@ fprintf(out, "usage:\t%s [-c ] [-ghlLv] [-o format] " "[-s ] [-t ]\n [-w ] [dev ...]\n" - "\t-c\tcache file (default: /etc/blkid.tab, /dev/null = none)\n" + "\t-c\tcache file (default: @TERMUX_PREFIX@/etc/blkid.tab, /dev/null = none)\n" "\t-h\tprint this usage message and exit\n" "\t-g\tgarbage collect the blkid cache\n" "\t-s\tshow specified tag(s) (default show all tags)\n" diff -uNr e2fsprogs-1.44.4/misc/e2undo.c e2fsprogs-1.44.4.mod/misc/e2undo.c --- e2fsprogs-1.44.4/misc/e2undo.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/misc/e2undo.c 2018-09-22 15:28:19.140584897 +0300 @@ -81,14 +81,18 @@ __le32 magic; /* KEYBLOCK_MAGIC number */ __le32 crc; /* block checksum */ __le64 reserved; /* zero */ +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 8) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" #endif +#endif struct undo_key keys[0]; /* keys, which come immediately after */ +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 8) #pragma GCC diagnostic pop #endif +#endif }; struct undo_key_info { @@ -246,7 +250,7 @@ */ tdb_dir = getenv("E2FSPROGS_UNDO_DIR"); if (!tdb_dir) - tdb_dir = "/var/lib/e2fsprogs"; + tdb_dir = "@TERMUX_PREFIX@/var/lib/e2fsprogs"; if (!strcmp(tdb_dir, "none") || (tdb_dir[0] == 0) || access(tdb_dir, W_OK)) diff -uNr e2fsprogs-1.44.4/misc/e4crypt.c e2fsprogs-1.44.4.mod/misc/e4crypt.c --- e2fsprogs-1.44.4/misc/e4crypt.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/misc/e4crypt.c 2018-09-22 15:22:14.812584606 +0300 @@ -613,7 +613,7 @@ static void get_default_salts(void) { - FILE *f = setmntent("/etc/mtab", "r"); + FILE *f = setmntent("@TERMUX_PREFIX@/etc/mtab", "r"); struct mntent *mnt; while (f && ((mnt = getmntent(f)) != NULL)) { diff -uNr e2fsprogs-1.44.4/misc/e4defrag.c e2fsprogs-1.44.4.mod/misc/e4defrag.c --- e2fsprogs-1.44.4/misc/e4defrag.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/misc/e4defrag.c 2018-09-22 15:22:14.812584606 +0300 @@ -223,7 +223,7 @@ fp = setmntent(mtab, "r"); if (fp == NULL) { - perror("Couldn't access /etc/mtab"); + perror("Couldn't access @TERMUX_PREFIX@/etc/mtab"); return -1; } @@ -290,7 +290,7 @@ fp = setmntent(mtab, "r"); if (fp == NULL) { - perror("Couldn't access /etc/mtab"); + perror("Couldn't access @TERMUX_PREFIX@/etc/mtab"); return -1; } diff -uNr e2fsprogs-1.44.4/misc/fsck.c e2fsprogs-1.44.4.mod/misc/fsck.c --- e2fsprogs-1.44.4/misc/fsck.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/misc/fsck.c 2018-09-22 15:22:14.815917952 +0300 @@ -64,7 +64,7 @@ #include "blkid/blkid.h" #ifndef _PATH_MNTTAB -#define _PATH_MNTTAB "/etc/fstab" +#define _PATH_MNTTAB "@TERMUX_PREFIX@/etc/fstab" #endif static const char *ignored_types[] = { @@ -120,7 +120,7 @@ static char *fstype = NULL; static struct fs_info *filesys_info = NULL, *filesys_last = NULL; static struct fsck_instance *instance_list; -static const char *fsck_prefix_path = "/sbin:/sbin/fs.d:/sbin/fs:/etc/fs:/etc"; +static const char *fsck_prefix_path = "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets"; static char *fsck_path = 0; static blkid_cache cache = NULL; @@ -367,9 +367,9 @@ if (old_fstab && filesys_info) { fputs("\007\007\007", stderr); fputs(_( - "WARNING: Your /etc/fstab does not contain the fsck passno\n" + "WARNING: Your @TERMUX_PREFIX@/etc/fstab does not contain the fsck passno\n" " field. I will kludge around things for you, but you\n" - " should fix your /etc/fstab file as soon as you can.\n\n"), stderr); + " should fix your @TERMUX_PREFIX@/etc/fstab file as soon as you can.\n\n"), stderr); for (fs = filesys_info; fs; fs = fs->next) { fs->passno = 1; @@ -888,7 +888,7 @@ */ if (opt_in_list("bind", fs->opts)) { fprintf(stderr, - _("%s: skipping bad line in /etc/fstab: bind mount with nonzero fsck pass number\n"), + _("%s: skipping bad line in @TERMUX_PREFIX@/etc/fstab: bind mount with nonzero fsck pass number\n"), fs->mountpt); return 1; } diff -uNr e2fsprogs-1.44.4/misc/fuse2fs.c e2fsprogs-1.44.4.mod/misc/fuse2fs.c --- e2fsprogs-1.44.4/misc/fuse2fs.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/misc/fuse2fs.c 2018-09-22 15:28:50.517364876 +0300 @@ -52,7 +52,7 @@ #define NLS_CAT_NAME "e2fsprogs" #endif #ifndef LOCALEDIR -#define LOCALEDIR "/usr/share/locale" +#define LOCALEDIR "@TERMUX_PREFIX@/share/locale" #endif #else #define _(a) (a) @@ -118,14 +118,18 @@ typedef struct { u_int32_t a_version; +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 8) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" #endif +#endif acl_ea_entry a_entries[0]; +#ifndef __ANDROID__ #if __GNUC_PREREQ (4, 8) #pragma GCC diagnostic pop #endif +#endif } acl_ea_header; static inline size_t acl_ea_size(int count) diff -uNr e2fsprogs-1.44.4/misc/ismounted.c e2fsprogs-1.44.4.mod/misc/ismounted.c --- e2fsprogs-1.44.4/misc/ismounted.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/misc/ismounted.c 2018-09-22 15:22:14.822584643 +0300 @@ -197,7 +197,7 @@ if (mount_flags) return 1; #endif /* __linux__ */ - retval = check_mntent_file("/etc/mtab", file, &mount_flags); + retval = check_mntent_file("@TERMUX_PREFIX@/etc/mtab", file, &mount_flags); if (retval) return 0; return (mount_flags); diff -uNr e2fsprogs-1.44.4/misc/mke2fs.c e2fsprogs-1.44.4.mod/misc/mke2fs.c --- e2fsprogs-1.44.4/misc/mke2fs.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/misc/mke2fs.c 2018-09-22 15:22:14.825917989 +0300 @@ -781,7 +781,7 @@ return 1; } -#define PATH_SET "PATH=/sbin" +#define PATH_SET "PATH=@TERMUX_PREFIX@/bin" static void parse_extended_opts(struct ext2_super_block *param, const char *opts) @@ -2623,7 +2623,7 @@ tdb_dir = getenv("E2FSPROGS_UNDO_DIR"); if (!tdb_dir) { profile_get_string(profile, "defaults", - "undo_dir", 0, "/var/lib/e2fsprogs", + "undo_dir", 0, "@TERMUX_PREFIX@/var/lib/e2fsprogs", &tdb_dir); free_tdb_dir = 1; } diff -uNr e2fsprogs-1.44.4/misc/tune2fs.c e2fsprogs-1.44.4.mod/misc/tune2fs.c --- e2fsprogs-1.44.4/misc/tune2fs.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/misc/tune2fs.c 2018-09-22 15:22:14.829251334 +0300 @@ -2764,7 +2764,7 @@ */ tdb_dir = getenv("E2FSPROGS_UNDO_DIR"); if (!tdb_dir) - tdb_dir = "/var/lib/e2fsprogs"; + tdb_dir = "@TERMUX_PREFIX@/var/lib/e2fsprogs"; if (!strcmp(tdb_dir, "none") || (tdb_dir[0] == 0) || access(tdb_dir, W_OK)) diff -uNr e2fsprogs-1.44.4/misc/util.c e2fsprogs-1.44.4.mod/misc/util.c --- e2fsprogs-1.44.4/misc/util.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/misc/util.c 2018-09-22 15:22:14.832584681 +0300 @@ -130,7 +130,7 @@ if (mount_flags & EXT2_MF_MOUNTED) { fprintf(stderr, _("%s is mounted; "), device); if (force >= 2) { - fputs(_("mke2fs forced anyway. Hope /etc/mtab is " + fputs(_("mke2fs forced anyway. Hope @TERMUX_PREFIX@/etc/mtab is " "incorrect.\n"), stderr); return; } diff -uNr e2fsprogs-1.44.4/resize/main.c e2fsprogs-1.44.4.mod/resize/main.c --- e2fsprogs-1.44.4/resize/main.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/resize/main.c 2018-09-22 15:22:14.842584717 +0300 @@ -198,7 +198,7 @@ */ tdb_dir = getenv("E2FSPROGS_UNDO_DIR"); if (!tdb_dir) - tdb_dir = "/var/lib/e2fsprogs"; + tdb_dir = "@TERMUX_PREFIX@/var/lib/e2fsprogs"; if (!strcmp(tdb_dir, "none") || (tdb_dir[0] == 0) || access(tdb_dir, W_OK)) diff -uNr e2fsprogs-1.44.4/resize/resize2fs.h e2fsprogs-1.44.4.mod/resize/resize2fs.h --- e2fsprogs-1.44.4/resize/resize2fs.h 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/resize/resize2fs.h 2018-09-22 15:22:14.842584717 +0300 @@ -51,7 +51,7 @@ #define NLS_CAT_NAME "e2fsprogs" #endif #ifndef LOCALEDIR -#define LOCALEDIR "/usr/share/locale" +#define LOCALEDIR "@TERMUX_PREFIX@/share/locale" #endif #else #define _(a) (a) diff -uNr e2fsprogs-1.44.4/util/android_config.h e2fsprogs-1.44.4.mod/util/android_config.h --- e2fsprogs-1.44.4/util/android_config.h 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/util/android_config.h 2018-09-22 15:22:14.845918064 +0300 @@ -2,7 +2,7 @@ #define HAVE_MALLOC_H 1 #endif -#define ROOT_SYSCONFDIR "/etc" +#define ROOT_SYSCONFDIR "@TERMUX_PREFIX@/etc" #define ENABLE_LIBSPARSE 1 ================================================ FILE: packages/e2fsprogs/fsmap.h.patch ================================================ diff -uNr e2fsprogs-1.44.4/misc/fsmap.h e2fsprogs-1.44.4.mod/misc/fsmap.h --- e2fsprogs-1.44.4/misc/fsmap.h 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/misc/fsmap.h 2018-09-22 15:22:14.819251297 +0300 @@ -84,6 +84,26 @@ #define FMR_OWN_METADATA FMR_OWNER(0, 3) /* metadata */ #define FS_IOC_GETFSMAP _IOWR('X', 59, struct fsmap_head) +#else + +#ifdef __ANDROID__ +/* Size of an fsmap_head with room for nr records. */ +static inline size_t +fsmap_sizeof( + unsigned int nr) +{ + return sizeof(struct fsmap_head) + nr * sizeof(struct fsmap); +} + +/* Start the next fsmap query at the end of the current query results. */ +static inline void +fsmap_advance( + struct fsmap_head *head) +{ + head->fmh_keys[0] = head->fmh_recs[head->fmh_entries - 1]; +} +#endif + #endif /* FS_IOC_GETFSMAP */ #endif ================================================ FILE: packages/e2fsprogs/hasmntopt.patch ================================================ diff -uNr e2fsprogs-1.44.4/lib/ext2fs/ismounted.c e2fsprogs-1.44.4.mod/lib/ext2fs/ismounted.c --- e2fsprogs-1.44.4/lib/ext2fs/ismounted.c 2018-08-19 05:26:58.000000000 +0300 +++ e2fsprogs-1.44.4.mod/lib/ext2fs/ismounted.c 2018-09-22 15:22:14.795917878 +0300 @@ -57,6 +57,26 @@ #include "ext2fs.h" #include "ext2fsP.h" +char *hasmntopt(const struct mntent *mnt, const char *opt) +{ + char *cp = mnt->mnt_opts; + int len = strlen(opt); + + if (!mnt->mnt_opts) + return 0; + + while (1) { + if (!(cp = strstr(cp, opt))) + break; + if ((cp == mnt->mnt_opts || cp[-1]==',') && + (cp[len] == 0 || cp[len] == ',' || cp[len] == '=')) + return cp; + cp += (len + 1); + } + + return 0; +} + #ifdef HAVE_SETMNTENT /* * Check to see if a regular file is mounted. @@ -234,7 +254,7 @@ errcode_t retval; #ifdef DEBUG - retval = check_mntent_file("/tmp/mtab", file, mount_flags, + retval = check_mntent_file("@TERMUX_PREFIX@/tmp/mtab", file, mount_flags, mtpt, mtlen); if (retval == 0) return 0; ================================================ FILE: packages/ecj/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.eclipse.org/jdt/core/ TERMUX_PKG_DESCRIPTION="Eclipse Compiler for Java" TERMUX_PKG_LICENSE="EPL-2.0" TERMUX_PKG_VERSION=4.12 local _date=201906051800 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=http://archive.eclipse.org/eclipse/downloads/drops${TERMUX_PKG_VERSION:0:1}/R-$TERMUX_PKG_VERSION-$_date/ecj-$TERMUX_PKG_VERSION.jar TERMUX_PKG_SHA256=69dad18a1fcacd342a7d44c5abf74f50e7529975553a24c64bce0b29b86af497 TERMUX_PKG_PLATFORM_INDEPENDENT=true TERMUX_PKG_CONFLICTS="ecj4.6" termux_step_extract_package() { # Certain packages are not safe to build on device because their # build.sh script deletes specific files in $TERMUX_PREFIX. if $TERMUX_ON_DEVICE_BUILD; then termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds." fi mkdir $TERMUX_PKG_SRCDIR } termux_step_make() { local RAW_JAR=$TERMUX_PKG_CACHEDIR/ecj-${TERMUX_PKG_VERSION}.jar termux_download $TERMUX_PKG_SRCURL \ $RAW_JAR \ $TERMUX_PKG_SHA256 mkdir -p $TERMUX_PREFIX/share/{dex,java} $TERMUX_D8 \ --classpath $ANDROID_HOME/platforms/android-$TERMUX_PKG_API_LEVEL/android.jar \ --release \ --min-api $TERMUX_PKG_API_LEVEL \ --output $TERMUX_PKG_TMPDIR \ $RAW_JAR # Package classes.dex into jar: cd $TERMUX_PKG_TMPDIR jar cf ecj.jar classes.dex # Add needed properties file to jar file: jar xf $RAW_JAR org/eclipse/jdt/internal/compiler/batch/messages.properties jar uf ecj.jar org/eclipse/jdt/internal/compiler/batch/messages.properties jar xf $RAW_JAR org/eclipse/jdt/internal/compiler/problem/messages.properties jar uf ecj.jar org/eclipse/jdt/internal/compiler/problem/messages.properties jar xf $RAW_JAR org/eclipse/jdt/internal/compiler/messages.properties jar uf ecj.jar org/eclipse/jdt/internal/compiler/messages.properties jar xf $RAW_JAR org/eclipse/jdt/internal/compiler/parser/readableNames.props jar uf ecj.jar org/eclipse/jdt/internal/compiler/parser/readableNames.props for i in $(seq 1 24); do jar xf $RAW_JAR org/eclipse/jdt/internal/compiler/parser/parser$i.rsc jar uf ecj.jar org/eclipse/jdt/internal/compiler/parser/parser$i.rsc done # Move into place: mv ecj.jar $TERMUX_PREFIX/share/dex/ecj.jar rm -rf android-jar mkdir android-jar cd android-jar # We need the android classes for JDT to compile against. cp $ANDROID_HOME/platforms/android-28/android.jar . unzip -q android.jar rm -Rf android.jar resources.arsc res assets jar cfM android.jar . cp $TERMUX_PKG_TMPDIR/android-jar/android.jar $TERMUX_PREFIX/share/java/android.jar # Bundle in an android.jar from an older API also, for those who want to # build apps that run on older Android versions. rm -Rf ./* cp $ANDROID_HOME/platforms/android-$TERMUX_PKG_API_LEVEL/android.jar android.jar unzip -q android.jar rm -Rf android.jar resources.arsc res assets jar cfM android-$TERMUX_PKG_API_LEVEL.jar . cp $TERMUX_PKG_TMPDIR/android-jar/android-$TERMUX_PKG_API_LEVEL.jar $TERMUX_PREFIX/share/java/ rm -Rf $TERMUX_PREFIX/bin/javac install $TERMUX_PKG_BUILDER_DIR/ecj $TERMUX_PREFIX/bin/ecj perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/ecj install $TERMUX_PKG_BUILDER_DIR/ecj-$TERMUX_PKG_API_LEVEL $TERMUX_PREFIX/bin/ecj-$TERMUX_PKG_API_LEVEL perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/ecj-$TERMUX_PKG_API_LEVEL } ================================================ FILE: packages/ecj/ecj ================================================ #!/bin/sh # -proc:none to disable annotation processing. # -7 for java 1.7 compatibility. dalvikvm -Xmx256m \ -cp @TERMUX_PREFIX@/share/dex/ecj.jar \ org.eclipse.jdt.internal.compiler.batch.Main \ -proc:none \ -7 \ -cp @TERMUX_PREFIX@/share/java/android.jar \ "$@" ================================================ FILE: packages/ecj/ecj-24 ================================================ #!/bin/sh # -proc:none to disable annotation processing. # -7 for java 1.7 compatibility. dalvikvm -Xmx256m \ -cp @TERMUX_PREFIX@/share/dex/ecj.jar \ org.eclipse.jdt.internal.compiler.batch.Main \ -proc:none \ -7 \ -cp @TERMUX_PREFIX@/share/java/android-24.jar \ "$@" ================================================ FILE: packages/ed/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/ed/ TERMUX_PKG_DESCRIPTION="Classic UNIX line editor" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Oliver Schmidhauser @Neo-Oli" TERMUX_PKG_VERSION=1.15 TERMUX_PKG_SHA256=ad4489c0ad7a108c514262da28e6c2a426946fb408a3977ef1ed34308bdfd174 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/ed/ed-${TERMUX_PKG_VERSION}.tar.lz ================================================ FILE: packages/ed/configure.patch ================================================ diff --git a/configure b/configure index 50f3cad..31256c2 100755 --- a/configure +++ b/configure @@ -21,10 +21,10 @@ datarootdir='$(prefix)/share' infodir='$(datarootdir)/info' mandir='$(datarootdir)/man' program_prefix= -CC=gcc -CPPFLAGS= -CFLAGS='-Wall -W -O2' -LDFLAGS= +CC?=gcc +CPPFLAGS?= +CFLAGS?='-Wall -W -O2' +LDFLAGS?= # checking whether we are using GNU C. ${CC} --version > /dev/null 2>&1 ================================================ FILE: packages/elinks/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://elinks.or.cz TERMUX_PKG_DESCRIPTION="Full-Featured Text WWW Browser" TERMUX_PKG_LICENSE="GPL-2.0" _COMMIT=f86be659718c0cd0a67f88b42f07044c23d0d028 TERMUX_PKG_VERSION=0.13.GIT TERMUX_PKG_REVISION=4 TERMUX_PKG_SRCURL=https://github.com/xeffyr/elinks/archive/${_COMMIT}.zip TERMUX_PKG_SHA256=3e65aaabcc4f6b2418643cf965786c00e3f196330f3e7863ca83f9e546d5e609 TERMUX_PKG_DEPENDS="libexpat, libiconv, libidn, openssl, libbz2, zlib" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --enable-256-colors --enable-true-color --mandir=$TERMUX_PREFIX/share/man --with-openssl --without-brotli --without-gc " TERMUX_MAKE_PROCESSES=1 termux_step_pre_configure() { ./autogen.sh } ================================================ FILE: packages/elinks/elinks-fix-paths.patch ================================================ diff --git a/contrib/proxy/gen.c b/contrib/proxy/gen.c index 6e7807ab..8b5b2b1a 100644 --- a/contrib/proxy/gen.c +++ b/contrib/proxy/gen.c @@ -5,7 +5,7 @@ #include struct stat st; -char *file = "/tmp/log"; +char *file = "@TERMUX_PREFIX@/tmp/log"; unsigned char *data; int counter = 0; @@ -17,7 +17,7 @@ struct { } tab[100000]; /* should be enough */ unsigned char header[] = -"#!/usr/bin/env python\n" +"#!@TERMUX_PREFIX@/bin/env python\n" "import BaseHTTPServer\n\n"; unsigned char footer[] = diff --git a/src/network/socket.c b/src/network/socket.c index 3426b681..480d7378 100644 --- a/src/network/socket.c +++ b/src/network/socket.c @@ -83,7 +83,7 @@ static INIT_LIST_OF(struct socket_weak_ref, socket_weak_refs); /* To enable logging of tranfers, for debugging purposes. */ #if 0 -#define DEBUG_TRANSFER_LOGFILE "/tmp/log" +#define DEBUG_TRANSFER_LOGFILE "@TERMUX_PREFIX@/tmp/log" static void debug_transfer_log(unsigned char *data, int len) diff --git a/src/osdep/unix/sysinfo.h b/src/osdep/unix/sysinfo.h index 7b4ef587..d2653d87 100644 --- a/src/osdep/unix/sysinfo.h +++ b/src/osdep/unix/sysinfo.h @@ -6,7 +6,7 @@ #define SYSTEM_NAME "Unix" #define SYSTEM_STR "unix" -#define DEFAULT_SHELL "/bin/sh" +#define DEFAULT_SHELL "@TERMUX_PREFIX@/bin/sh" #define GETSHELL getenv("SHELL") static inline int dir_sep(char x) { return x == '/'; } diff --git a/src/protocol/file/mailcap.c b/src/protocol/file/mailcap.c index 24b47025..06eff352 100644 --- a/src/protocol/file/mailcap.c +++ b/src/protocol/file/mailcap.c @@ -110,7 +110,7 @@ mailcap_protocol_handler(struct connection *conn) /* We implicitly chain stderr to ELinks' stderr. */ close_all_non_term_fd(); - if (execl("/bin/sh", "/bin/sh", "-c", script, (char *) NULL)) { + if (execl("@TERMUX_PREFIX@/bin/sh", "@TERMUX_PREFIX@/bin/sh", "-c", script, (char *) NULL)) { _exit(3); } diff --git a/src/session/download.c b/src/session/download.c index 000bbe97..538f1715 100644 --- a/src/session/download.c +++ b/src/session/download.c @@ -373,7 +373,7 @@ exec_mailcap_command(void *data) add_to_string(&string, "mailcap:"); add_to_string(&string, exec_mailcap->command); if (exec_mailcap->file) { - add_to_string(&string, " && /bin/rm -f "); + add_to_string(&string, " && @TERMUX_PREFIX@/bin/rm -f "); add_to_string(&string, exec_mailcap->file); } @@ -1067,7 +1067,7 @@ subst_file(unsigned char *prog, unsigned char *file) struct string s; if (init_string(&s)) { - add_to_string(&s, "/bin/cat "); + add_to_string(&s, "@TERMUX_PREFIX@/bin/cat "); add_shell_quoted_to_string(&s, file, strlen(file)); add_to_string(&s, " | "); add_string_to_string(&s, &name); diff --git a/src/setup.h b/src/setup.h index 572610f5..5b69de99 100644 --- a/src/setup.h +++ b/src/setup.h @@ -83,11 +83,11 @@ /* Default mime settings */ #define DEFAULT_MIME_TYPE "application/octet-stream" -#define DEFAULT_PAGER_PATH "/usr/bin/pager" -#define DEFAULT_LESS_PATH "/usr/bin/less" -#define DEFAULT_MORE_PATH "/usr/bin/more" -#define DEFAULT_MAILCAP_PATH "~/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap:/usr/share/mailcap:/usr/share/misc/mailcap" -#define DEFAULT_MIMETYPES_PATH "~/.mime.types:/etc/mime.types:/usr/etc/mime.types:/usr/local/etc/mime.types:/usr/share/mime.types:/usr/share/misc/mime.types" +#define DEFAULT_PAGER_PATH "@TERMUX_PREFIX@/bin/pager" +#define DEFAULT_LESS_PATH "@TERMUX_PREFIX@/bin/less" +#define DEFAULT_MORE_PATH "@TERMUX_PREFIX@/bin/more" +#define DEFAULT_MAILCAP_PATH "~/.mailcap:@TERMUX_PREFIX@/etc/mailcap:@TERMUX_PREFIX@/share/mailcap" +#define DEFAULT_MIMETYPES_PATH "~/.mime.types:@TERMUX_PREFIX@/etc/mime.types:@TERMUX_PREFIX@/share/mime.types" /* Default external commands (see osdep/newwin.c and/or system-specific osdep/ * files) */ diff --git a/src/util/file.c b/src/util/file.c index 90882eed..cae9052e 100644 --- a/src/util/file.c +++ b/src/util/file.c @@ -186,7 +186,7 @@ get_tempdir_filename(unsigned char *name) if (!tmpdir || !*tmpdir) tmpdir = getenv("TMP"); if (!tmpdir || !*tmpdir) tmpdir = getenv("TEMPDIR"); if (!tmpdir || !*tmpdir) tmpdir = getenv("TEMP"); - if (!tmpdir || !*tmpdir) tmpdir = "/tmp"; + if (!tmpdir || !*tmpdir) tmpdir = "@TERMUX_PREFIX@/tmp"; return straconcat(tmpdir, "/", name, (unsigned char *) NULL); } ================================================ FILE: packages/elixir/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://elixir-lang.org/ TERMUX_PKG_DESCRIPTION="Elixir is a dynamic, functional language designed for building scalable and maintainable applications" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.9.4 TERMUX_PKG_SRCURL=https://github.com/elixir-lang/elixir/releases/download/v${TERMUX_PKG_VERSION}/Precompiled.zip TERMUX_PKG_SHA256=8cdc158084405a1f867076d55f58351cf75f4e9a21fa36d9fd8a13021e8cd6fc TERMUX_PKG_DEPENDS="dash, erlang" TERMUX_PKG_SUGGESTS="clang, make" TERMUX_PKG_PLATFORM_INDEPENDENT=true termux_step_extract_package() { termux_download "$TERMUX_PKG_SRCURL" "$TERMUX_PKG_CACHEDIR"/prebuilt.zip \ "$TERMUX_PKG_SHA256" # Unpack directly to $PREFIX/opt/elixir. mkdir -p "$TERMUX_PREFIX"/opt rm -rf "$TERMUX_PREFIX"/opt/elixir unzip -d "$TERMUX_PREFIX"/opt/elixir "$TERMUX_PKG_CACHEDIR"/prebuilt.zip # Create src directory to avoid build-package.sh errors. mkdir -p "$TERMUX_PKG_SRCDIR" } termux_step_make_install() { # Remove unneeded files. (cd "$TERMUX_PREFIX"/opt/elixir/man; rm -f common elixir.1.in iex.1.in) # Put manpages to standard location. for page in elixir.1 elixirc.1 iex.1 mix.1; do install -Dm600 "$TERMUX_PREFIX/opt/elixir/man/$page" \ "$TERMUX_PREFIX/share/man/man1/$page" done unset page rm -rf "$TERMUX_PREFIX"/opt/elixir/man # Symlink startup scripts to $PREFIX/bin. for file in elixir elixirc iex mix; do ln -sfr "$TERMUX_PREFIX/opt/elixir/bin/$file" \ "$TERMUX_PREFIX/bin/$file" done unset file } ================================================ FILE: packages/emacs/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/emacs/ TERMUX_PKG_DESCRIPTION="Extensible, customizable text editor-and more" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=26.3 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/emacs/emacs-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=4d90e6751ad8967822c6e092db07466b9d383ef1653feb2f95c93e7de66d3485 TERMUX_PKG_DEPENDS="ncurses, gnutls, libxml2" TERMUX_PKG_BREAKS="emacs-dev" TERMUX_PKG_REPLACES="emacs-dev" TERMUX_PKG_CONFFILES="var/service/emacsd/run var/service/emacsd/log/run" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-autodepend --with-gif=no --with-gnutls --with-jpeg=no --without-gconf --without-gsettings --without-lcms2 --without-x --with-png=no --with-tiff=no --with-xml2 --with-xpm=no --without-dbus " # Ensure use of system malloc: TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" emacs_cv_sanitize_address=yes" # Prevent configure from adding -nopie: TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" emacs_cv_prog_cc_no_pie=no" # Prevent linking against libelf: TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_lib_elf_elf_begin=no" # implemented using dup3(), which fails if oldfd == newfd TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" gl_cv_func_dup2_works=no" # disable setrlimit function to make termux-am work from within emacs TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_setrlimit=no" TERMUX_PKG_HOSTBUILD=true # Remove some irrelevant files: TERMUX_PKG_RM_AFTER_INSTALL="share/icons share/emacs/${TERMUX_PKG_VERSION}/etc/images share/applications/emacs.desktop share/emacs/${TERMUX_PKG_VERSION}/etc/emacs.desktop share/emacs/${TERMUX_PKG_VERSION}/etc/emacs.icon bin/grep-changelog share/man/man1/grep-changelog.1.gz share/emacs/${TERMUX_PKG_VERSION}/etc/refcards share/emacs/${TERMUX_PKG_VERSION}/etc/tutorials/TUTORIAL.*" # Remove ctags from the emacs package to prevent conflicting with # the Universal Ctags from the 'ctags' package (the bin/etags # program still remain in the emacs package): TERMUX_PKG_RM_AFTER_INSTALL+=" bin/ctags share/man/man1/ctags.1 share/man/man1/ctags.1.gz" termux_step_post_extract_package() { # Certain packages are not safe to build on device because their # build.sh script deletes specific files in $TERMUX_PREFIX. if $TERMUX_ON_DEVICE_BUILD; then termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds." fi # XXX: We have to start with new host build each time # to avoid build error when cross compiling. rm -Rf $TERMUX_PKG_HOSTBUILD_DIR # Termux only use info pages for emacs. Remove the info directory # to get a clean Info directory file dir. rm -Rf $TERMUX_PREFIX/share/info # We cannot run a dumped emacs on Android 5.0+ due to the pie requirement. # Also, the native emacs we build (bootstrap-emacs) cannot used dumps when # building inside docker: https://github.com/docker/docker/issues/22801 export CANNOT_DUMP=yes } termux_step_host_build() { # Build a bootstrap-emacs binary to be used in termux_step_post_configure. local NATIVE_PREFIX=$TERMUX_PKG_TMPDIR/emacs-native mkdir -p $NATIVE_PREFIX/share/emacs/$TERMUX_PKG_VERSION ln -s $TERMUX_PKG_SRCDIR/lisp $NATIVE_PREFIX/share/emacs/$TERMUX_PKG_VERSION/lisp $TERMUX_PKG_SRCDIR/configure --prefix=$NATIVE_PREFIX --without-all --with-x-toolkit=no make -j $TERMUX_MAKE_PROCESSES } termux_step_post_configure() { cp $TERMUX_PKG_HOSTBUILD_DIR/src/bootstrap-emacs $TERMUX_PKG_BUILDDIR/src/bootstrap-emacs cp $TERMUX_PKG_HOSTBUILD_DIR/lib-src/make-docfile $TERMUX_PKG_BUILDDIR/lib-src/make-docfile # Update timestamps so that the binaries does not get rebuilt: touch -d "next hour" $TERMUX_PKG_BUILDDIR/src/bootstrap-emacs $TERMUX_PKG_BUILDDIR/lib-src/make-docfile } termux_step_post_make_install() { cp $TERMUX_PKG_BUILDER_DIR/site-init.el $TERMUX_PREFIX/share/emacs/${TERMUX_PKG_VERSION}/lisp/emacs-lisp/ # Setup emacs --daemon service script mkdir -p $TERMUX_PREFIX/var/service cd $TERMUX_PREFIX/var/service mkdir -p emacsd/log echo "#!$TERMUX_PREFIX/bin/sh" > emacsd/run echo 'exec emacs --fg-daemon 2>&1' >> emacsd/run chmod +x emacsd/run touch emacsd/down ln -sf $TERMUX_PREFIX/share/termux-services/svlogger emacsd/log/run } termux_step_create_debscripts() { cat <<- EOF > ./postinst #!$TERMUX_PREFIX/bin/sh if [ "\$1" = "configure" ] || [ "\$1" = "abort-upgrade" ]; then if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then update-alternatives --install \ $TERMUX_PREFIX/bin/editor editor $TERMUX_PREFIX/bin/emacs 40 fi fi EOF cat <<- EOF > ./prerm #!$TERMUX_PREFIX/bin/sh if [ "\$1" != "upgrade" ]; then if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then update-alternatives --remove editor $TERMUX_PREFIX/bin/emacs fi fi EOF } ================================================ FILE: packages/emacs/lib-src-emacsclient.c.patch ================================================ --- ../emacsclient.c.orig 2019-08-29 20:08:48.840624090 +0200 +++ ./lib-src/emacsclient.c 2019-08-29 20:13:37.425382182 +0200 @@ -1289,11 +1289,12 @@ } else #endif - tmpdir = "/tmp"; + tmpdir = "@TERMUX_PREFIX@/tmp"; } + /* Use $PREFIX/var/run instead of $TMPDIR in termux. */ socket_name_storage = - xmalloc (strlen (tmpdir) + strlen (server_name) + EXTRA_SPACE); - char *z = stpcpy (socket_name_storage, tmpdir); + xmalloc (strlen ("@TERMUX_PREFIX@/var/run") + strlen (server_name) + EXTRA_SPACE); + char *z = stpcpy (socket_name_storage, "@TERMUX_PREFIX@/var/run"); z += sprintf (z, "/emacs%ld/", uid); strcpy (z, server_name); local_socket_name = socket_name_storage; ================================================ FILE: packages/emacs/lisp-cus-start.el.patch.beforehostbuild ================================================ diff -u -r ../emacs-25.0.92/lisp/cus-start.el ./lisp/cus-start.el --- ../emacs-25.0.92/lisp/cus-start.el 2016-03-02 05:21:42.000000000 -0500 +++ ./lisp/cus-start.el 2016-04-06 18:16:00.007272810 -0400 @@ -277,7 +277,7 @@ "/tmp")) (t (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") - "/tmp")))) + "@TERMUX_PREFIX@/tmp")))) :initialize custom-initialize-delay) ;; fns.c (use-dialog-box menu boolean "21.1") ================================================ FILE: packages/emacs/lisp-loadup.el-2.patch.beforehostbuild ================================================ diff -u -r ../emacs-25.0.92/lisp/loadup.el ./lisp/loadup.el --- ../emacs-25.0.92/lisp/loadup.el 2016-09-06 09:49:51.838175278 +0300 +++ ./lisp/loadup.el 2016-09-06 09:57:18.694585441 +0300 @@ -378,7 +378,11 @@ (message "Warning: Change in load-path due to site-init will be \ lost after dumping"))) -(setq current-load-list nil) +;; On an emacs that runs undumped, i.e. Android, this causes bogus +;; entries to appear in load-history. Commenting this out causes an entry +;; for loadup.el with a bogus filename to appear instead, but since it +;; neither provides nor requires anything, it appears to be safe. +;;(setq current-load-list nil) ;; Avoid storing references to build directory in the binary. (setq custom-current-group-alist nil) ================================================ FILE: packages/emacs/lisp-net-tramp.el.patch.beforehostbuild ================================================ diff -u -r ../emacs-26.1/lisp/net/tramp.el ./lisp/net/tramp.el --- ../emacs-26.1/lisp/net/tramp.el 2018-04-23 14:17:48.000000000 +0000 +++ ./lisp/net/tramp.el 2018-05-29 09:26:34.017326913 +0000 @@ -127,7 +127,7 @@ :require 'tramp) (defcustom tramp-encoding-shell - (or (tramp-compat-funcall 'w32-shell-name) "/bin/sh") + (or (tramp-compat-funcall 'w32-shell-name) "@TERMUX_PREFIX@/bin/sh") "Use this program for encoding and decoding commands on the local host. This shell is used to execute the encoding and decoding command on the local host, so if you want to use `~' in those commands, you should ================================================ FILE: packages/emacs/lisp-server.el.patch.beforehostbuild ================================================ diff -u -r ../emacs-25.0.92/lisp/server.el ./lisp/server.el --- ../emacs-25.0.92/lisp/server.el 2016-03-02 05:21:42.000000000 -0500 +++ ./lisp/server.el 2016-04-06 17:34:48.134354070 -0400 @@ -267,7 +267,7 @@ ;; does not read the init file. (defvar server-socket-dir (and (featurep 'make-network-process '(:family local)) - (format "%s/emacs%d" (or (getenv "TMPDIR") "/tmp") (user-uid))) + (format "%s/emacs%d" "@TERMUX_PREFIX@/var/run" (user-uid))) "The directory in which to place the server socket. If local sockets are not supported, this is nil.") ================================================ FILE: packages/emacs/lisp-subr.el.patch.beforehostbuild ================================================ diff -u -r ../emacs-25.0.92/lisp/subr.el ./lisp/subr.el --- ../emacs-25.0.92/lisp/subr.el 2016-03-02 05:21:42.000000000 -0500 +++ ./lisp/subr.el 2016-03-25 22:03:57.240066240 -0400 @@ -2975,7 +2975,7 @@ (declare (advertised-calling-convention (name buffer command) "23.1")) (start-file-process name buffer - (if (file-remote-p default-directory) "/bin/sh" shell-file-name) + (if (file-remote-p default-directory) "@TERMUX_PREFIX@/bin/sh" shell-file-name) (if (file-remote-p default-directory) "-c" shell-command-switch) (mapconcat 'identity args " "))) @@ -3019,7 +3019,7 @@ (declare (advertised-calling-convention (command &optional infile buffer display) "24.5")) (process-file - (if (file-remote-p default-directory) "/bin/sh" shell-file-name) + (if (file-remote-p default-directory) "@TERMUX_PREFIX@/bin/sh" shell-file-name) infile buffer display (if (file-remote-p default-directory) "-c" shell-command-switch) (mapconcat 'identity (cons command args) " "))) ================================================ FILE: packages/emacs/lisp-term.el.patch.beforehostbuild ================================================ diff -u -r ../emacs-26.1/lisp/term.el ./lisp/term.el --- ../emacs-26.1/lisp/term.el 2018-05-25 08:53:30.000000000 +0000 +++ ./lisp/term.el 2018-05-29 09:28:08.472262228 +0000 @@ -1552,7 +1552,7 @@ ;; do the decoding by hand on the parts that are made of chars. (coding-system-for-read 'binary)) (apply 'start-process name buffer - "/bin/sh" "-c" + "@TERMUX_PREFIX@/bin/sh" "-c" (format "stty -nl echo rows %d columns %d sane 2>/dev/null;\ if [ $1 = .. ]; then shift; fi; exec \"$@\"" term-height term-width) ================================================ FILE: packages/emacs/lisp-textmodes-ispell.el.patch.beforehostbuild ================================================ diff -u -r ../emacs-26.2/lisp/textmodes/ispell.el ./lisp/textmodes/ispell.el --- ../emacs-26.2/lisp/textmodes/ispell.el 2019-02-20 13:44:42.000000000 +0000 +++ ./lisp/textmodes/ispell.el 2019-04-14 18:15:07.894909566 +0000 @@ -215,14 +215,14 @@ :group 'ispell) (defcustom ispell-alternate-dictionary - (cond ((file-readable-p "/usr/dict/web2") "/usr/dict/web2") - ((file-readable-p "/usr/share/dict/web2") "/usr/share/dict/web2") - ((file-readable-p "/usr/dict/words") "/usr/dict/words") - ((file-readable-p "/usr/lib/dict/words") "/usr/lib/dict/words") - ((file-readable-p "/usr/share/dict/words") "/usr/share/dict/words") - ((file-readable-p "/usr/share/lib/dict/words") - "/usr/share/lib/dict/words") - ((file-readable-p "/sys/dict") "/sys/dict")) + (cond ((file-readable-p "@TERMUX_PREFIX@/dict/web2") "/usr/dict/web2") + ((file-readable-p "@TERMUX_PREFIX@/share/dict/web2") "/usr/share/dict/web2") + ((file-readable-p "@TERMUX_PREFIX@/dict/words") "/usr/dict/words") + ((file-readable-p "@TERMUX_PREFIX@/lib/dict/words") "/usr/lib/dict/words") + ((file-readable-p "@TERMUX_PREFIX@/share/dict/words") "/usr/share/dict/words") + ((file-readable-p "@TERMUX_PREFIX@/share/lib/dict/words") + "@TERMUX_PREFIX@/share/lib/dict/words") + ((file-readable-p "@TERMUX_PREFIX@/sys/dict") "@TERMUX_PREFIX@/sys/dict")) "Alternate plain word-list dictionary for spelling help." :type '(choice file (const :tag "None" nil)) :group 'ispell) @@ -266,9 +266,7 @@ :group 'ispell) (defcustom ispell-look-command - (cond ((file-exists-p "/bin/look") "/bin/look") - ((file-exists-p "/usr/local/bin/look") "/usr/local/bin/look") - ((file-exists-p "/usr/bin/look") "/usr/bin/look") + (cond ((file-exists-p "@TERMUX_PREFIX@/bin/look") "@TERMUX_PREFIX@/bin/look") (t "look")) "Name of the look command for search processes. This must be an absolute file name." ================================================ FILE: packages/emacs/no_user_fullname.patch ================================================ diff -u -r ../emacs-24.3/src/editfns.c ./src/editfns.c --- ../emacs-24.3/src/editfns.c 2013-01-01 21:37:17.000000000 +0100 +++ ./src/editfns.c 2014-02-19 03:21:55.000000000 +0100 @@ -1304,7 +1304,7 @@ if (!pw) return Qnil; - p = USER_FULL_NAME; + p = "unknown"; /* Chop off everything after the first comma. */ q = strchr (p, ','); full = make_string (p, q ? q - p : strlen (p)); ================================================ FILE: packages/emacs/site-init.el ================================================ ; Enable terminal mouse events: (xterm-mouse-mode 1) (global-set-key [mouse-4] 'scroll-down-line) (global-set-key [mouse-5] 'scroll-up-line) ================================================ FILE: packages/emacs/src-callproc.c.patch ================================================ diff -u -r ../emacs-25.0.92/src/callproc.c ./src/callproc.c --- ../emacs-25.0.92/src/callproc.c 2016-03-02 05:21:43.000000000 -0500 +++ ./src/callproc.c 2016-03-25 22:02:38.977310920 -0400 @@ -1619,7 +1619,7 @@ dir_warning ("arch-independent data dir", Vdata_directory); sh = getenv ("SHELL"); - Vshell_file_name = build_string (sh ? sh : "/bin/sh"); + Vshell_file_name = build_string (sh ? sh : "@TERMUX_PREFIX@/bin/sh"); #ifdef DOS_NT Vshared_game_score_directory = Qnil; ================================================ FILE: packages/emacs/src-filelock.c.patch ================================================ diff -u -r ../emacs-25.2/src/filelock.c ./src/filelock.c --- ../emacs-25.2/src/filelock.c 2017-02-03 11:25:45.000000000 +0100 +++ ./src/filelock.c 2017-06-30 23:36:35.331596590 +0200 @@ -126,14 +126,14 @@ static time_t boot_time; static bool boot_time_initialized; -#ifdef BOOT_TIME +#if defined(BOOT_TIME) && !defined(__ANDROID__) static void get_boot_time_1 (const char *, bool); #endif static time_t get_boot_time (void) { -#if defined (BOOT_TIME) +#if defined (BOOT_TIME) && !defined(__ANDROID__) int counter; #endif @@ -169,7 +169,7 @@ } } -#if defined (BOOT_TIME) +#if defined (BOOT_TIME) && !defined(__ANDROID__) #ifndef CANNOT_DUMP /* The utmp routines maintain static state. Don't touch that state unless we are initialized, @@ -237,7 +237,7 @@ #endif } -#ifdef BOOT_TIME +#if defined(BOOT_TIME) && !defined(__ANDROID__) /* Try to get the boot time from wtmp file FILENAME. This succeeds if that file contains a reboot record. ================================================ FILE: packages/emacs/src-keyboard.c.patch ================================================ https://github.com/emacs-mirror/emacs/commit/18b235941109ab9e7a405cbe950886c97e897e11 diff --git a/src/keyboard.c b/src/keyboard.c index 57757cf2112..f32b1560133 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -8916,7 +8916,6 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, ptrdiff_t keys_start; Lisp_Object current_binding = Qnil; - Lisp_Object first_event = Qnil; /* Index of the first key that has no binding. It is useless to try fkey.start larger than that. */ @@ -9026,6 +9025,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, starting_buffer = current_buffer; first_unbound = bufsize + 1; + Lisp_Object first_event = mock_input > 0 ? keybuf[0] : Qnil; /* Build our list of keymaps. If we recognize a function key and replace its escape sequence in ================================================ FILE: packages/erlang/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.erlang.org/ TERMUX_PKG_DESCRIPTION="General-purpose concurrent functional programming language" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_VERSION=22.0.7 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/erlang/otp/archive/OTP-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=04c090b55ec4a01778e7e1a5b7fdf54012548ca72737965b7aa8c4d7878c92bc TERMUX_PKG_DEPENDS="openssl, ncurses, zlib" TERMUX_PKG_NO_STATICSPLIT=true TERMUX_PKG_HOSTBUILD=true TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--without-javac --with-ssl=${TERMUX_PREFIX} --with-termcap" TERMUX_PKG_EXTRA_MAKE_ARGS="noboot" termux_step_post_extract_package() { # We need a host build every time: rm -Rf "$TERMUX_PKG_HOSTBUILD_DIR" ./otp_build autoconf } termux_step_host_build() { cd $TERMUX_PKG_SRCDIR ./configure --enable-bootstrap-only make -j "$TERMUX_MAKE_PROCESSES" } termux_step_pre_configure() { (cd erts && autoreconf) # liblog is needed for syslog usage: LDFLAGS+=" -llog" # Put binaries built in termux_step_host_build at start of PATH: cp bin/*/* $TERMUX_PKG_SRCDIR/bootstrap/bin export PATH="$TERMUX_PKG_SRCDIR/bootstrap/bin:$PATH" } ================================================ FILE: packages/erlang/erts-emulator-Makefile.in.patch ================================================ Based on the below change, updated for erlang 21: From 85a3e5b4f65e5284e59dcdd90e92ea7d50ef6907 Mon Sep 17 00:00:00 2001 From: Romain Naour Date: Sun, 8 Feb 2015 17:23:13 +0100 Subject: [PATCH] erts/emulator: reorder inclued headers paths If the Perl Compatible Regular Expressions is installed on the host and the path to the headers is added to the CFLAGS, the pcre.h from the host is used instead of the one provided by erlang. Erlang use an old version of this file which is incompatible with the upstream one. Move INCLUDES before CFLAGS to use pcre.h from erlang. http://autobuild.buildroot.net/results/cbd/cbd8b54eef535f19d7d400fd269af1b3571d6143/build-end.log Signed-off-by: Romain Naour --- erts/emulator/Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -u -r ../otp-OTP-21.0.1/erts/emulator/Makefile.in ./erts/emulator/Makefile.in --- ../otp-OTP-21.0.1/erts/emulator/Makefile.in 2018-06-25 13:19:47.000000000 +0200 +++ ./erts/emulator/Makefile.in 2018-07-01 18:06:51.931989663 +0200 @@ -712,7 +712,7 @@ # Usually the same as the default rule, but certain platforms (e.g. win32) mix # different compilers $(OBJDIR)/beam_emu.o: beam/beam_emu.c - $(V_EMU_CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@ + $(V_EMU_CC) $(INCLUDES) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) -c $< -o $@ $(OBJDIR)/beam_emu.S: beam/beam_emu.c $(V_EMU_CC) -S -fverbose-asm $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@ @@ -765,7 +765,7 @@ # General targets # $(OBJDIR)/%.o: beam/%.c - $(V_CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@ + $(V_CC) $(INCLUDES) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) -c $< -o $@ $(OBJDIR)/%.o: $(TARGET)/%.c $(V_CC) $(CFLAGS) $(INCLUDES) -Idrivers/common -c $< -o $@ ================================================ FILE: packages/erlang/prefix.patch ================================================ diff --git a/lib/kernel/src/os.erl b/lib/kernel/src/os.erl index 29a26674ba..e6ab453a70 100644 --- a/lib/kernel/src/os.erl +++ b/lib/kernel/src/os.erl @@ -294,7 +294,7 @@ mk_cmd({win32,Wtype}, Cmd) -> mk_cmd(_,Cmd) -> %% Have to send command in like this in order to make sh commands like %% cd and ulimit available - {"/bin/sh -s unix:cmd", [out], + {"@TERMUX_PREFIX@/bin/sh -s unix:cmd", [out], %% We insert a new line after the command, in case the command %% contains a comment character. %% ================================================ FILE: packages/espeak/Makefile.patch ================================================ diff -u -r ../espeak-ng-1.49.1/Makefile.am ./Makefile.am --- ../espeak-ng-1.49.1/Makefile.am 2017-01-21 21:57:13.000000000 +0100 +++ ./Makefile.am 2017-02-01 00:30:07.810286033 +0100 @@ -121,7 +121,7 @@ lib_LTLIBRARIES += src/libespeak-ng.la -src_libespeak_ng_la_LDFLAGS = -version-info $(SHARED_VERSION) -lpthread -lm \ +src_libespeak_ng_la_LDFLAGS = -version-info $(SHARED_VERSION) -lm \ ${PCAUDIOLIB_LIBS} src_libespeak_ng_la_CFLAGS = -Isrc/include -Isrc/include/compat \ diff -u -r ../espeak-ng-1.49.1/Makefile.in ./Makefile.in --- ../espeak-ng-1.49.1/Makefile.in 2017-01-21 21:57:17.000000000 +0100 +++ ./Makefile.in 2017-02-01 00:30:24.202085646 +0100 @@ -472,7 +472,7 @@ src/include/espeak-ng/espeak_ng.h \ src/include/espeak-ng/speak_lib.h -src_libespeak_ng_la_LDFLAGS = -version-info $(SHARED_VERSION) -lpthread -lm \ +src_libespeak_ng_la_LDFLAGS = -version-info $(SHARED_VERSION) -lm \ ${PCAUDIOLIB_LIBS} src_libespeak_ng_la_CFLAGS = -Isrc/include -Isrc/include/compat -fPIC \ ================================================ FILE: packages/espeak/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/espeak-ng/espeak-ng TERMUX_PKG_DESCRIPTION="Compact software speech synthesizer" TERMUX_PKG_LICENSE="GPL-2.0" # Use eSpeak NG as the original eSpeak project is dead. # See https://github.com/espeak-ng/espeak-ng/issues/180 # about cross compilation of espeak-ng. TERMUX_PKG_VERSION=1.50 TERMUX_PKG_SRCURL=https://github.com/espeak-ng/espeak-ng/releases/download/$TERMUX_PKG_VERSION/espeak-ng-$TERMUX_PKG_VERSION.tgz TERMUX_PKG_SHA256=80ee6cd06fcd61888951ab49362b400e80dd1fac352a8b1131d90cfe8a210edb TERMUX_PKG_BREAKS="espeak-dev" TERMUX_PKG_REPLACES="espeak-dev" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_HOSTBUILD=true TERMUX_PKG_RM_AFTER_INSTALL="lib/*ng-test*" # --without-async due to that using pthread_cancel(). TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--without-async" termux_step_post_extract_package() { # Certain packages are not safe to build on device because their # build.sh script deletes specific files in $TERMUX_PREFIX. if $TERMUX_ON_DEVICE_BUILD; then termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds." fi ./autogen.sh } termux_step_host_build() { cp -Rf $TERMUX_PKG_SRCDIR/* . unset MAKEFLAGS ./configure --prefix=$TERMUX_PREFIX make -j$TERMUX_MAKE_PROCESSES src/{e,}speak-ng # Man pages require the ronn ruby program. #make src/espeak-ng.1 #cp src/espeak-ng.1 $TERMUX_PREFIX/share/man/man1 #(cd $TERMUX_PREFIX/share/man/man1 && ln -s -f espeak-ng.1 espeak.1) make install } termux_step_pre_configure() { # Oz flag causes problems. See https://github.com/termux/termux-packages/issues/1680: CFLAGS=${CFLAGS/Oz/Os} } termux_step_make() { # Prevent caching of host build: rm -Rf $TERMUX_PKG_HOSTBUILD_DIR make -j$TERMUX_MAKE_PROCESSES src/{e,}speak-ng } termux_step_make_install() { rm $TERMUX_PREFIX/bin/{e,}speak{,-ng} cp src/.libs/espeak-ng $TERMUX_PREFIX/bin/espeak cp src/.libs/libespeak-ng.so $TERMUX_PREFIX/lib/libespeak-ng.so.1.1.49 } ================================================ FILE: packages/espeak/compat-stdint.h.patch ================================================ diff -u -r ../espeak-ng-1.49.1/src/include/compat/stdint.h ./src/include/compat/stdint.h --- ../espeak-ng-1.49.1/src/include/compat/stdint.h 2017-01-21 21:57:13.000000000 +0100 +++ ./src/include/compat/stdint.h 2017-02-01 00:28:46.687277703 +0100 @@ -19,6 +19,8 @@ #ifndef STDINT_H_COMPAT_SHIM #define STDINT_H_COMPAT_SHIM +#include "config.h" + #ifdef _MSC_VER #if _MSC_VER >= 1600 // Visual C++ 10 (Visual Studio 2010) and above... ================================================ FILE: packages/exa/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://the.exa.website TERMUX_PKG_DESCRIPTION="A modern replacement for ls" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=0.9.0 TERMUX_PKG_SRCURL=https://github.com/ogham/exa/archive/058b4a57bdb1e25cbdacc0fbd1eefc09bc5f1e95.zip TERMUX_PKG_SHA256=9931ad1c593096e69a1f0f7615e3857b1d422b7e74f63408385c663aeb2c12db TERMUX_PKG_DEPENDS="zlib" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--no-default-features --features default" TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { rm $TERMUX_PKG_SRCDIR/Makefile termux_setup_rust CFLAGS="$CFLAGS $CPPFLAGS" cargo update } termux_step_post_make_install() { mkdir -p $TERMUX_PREFIX/share/man/man1 cp $TERMUX_PKG_SRCDIR/contrib/man/exa.1 $TERMUX_PREFIX/share/man/man1/ } ================================================ FILE: packages/exa/src-output-table.rs.patch ================================================ diff -u -r ../exa-57e4c08411f59e7db91fa7d8127fbd412667ea32/src/output/table.rs ./src/output/table.rs --- ../exa-57e4c08411f59e7db91fa7d8127fbd412667ea32/src/output/table.rs 2018-10-14 15:21:13.000000000 +0000 +++ ./src/output/table.rs 2018-10-18 03:48:04.171402732 +0000 @@ -246,6 +246,9 @@ } pub fn load_all() -> Self { + #[cfg(target_os = "android")] + let tz = None; + #[cfg(not(target_os = "android"))] let tz = match determine_time_zone() { Ok(t) => Some(t), Err(ref e) => { ================================================ FILE: packages/exiftool/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.sno.phy.queensu.ca/~phil/exiftool/index.html TERMUX_PKG_DESCRIPTION="Utility for reading, writing and editing meta information in a wide variety of files." TERMUX_PKG_LICENSE="Artistic-License-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=11.78 TERMUX_PKG_SRCURL="https://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-$TERMUX_PKG_VERSION.tar.gz" TERMUX_PKG_SHA256=3c59931c617f892f8a18e8b57a3ce2eea49dbcce0cdc6d0a2713f1e8dff743a9 TERMUX_PKG_DEPENDS="perl" termux_step_make_install() { # Change this after package 'perl' was upgraded. local current_perl_version=5.30.0 install -Dm700 "$TERMUX_PKG_SRCDIR"/exiftool "$TERMUX_PREFIX"/bin/exiftool find "$TERMUX_PKG_SRCDIR"/lib -name "*.pod" -delete mkdir -p "$TERMUX_PREFIX/lib/perl5/site_perl/${current_perl_version}" rm -rf "$TERMUX_PREFIX/lib/perl5/site_perl/${current_perl_version}"/{Image,File} cp -a "$TERMUX_PKG_SRCDIR"/lib/{Image,File} "$TERMUX_PREFIX/lib/perl5/site_perl/${current_perl_version}/" } ================================================ FILE: packages/exiv2/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://exiv2.org/ TERMUX_PKG_DESCRIPTION="Exif, Iptc and XMP metadata manipulation library and tools" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.27.2 TERMUX_PKG_SRCURL=https://github.com/Exiv2/exiv2/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=3dbcaf01fbc5b98d42f091d1ff0d4b6cd9750dc724de3d9c0d113948570b2934 TERMUX_PKG_DEPENDS="libandroid-support, libc++, libexpat, zlib" TERMUX_PKG_BREAKS="exiv2-dev" TERMUX_PKG_REPLACES="exiv2-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DEXIV2_ENABLE_VIDEO=ON -DEXIV2_ENABLE_BUILD_SAMPLES=OFF" ================================================ FILE: packages/exiv2/exiv2json.cpp.patch ================================================ --- ../exiv2json.cpp.orig 2019-05-31 21:32:41.319959442 +0200 +++ ./samples/exiv2json.cpp 2019-05-31 21:33:11.399959231 +0200 @@ -236,7 +236,7 @@ { Jzon::Object& fs = (Jzon::Object&) nfs; fs.Add("path",path); - char resolved_path[2000]; // PATH_MAX]; + char resolved_path[PATH_MAX]; fs.Add("realpath",realpath(path,resolved_path)); struct stat buf; ================================================ FILE: packages/expect/Makefile.in.patch ================================================ diff -u -r ../expect5.45.3/Makefile.in ./Makefile.in --- ../expect5.45.3/Makefile.in 2010-09-30 19:14:07.000000000 +0200 +++ ./Makefile.in 2017-11-22 13:59:45.609495604 +0100 @@ -32,16 +32,14 @@ # SCRIPTS is a target. If this is a problem, just comment out the # SCRIPTS target itself. -SCRIPTS = timed-run timed-read ftp-rfc autopasswd lpunlock weather \ - passmass rftp kibitz rlogin-cwd xpstat tkpasswd dislocate xkibitz \ - tknewsbiff unbuffer mkpasswd cryptdir decryptdir autoexpect \ - multixterm +SCRIPTS = timed-run timed-read \ + unbuffer autoexpect # A couple of the scripts have man pages of their own. # You can delete these too if you don't want'em. -SCRIPTS_MANPAGES = kibitz dislocate xkibitz tknewsbiff unbuffer mkpasswd \ - passmass cryptdir decryptdir autoexpect multixterm +SCRIPTS_MANPAGES = unbuffer \ + autoexpect # allow us to handle null list gracefully, "end_of_list" should not exist @@ -380,7 +378,7 @@ cp $(DIST_ROOT)/$(PKG_DIR).tar.gz $(top_builddir) $(SCRIPTS): - $(TCLSH) $(srcdir)/fixline1 $(SHORT_BINDIR) < $(srcdir)/example/$@ > $@ + cp $(srcdir)/example/$@ $@ ## We cannot use TCL_LIBS below (after TCL_LIB_SPEC) because its ## expansion references the contents of LIBS, which contains linker ================================================ FILE: packages/expect/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://core.tcl.tk/expect/index TERMUX_PKG_DESCRIPTION="Tool for automating interactive terminal applications" TERMUX_PKG_LICENSE="Public Domain" TERMUX_PKG_VERSION=5.45.4 TERMUX_PKG_REVISION=3 TERMUX_PKG_SHA256=49a7da83b0bdd9f46d04a04deec19c7767bb9a323e40c4781f89caf760b92c34 TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/expect/Expect/${TERMUX_PKG_VERSION}/expect${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="tcl" TERMUX_PKG_BREAKS="expect-dev" TERMUX_PKG_REPLACES="expect-dev" termux_step_pre_configure() { autoconf } termux_step_post_make_install() { cd $TERMUX_PREFIX/lib ln -f -s expect${TERMUX_PKG_VERSION}/libexpect${TERMUX_PKG_VERSION}.so . } ================================================ FILE: packages/expect/configure.in.patch ================================================ diff -u -r ../expect5.45/configure.in ./configure.in --- ../expect5.45/configure.in 2010-08-27 17:51:53.000000000 -0400 +++ ./configure.in 2016-04-18 00:23:36.618635535 -0400 @@ -347,11 +347,7 @@ fi AC_MSG_CHECKING([stty to use]) -if test -r /usr/local/bin/stty ; then - STTY_BIN=/usr/local/bin/stty -else - STTY_BIN=/bin/stty -fi +STTY_BIN=@TERMUX_PREFIX@/bin/stty AC_MSG_RESULT($STTY_BIN) AC_MSG_CHECKING([if stty reads stdout]) @@ -481,7 +477,7 @@ , AC_MSG_RESULT(no) , - AC_MSG_ERROR([Expect can't be cross compiled]) + AC_MSG_RESULT(no) ) AC_MSG_CHECKING([if any value exists for WNOHANG]) @@ -506,7 +502,8 @@ AC_MSG_RESULT(no) AC_DEFINE(WNOHANG_BACKUP_VALUE, 1) , - AC_MSG_ERROR([Expect can't be cross compiled]) + AC_MSG_RESULT(yes) + AC_DEFINE_UNQUOTED(WNOHANG_BACKUP_VALUE, 1) ) # @@ -574,7 +571,8 @@ AC_DEFINE(REARM_SIG) , AC_MSG_RESULT(no) -, AC_MSG_WARN([Expect can't be cross compiled]) +, + AC_MSG_RESULT(no) ) # HPUX7 has trouble with the big cat so split it @@ -725,7 +723,7 @@ , AC_MSG_RESULT(no) , - AC_MSG_ERROR([Expect can't be cross compiled]) + AC_MSG_RESULT(no) ) # mach systems have include files for unimplemented features @@ -749,7 +747,7 @@ , AC_MSG_RESULT(no) , - AC_MSG_ERROR([Expect can't be cross compiled]) + AC_MSG_RESULT(no) ) # now check for the new style ttys (not yet posix) @@ -771,7 +769,9 @@ , AC_MSG_RESULT(no) , - AC_MSG_ERROR([Expect can't be cross compiled]) + AC_DEFINE(HAVE_TERMIOS) + PTY_TYPE=termios + AC_MSG_RESULT(yes) ) fi @@ -794,7 +794,8 @@ , AC_MSG_RESULT(no) , - AC_MSG_ERROR([Expect can't be cross compiled]) + AC_DEFINE(HAVE_TCGETS_OR_TCGETA_IN_TERMIOS_H) + AC_MSG_RESULT(yes) ) AC_MSG_CHECKING([if TIOCGWINSZ in termios.h]) @@ -816,7 +817,8 @@ , AC_MSG_RESULT(no) , - AC_MSG_ERROR([Expect can't be cross compiled]) + AC_DEFINE(HAVE_TIOCGWINSZ_IN_TERMIOS_H) + AC_MSG_RESULT(yes) ) # finally check for Cray style ttys @@ -837,7 +839,7 @@ , AC_MSG_RESULT(no) , - AC_MSG_ERROR([Expect can't be cross compiled]) + AC_MSG_RESULT(no) ) # @@ -869,7 +871,9 @@ AC_HAVE_FUNCS(getpty) # following test sets SETPGRP_VOID if setpgrp takes 0 args, else takes 2 -AC_FUNC_SETPGRP +cat >>confdefs.h <<\_ACEOF +#define SETPGRP_VOID 1 +_ACEOF # # check for timezones @@ -889,7 +893,7 @@ AC_MSG_RESULT(yes), AC_MSG_RESULT(no) , - AC_MSG_ERROR([Expect can't be cross compiled]) + AC_MSG_RESULT(no) ) ================================================ FILE: packages/fakeroot/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://packages.debian.org/fakeroot TERMUX_PKG_DESCRIPTION="Tool for simulating superuser privileges (with tcp ipc)" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.24 TERMUX_PKG_REVISION=3 TERMUX_PKG_SRCURL=https://deb.debian.org/debian/pool/main/f/fakeroot/fakeroot_${TERMUX_PKG_VERSION}.orig.tar.gz TERMUX_PKG_SHA256=2e045b3160370b8ab4d44d1f8d267e5d1d555f1bb522d650e7167b09477266ed TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-ipc=tcp" TERMUX_PKG_BUILD_DEPENDS="libcap" termux_step_post_make_install() { ln -sfr "${TERMUX_PREFIX}/lib/libfakeroot-0.so" "${TERMUX_PREFIX}/lib/libfakeroot.so" } termux_step_create_debscripts() { { echo "#!$TERMUX_PREFIX/bin/sh" echo "echo" echo "echo Fakeroot does not give you any real root permissions. Utility is primarily intended to be used for development purposes." echo "echo More info about usage at https://wiki.debian.org/FakeRoot." echo "echo" echo "echo Programs requiring real root permissions will not run under fakeroot. Do not post bug reports about this." echo "echo" } > ./postinst } ================================================ FILE: packages/fakeroot/fakeroot-1.23_faked.c.patch ================================================ diff -uNr fakeroot-1.23/faked.c fakeroot-1.23.mod/faked.c --- fakeroot-1.23/faked.c 2018-07-01 22:01:34.000000000 +0300 +++ fakeroot-1.23.mod/faked.c 2018-10-01 17:31:45.172555748 +0300 @@ -1487,7 +1487,7 @@ /* literally copied from the linux klogd code, go to background */ if ((pid=fork()) == 0){ int fl; - int num_fds = getdtablesize(); + int num_fds = sysconf(_SC_OPEN_MAX); fflush(stdout); ================================================ FILE: packages/fakeroot/fakeroot-1.23_libfakeroot.c.patch ================================================ diff -uNr fakeroot-1.23/libfakeroot.c fakeroot-1.23.mod/libfakeroot.c --- fakeroot-1.23/libfakeroot.c 2018-07-01 22:01:34.000000000 +0300 +++ fakeroot-1.23.mod/libfakeroot.c 2018-10-01 17:31:45.175889099 +0300 @@ -81,12 +81,14 @@ #define SEND_STAT64(a,b,c) send_stat64(a,b,c) #define SEND_GET_STAT(a,b) send_get_stat(a,b) #define SEND_GET_STAT64(a,b) send_get_stat64(a,b) +#define SEND_GET_XATTR(a,b,c) send_get_xattr(a,b,c) #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b,c) #else #define SEND_STAT(a,b,c) send_stat(a,b) #define SEND_STAT64(a,b,c) send_stat64(a,b) #define SEND_GET_STAT(a,b) send_get_stat(a) #define SEND_GET_STAT64(a,b) send_get_stat64(a) +#define SEND_GET_XATTR(a,b,c) send_get_xattr(a,b) #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b) #endif ================================================ FILE: packages/fakeroot/fakeroot-1.23_scripts_fakeroot.in.patch ================================================ diff -uNr fakeroot-1.23/scripts/fakeroot.in fakeroot-1.23.mod/scripts/fakeroot.in --- fakeroot-1.23/scripts/fakeroot.in 2018-07-01 22:01:34.000000000 +0300 +++ fakeroot-1.23.mod/scripts/fakeroot.in 2018-10-01 17:32:47.566222406 +0300 @@ -145,8 +145,8 @@ if [ "$WAITINTRAP" -eq 0 ]; then trap "kill -s @signal@ $PID" EXIT INT else - @MACOSX_FALSE@trap 'FAKEROOTKEY=$FAKEROOTKEY @LDLIBPATHVAR@="$PATHS" @LDPRELOADVAR@="$LIB" /bin/ls -l / >/dev/null 2>&1; while kill -s @signal@ $PID 2>/dev/null; do sleep 0.1; done' EXIT INT - @MACOSX_TRUE@trap 'FAKEROOTKEY=$FAKEROOTKEY @LDPRELOADVAR@="$LIB" /bin/ls -l / >/dev/null 2>&1; while kill -s @signal@ $PID 2>/dev/null; do sleep 0.1; done' EXIT INT + @MACOSX_FALSE@trap 'FAKEROOTKEY=$FAKEROOTKEY @LDLIBPATHVAR@="$PATHS" @LDPRELOADVAR@="$LIB" ls -l / >/dev/null 2>&1; while kill -s @signal@ $PID 2>/dev/null; do sleep 0.1; done' EXIT INT + @MACOSX_TRUE@trap 'FAKEROOTKEY=$FAKEROOTKEY @LDPRELOADVAR@="$LIB" ls -l / >/dev/null 2>&1; while kill -s @signal@ $PID 2>/dev/null; do sleep 0.1; done' EXIT INT fi if test -z "$FAKEROOTKEY" || test -z "$PID"; then @@ -168,8 +168,8 @@ export FAKEROOT_FD_BASE if test -z "$*"; then - @MACOSX_FALSE@FAKEROOTKEY=$FAKEROOTKEY @LDLIBPATHVAR@="$PATHS" @LDEXTRAVAR@ @LDPRELOADVAR@="$LIB" ${SHELL:-/bin/sh} - @MACOSX_TRUE@FAKEROOTKEY=$FAKEROOTKEY @LDEXTRAVAR@ @LDPRELOADVAR@="$LIB" ${SHELL:-/bin/sh} + @MACOSX_FALSE@FAKEROOTKEY=$FAKEROOTKEY @LDLIBPATHVAR@="$PATHS" @LDEXTRAVAR@ @LDPRELOADVAR@="$LIB" ${SHELL:-@TERMUX_PREFIX@/bin/sh} + @MACOSX_TRUE@FAKEROOTKEY=$FAKEROOTKEY @LDEXTRAVAR@ @LDPRELOADVAR@="$LIB" ${SHELL:-@TERMUX_PREFIX@/bin/sh} RESULT=$? else @MACOSX_FALSE@FAKEROOTKEY=$FAKEROOTKEY @LDLIBPATHVAR@="$PATHS" @LDEXTRAVAR@ @LDPRELOADVAR@="$LIB" "$@" ================================================ FILE: packages/fasd/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/clvv/fasd TERMUX_PKG_DESCRIPTION="To fastly access files and folders" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.0.1 TERMUX_PKG_REVISION=4 TERMUX_PKG_SRCURL=https://github.com/clvv/fasd/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=88efdfbbed8df408699a14fa6c567450bf86480f5ff3dde42d0b3e1dee731f65 TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/fastmod/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/facebookincubator/fastmod TERMUX_PKG_DESCRIPTION="Regex-based code refactoring utility" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.3.0 TERMUX_PKG_SRCURL=https://github.com/facebookincubator/fastmod/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=95925c73d06f6bd9ea9a6ca66c847e9722fe7bff5c8c3ee9a3245a37f630dfc0 TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/fastmod/vi-as-default-editor.patch ================================================ diff -uNr fastmod-0.2.6/src/main.rs fastmod-0.2.6.mod/src/main.rs --- fastmod-0.2.6/src/main.rs 2019-07-25 02:38:07.000000000 +0300 +++ fastmod-0.2.6.mod/src/main.rs 2019-09-26 17:24:36.272089773 +0300 @@ -80,7 +80,7 @@ } fn run_editor(path: &Path, start_line: usize) -> Result<()> { - let editor = env::var("EDITOR").unwrap_or_else(|_| String::from("vim")); + let editor = env::var("EDITOR").unwrap_or_else(|_| String::from("vi")); let args: Vec<&str> = editor.split(' ').collect(); let mut editor_cmd = { let mut cmd = Command::new(args[0]) ================================================ FILE: packages/fbless/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://pybookreader.narod.ru/misc.html TERMUX_PKG_DESCRIPTION="Console FictionBook reader" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.2.3 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=http://deb.debian.org/debian/pool/main/f/fbless/fbless_${TERMUX_PKG_VERSION}.orig.tar.gz TERMUX_PKG_SHA256=68ae914d141da913ed6ff1805a1739346c33756b64a9407c14e95e278452c362 TERMUX_PKG_DEPENDS="ncurses, python2" TERMUX_PKG_BUILD_IN_SRC=true termux_step_make_install() { export PYTHONPATH="$TERMUX_PREFIX/lib/python2.7/site-packages/" python2.7 setup.py install --prefix="$TERMUX_PREFIX" --force } ================================================ FILE: packages/fcgi/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.fastcgi.com/ TERMUX_PKG_DESCRIPTION="A language independent, high performant extension to CGI" TERMUX_PKG_LICENSE="custom" TERMUX_PKG_LICENSE_FILE="LICENSE.TERMS" TERMUX_PKG_VERSION=2.4.2 TERMUX_PKG_SRCURL=https://github.com/FastCGI-Archives/fcgi2/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=1fe83501edfc3a7ec96bb1e69db3fd5ea1730135bd73ab152186fd0b437013bc TERMUX_PKG_BREAKS="fcgi-dev" TERMUX_PKG_REPLACES="fcgi-dev" termux_step_pre_configure() { libtoolize --automake --copy --force aclocal autoheader automake --add-missing --force-missing --copy autoconf export LIBS="-lm" } ================================================ FILE: packages/fcgiwrap/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://nginx.localdomain.pl/wiki/FcgiWrap TERMUX_PKG_DESCRIPTION="A simple server for running CGI applications over FastCGI" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=1.1.0 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/gnosek/fcgiwrap/archive/$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=4c7de0db2634c38297d5fcef61ab4a3e21856dd7247d49c33d9b19542bd1c61f TERMUX_PKG_DEPENDS="fcgi" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--mandir=/share/man" termux_step_pre_configure() { CFLAGS+=" -Wno-error=implicit-fallthrough" autoreconf -i } ================================================ FILE: packages/fcgiwrap/fix-kill-parameters.patch ================================================ From dc0c3b14f0d7bb014a9a4c6c17eb55a123496365 Mon Sep 17 00:00:00 2001 From: "D.pz" Date: Mon, 28 Aug 2017 23:54:08 +0800 Subject: [PATCH] 1.fix: kill() parameter sequence wrong --- fcgiwrap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fcgiwrap.c b/fcgiwrap.c index b44d8aa..bfd9a90 100644 --- a/fcgiwrap.c +++ b/fcgiwrap.c @@ -205,7 +205,7 @@ static void fcgi_finish(struct fcgi_context *fc, const char* msg) if (fc->fd_stderr >= 0) close(fc->fd_stderr); if (fc->cgi_pid) - kill(SIGTERM, fc->cgi_pid); + kill(fc->cgi_pid, SIGTERM); } static const char * fcgi_pass_fd(struct fcgi_context *fc, int *fdp, FCGI_FILE *ffp, char *buf, size_t bufsize) ================================================ FILE: packages/fd/Cargo.toml.patch ================================================ diff -u -r ../fd-7.4.0/Cargo.toml ./Cargo.toml --- ../fd-7.4.0/Cargo.toml 2019-09-15 17:29:15.000000000 +0000 +++ ./Cargo.toml 2019-09-17 19:37:35.384516258 +0000 @@ -52,9 +52,6 @@ [target.'cfg(all(unix, not(target_os = "redox")))'.dependencies] libc = "0.2" -[target.'cfg(all(not(windows), not(target_env = "musl")))'.dependencies] -jemallocator = "0.3.0" - [dev-dependencies] diff = "0.1" tempdir = "0.3" ================================================ FILE: packages/fd/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/sharkdp/fd TERMUX_PKG_DESCRIPTION="Simple, fast and user-friendly alternative to find" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_VERSION=7.4.0 TERMUX_PKG_SHA256=33570ba65e7f8b438746cb92bb9bc4a6030b482a0d50db37c830c4e315877537 TERMUX_PKG_SRCURL=https://github.com/sharkdp/fd/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_BUILD_IN_SRC=true termux_step_post_make_install() { mkdir -p $TERMUX_PREFIX/share/man/man1 cp $TERMUX_PKG_SRCDIR/doc/fd.1 $TERMUX_PREFIX/share/man/man1/fd.1 } ================================================ FILE: packages/fd/src-main.rs.patch ================================================ diff -u -r ../fd-7.4.0/src/main.rs ./src/main.rs --- ../fd-7.4.0/src/main.rs 2019-09-15 17:29:15.000000000 +0000 +++ ./src/main.rs 2019-09-17 19:37:47.620364849 +0000 @@ -35,11 +35,6 @@ pattern_has_uppercase_char, transform_args_with_exec, FileTypes, }; -// We use jemalloc for performance reasons, see https://github.com/sharkdp/fd/pull/481 -#[cfg(all(not(windows), not(target_env = "musl")))] -#[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; - fn main() { let checked_args = transform_args_with_exec(env::args_os()); let matches = app::build_app().get_matches_from(checked_args); ================================================ FILE: packages/fdupes/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/adrianlopezroche/fdupes TERMUX_PKG_DESCRIPTION="Duplicates file detector" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_VERSION=1.6.1 TERMUX_PKG_SRCURL=https://github.com/adrianlopezroche/fdupes/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=9d6b6fdb0b8419815b4df3bdfd0aebc135b8276c90bbbe78ebe6af0b88ba49ea TERMUX_PKG_BUILD_IN_SRC=true termux_step_configure() { sed -i "s,PREFIX = /usr/local,PREFIX = ${TERMUX_PREFIX}," "$TERMUX_PKG_SRCDIR/Makefile" } ================================================ FILE: packages/ffmpeg/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://ffmpeg.org TERMUX_PKG_DESCRIPTION="Tools and libraries to manipulate a wide range of multimedia formats and protocols" TERMUX_PKG_LICENSE="GPL-3.0" # NOTE: mpv has to be rebuilt and version bumped after updating ffmpeg. TERMUX_PKG_VERSION=4.2.1 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://www.ffmpeg.org/releases/ffmpeg-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=cec7c87e9b60d174509e263ac4011b522385fd0775292e1670ecc1180c9bb6d4 TERMUX_PKG_DEPENDS="libass, libbz2, libdav1d, libiconv, libsoxr, libx264, libx265, xvidcore, libvorbis, libmp3lame, libopus, libvpx, libgnutls, libandroid-glob, freetype, zlib, liblzma" TERMUX_PKG_CONFLICTS="libav" TERMUX_PKG_BREAKS="ffmpeg-dev" TERMUX_PKG_REPLACES="ffmpeg-dev" termux_step_configure() { cd $TERMUX_PKG_BUILDDIR export ASFLAGS="-no-integrated-as" local _EXTRA_CONFIGURE_FLAGS="" if [ $TERMUX_ARCH = "arm" ]; then _ARCH="armeabi-v7a" _EXTRA_CONFIGURE_FLAGS="--enable-neon" elif [ $TERMUX_ARCH = "i686" ]; then _ARCH="x86" # Specify --disable-asm to prevent text relocations on i686, # see https://trac.ffmpeg.org/ticket/4928 _EXTRA_CONFIGURE_FLAGS="--disable-asm" elif [ $TERMUX_ARCH = "x86_64" ]; then _ARCH="x86_64" elif [ $TERMUX_ARCH = "aarch64" ]; then _ARCH=$TERMUX_ARCH _EXTRA_CONFIGURE_FLAGS="--enable-neon" else termux_error_exit "Unsupported arch: $TERMUX_ARCH" fi $TERMUX_PKG_SRCDIR/configure \ --arch=${_ARCH} \ --as=$AS \ --cc=$CC \ --cxx=$CXX \ --cross-prefix=${TERMUX_HOST_PLATFORM}- \ --disable-indevs \ --disable-outdevs \ --enable-indev=lavfi \ --disable-static \ --disable-symver \ --enable-cross-compile \ --enable-gnutls \ --enable-gpl \ --enable-libass \ --enable-libdav1d \ --enable-libmp3lame \ --enable-libfreetype \ --enable-libvorbis \ --enable-libopus \ --enable-libx264 \ --enable-libx265 \ --enable-libxvid \ --enable-libvpx \ --enable-shared \ --enable-libsoxr \ --prefix=$TERMUX_PREFIX \ --target-os=android \ --extra-libs="-landroid-glob" \ $_EXTRA_CONFIGURE_FLAGS } ================================================ FILE: packages/ffmpeg/libavutil-file_open.c.patch ================================================ diff -uNr ffmpeg-4.1.1/libavutil/file_open.c ffmpeg-4.1.1.mod/libavutil/file_open.c --- ffmpeg-4.1.1/libavutil/file_open.c 2019-02-09 22:56:02.000000000 +0200 +++ ffmpeg-4.1.1.mod/libavutil/file_open.c 2019-03-02 01:54:58.775236751 +0200 @@ -119,7 +119,7 @@ #undef free free(ptr); #else - size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */ + size_t len = strlen(prefix) + strlen("@TERMUX_PREFIX@/tmp/") + 7; /* room for "@TERMUX_PREFIX@/tmp/" and "XXXXXX\0" */ *filename = av_malloc(len); #endif /* -----common section-----*/ @@ -136,7 +136,7 @@ # endif fd = open(*filename, O_RDWR | O_BINARY | O_CREAT | O_EXCL, 0600); #else - snprintf(*filename, len, "/tmp/%sXXXXXX", prefix); + snprintf(*filename, len, "@TERMUX_PREFIX@/tmp/%sXXXXXX", prefix); fd = mkstemp(*filename); #if defined(_WIN32) || defined (__ANDROID__) if (fd < 0) { ================================================ FILE: packages/ffsend/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://gitlab.com/timvisee/ffsend TERMUX_PKG_DESCRIPTION="A fully featured Firefox Send client" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=0.2.57 TERMUX_PKG_SRCURL=https://gitlab.com/timvisee/ffsend/-/archive/v$TERMUX_PKG_VERSION/ffsend-v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=2bae90e4801495b5f366c0696f61cc70aa6c7ce8e6a8aa1e22dfb456c384e9e3 TERMUX_PKG_DEPENDS="openssl" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--no-default-features --features send2,send3,history,archive,qrcode,urlshorten,infer-command" ================================================ FILE: packages/fftw/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.fftw.org/ TERMUX_PKG_DESCRIPTION="Library for computing the Discrete Fourier Transform (DFT) in one or more dimensions" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=3.3.8 TERMUX_PKG_REVISION=2 TERMUX_PKG_SHA256=6113262f6e92c5bd474f2875fa1b01054c4ad5040f6b0da7c03c98821d9ae303 TERMUX_PKG_BREAKS="fftw-dev" TERMUX_PKG_REPLACES="fftw-dev" TERMUX_PKG_SRCURL=http://www.fftw.org/fftw-${TERMUX_PKG_VERSION}.tar.gz # ac_cv_func_clock_gettime=no avoids having clock_gettime(CLOCK_SGI_CYCLE, &t) # being used. It's not supported on Android but fails at runtime and, fftw # does not check the return value so gets bogus values. TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-threads ac_cv_func_clock_gettime=no" TERMUX_PKG_RM_AFTER_INSTALL="include/fftw*.f*" termux_step_post_make_install() { local COMMON_ARGS="$TERMUX_PKG_EXTRA_CONFIGURE_ARGS" local feature for feature in float long-double; do make clean TERMUX_PKG_EXTRA_CONFIGURE_ARGS="$COMMON_ARGS --enable-$feature" rm -Rf $TERMUX_PKG_TMPDIR/config-scripts termux_step_configure make -j $TERMUX_MAKE_PROCESSES install done } ================================================ FILE: packages/fftw/fix-wisdom_dir.patch ================================================ diff -uNr fftw-3.3.6-pl1/api/import-system-wisdom.c fftw-3.3.6-pl1.mod/api/import-system-wisdom.c --- fftw-3.3.6-pl1/api/import-system-wisdom.c 2017-01-15 14:03:24.000000000 +0200 +++ fftw-3.3.6-pl1.mod/api/import-system-wisdom.c 2017-09-12 11:20:08.432992283 +0300 @@ -32,7 +32,7 @@ #if defined(__DJGPP__) # define WISDOM_DIR "/dev/env/DJDIR/etc/fftw/" #else -# define WISDOM_DIR "/etc/fftw/" +# define WISDOM_DIR "@TERMUX_PREFIX@/etc/fftw/" #endif int X(import_system_wisdom)(void) ================================================ FILE: packages/figlet/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.figlet.org/ TERMUX_PKG_DESCRIPTION="Program for making large letters out of ordinary text" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=2.2.5 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=ftp://ftp.figlet.org/pub/figlet/program/unix/figlet-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=bf88c40fd0f077dab2712f54f8d39ac952e4e9f2e1882f1195be9e5e4257417d TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { LD=$CC } ================================================ FILE: packages/figlet/figlet.c.patch ================================================ diff -u -r ../figlet-2.2.5/figlet.c ./figlet.c --- ../figlet-2.2.5/figlet.c 2012-06-01 14:51:09.000000000 +0200 +++ ./figlet.c 2014-08-02 09:58:04.931697896 +0200 @@ -69,6 +69,7 @@ #ifdef unix #include #include /* Needed for get_columns */ +#include /* Needed for struct winsize */ #endif #ifdef TLF_FONTS ================================================ FILE: packages/figlet/makefile.patch ================================================ diff -u -r ../figlet-2.2.5/Makefile ./Makefile --- ../figlet-2.2.5/Makefile 2012-06-01 14:51:09.000000000 +0200 +++ ./Makefile 2014-08-03 02:25:17.846078638 +0200 @@ -18,24 +18,18 @@ # for changing this is if sh is not in the same place. SHELL = /bin/sh -# The C compiler and linker to use -CC = gcc -CFLAGS = -g -O2 -Wall -LD = gcc -LDFLAGS = - # Feature flags: # define TLF_FONTS to use TOIlet TLF fonts XCFLAGS = -DTLF_FONTS # Where to install files -prefix = /usr/local +prefix = @TERMUX_PREFIX@ # Where the executables should be put BINDIR = $(prefix)/bin # Where the man page should be put -MANDIR = $(prefix)/man +MANDIR = $(prefix)/share/man # Where figlet will search first for fonts (the ".flf" files). DEFAULTFONTDIR = $(prefix)/share/figlet ================================================ FILE: packages/file/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://darwinsys.com/file/ TERMUX_PKG_DESCRIPTION="Command-line tool that tells you in words what kind of data a file contains" TERMUX_PKG_LICENSE="BSD 2-Clause" TERMUX_PKG_VERSION=5.37 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=ftp://ftp.astron.com/pub/file/file-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=e9c13967f7dd339a3c241b7710ba093560b9a33013491318e88e6b8b57bae07f TERMUX_PKG_DEPENDS="zlib" TERMUX_PKG_BREAKS="file-dev" TERMUX_PKG_REPLACES="file-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_func_mmap_fixed_mapped=yes" TERMUX_PKG_EXTRA_MAKE_ARGS="FILE_COMPILE=$TERMUX_PKG_HOSTBUILD_DIR/src/file" TERMUX_PKG_HOSTBUILD=true ================================================ FILE: packages/file/fix-paths.patch ================================================ diff -uNr file-5.35/src/compress.c file-5.35.mod/src/compress.c --- file-5.35/src/compress.c 2018-10-15 19:29:16.000000000 +0300 +++ file-5.35.mod/src/compress.c 2019-03-02 01:49:14.754069208 +0200 @@ -410,7 +410,7 @@ ssize_t r; int tfd; - (void)strlcpy(buf, "/tmp/file.XXXXXX", sizeof buf); + (void)strlcpy(buf, "@TERMUX_PREFIX@/tmp/file.XXXXXX", sizeof buf); #ifndef HAVE_MKSTEMP { char *ptr = mktemp(buf); diff -uNr file-5.35/src/file.h file-5.35.mod/src/file.h --- file-5.35/src/file.h 2018-10-15 19:29:16.000000000 +0300 +++ file-5.35.mod/src/file.h 2019-03-02 01:49:41.984157713 +0200 @@ -79,7 +79,7 @@ #define ENABLE_CONDITIONALS #ifndef MAGIC -#define MAGIC "/etc/magic" +#define MAGIC "@TERMUX_PREFIX@/etc/magic" #endif #if defined(__EMX__) || defined (WIN32) ================================================ FILE: packages/finch/arpa/nameser.h ================================================ /* $NetBSD: nameser.h,v 1.19 2005/12/26 19:01:47 perry Exp $ */ /* * Copyright (c) 1983, 1989, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 1996-1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Id: nameser.h,v 1.2.2.4.4.1 2004/03/09 08:33:30 marka Exp */ /* * This version of this file is derived from Android 2.3 "Gingerbread", * which contains uncredited changes by Android/Google developers. It has * been modified in 2011 for use in the Android build of Mozilla Firefox by * Mozilla contributors (including Michael Edwards , * and Steve Workman ). * These changes are offered under the same license as the original NetBSD * file, whose copyright and license are unchanged above. */ #ifndef _ARPA_NAMESER_H_ #define _ARPA_NAMESER_H_ #define BIND_4_COMPAT #include #include /* * Revision information. This is the release date in YYYYMMDD format. * It can change every day so the right thing to do with it is use it * in preprocessor commands such as "#if (__NAMESER > 19931104)". Do not * compare for equality; rather, use it to determine whether your libbind.a * contains a new enough lib/nameser/ to support the feature you need. */ #define __NAMESER 19991006 /* New interface version stamp. */ /* * Define constants based on RFC 883, RFC 1034, RFC 1035 */ #define NS_PACKETSZ 512 /* default UDP packet size */ #define NS_MAXDNAME 1025 /* maximum domain name */ #define NS_MAXMSG 65535 /* maximum message size */ #define NS_MAXCDNAME 255 /* maximum compressed domain name */ #define NS_MAXLABEL 63 /* maximum length of domain label */ #define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */ #define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */ #define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */ #define NS_INT32SZ 4 /* #/bytes of data in a uint32_t */ #define NS_INT16SZ 2 /* #/bytes of data in a uint16_t */ #define NS_INT8SZ 1 /* #/bytes of data in a uint8_t */ #define NS_INADDRSZ 4 /* IPv4 T_A */ #define NS_IN6ADDRSZ 16 /* IPv6 T_AAAA */ #define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */ #define NS_DEFAULTPORT 53 /* For both TCP and UDP. */ /* * These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord() * in synch with it. */ typedef enum __ns_sect { ns_s_qd = 0, /* Query: Question. */ ns_s_zn = 0, /* Update: Zone. */ ns_s_an = 1, /* Query: Answer. */ ns_s_pr = 1, /* Update: Prerequisites. */ ns_s_ns = 2, /* Query: Name servers. */ ns_s_ud = 2, /* Update: Update. */ ns_s_ar = 3, /* Query|Update: Additional records. */ ns_s_max = 4 } ns_sect; /* * This is a message handle. It is caller allocated and has no dynamic data. * This structure is intended to be opaque to all but ns_parse.c, thus the * leading _'s on the member names. Use the accessor functions, not the _'s. */ typedef struct __ns_msg { const u_char *_msg, *_eom; uint16_t _id, _flags, _counts[ns_s_max]; const u_char *_sections[ns_s_max]; ns_sect _sect; int _rrnum; const u_char *_msg_ptr; } ns_msg; /* Private data structure - do not use from outside library. */ struct _ns_flagdata { int mask, shift; }; extern const struct _ns_flagdata _ns_flagdata[]; /* Accessor macros - this is part of the public interface. */ #define ns_msg_id(handle) ((handle)._id + 0) #define ns_msg_base(handle) ((handle)._msg + 0) #define ns_msg_end(handle) ((handle)._eom + 0) #define ns_msg_size(handle) ((size_t)((handle)._eom - (handle)._msg)) #define ns_msg_count(handle, section) ((handle)._counts[section] + 0) /* * This is a parsed record. It is caller allocated and has no dynamic data. */ typedef struct __ns_rr { char name[NS_MAXDNAME]; uint16_t type; uint16_t rr_class; uint32_t ttl; uint16_t rdlength; const u_char * rdata; } ns_rr; /* Accessor macros - this is part of the public interface. */ #define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".") #define ns_rr_type(rr) ((ns_type)((rr).type + 0)) #define ns_rr_class(rr) ((ns_class)((rr).rr_class + 0)) #define ns_rr_ttl(rr) ((u_long)(rr).ttl + 0) #define ns_rr_rdlen(rr) ((size_t)(rr).rdlength + 0) #define ns_rr_rdata(rr) ((rr).rdata + 0) /* * These don't have to be in the same order as in the packet flags word, * and they can even overlap in some cases, but they will need to be kept * in synch with ns_parse.c:ns_flagdata[]. */ typedef enum __ns_flag { ns_f_qr, /* Question/Response. */ ns_f_opcode, /* Operation code. */ ns_f_aa, /* Authoritative Answer. */ ns_f_tc, /* Truncation occurred. */ ns_f_rd, /* Recursion Desired. */ ns_f_ra, /* Recursion Available. */ ns_f_z, /* MBZ. */ ns_f_ad, /* Authentic Data (DNSSEC). */ ns_f_cd, /* Checking Disabled (DNSSEC). */ ns_f_rcode, /* Response code. */ ns_f_max } ns_flag; /* * Currently defined opcodes. */ typedef enum __ns_opcode { ns_o_query = 0, /* Standard query. */ ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */ ns_o_status = 2, /* Name server status query (unsupported). */ /* Opcode 3 is undefined/reserved. */ ns_o_notify = 4, /* Zone change notification. */ ns_o_update = 5, /* Zone update message. */ ns_o_max = 6 } ns_opcode; /* * Currently defined response codes. */ typedef enum __ns_rcode { ns_r_noerror = 0, /* No error occurred. */ ns_r_formerr = 1, /* Format error. */ ns_r_servfail = 2, /* Server failure. */ ns_r_nxdomain = 3, /* Name error. */ ns_r_notimpl = 4, /* Unimplemented. */ ns_r_refused = 5, /* Operation refused. */ /* these are for BIND_UPDATE */ ns_r_yxdomain = 6, /* Name exists */ ns_r_yxrrset = 7, /* RRset exists */ ns_r_nxrrset = 8, /* RRset does not exist */ ns_r_notauth = 9, /* Not authoritative for zone */ ns_r_notzone = 10, /* Zone of record different from zone section */ ns_r_max = 11, /* The following are EDNS extended rcodes */ ns_r_badvers = 16, /* The following are TSIG errors */ ns_r_badsig = 16, ns_r_badkey = 17, ns_r_badtime = 18 } ns_rcode; /* BIND_UPDATE */ typedef enum __ns_update_operation { ns_uop_delete = 0, ns_uop_add = 1, ns_uop_max = 2 } ns_update_operation; /* * This structure is used for TSIG authenticated messages */ struct ns_tsig_key { char name[NS_MAXDNAME], alg[NS_MAXDNAME]; unsigned char *data; int len; }; typedef struct ns_tsig_key ns_tsig_key; /* * This structure is used for TSIG authenticated TCP messages */ struct ns_tcp_tsig_state { int counter; struct dst_key *key; void *ctx; unsigned char sig[NS_PACKETSZ]; int siglen; }; typedef struct ns_tcp_tsig_state ns_tcp_tsig_state; #define NS_TSIG_FUDGE 300 #define NS_TSIG_TCP_COUNT 100 #define NS_TSIG_ALG_HMAC_MD5 "HMAC-MD5.SIG-ALG.REG.INT" #define NS_TSIG_ERROR_NO_TSIG -10 #define NS_TSIG_ERROR_NO_SPACE -11 #define NS_TSIG_ERROR_FORMERR -12 /* * Currently defined type values for resources and queries. */ typedef enum __ns_type { ns_t_invalid = 0, /* Cookie. */ ns_t_a = 1, /* Host address. */ ns_t_ns = 2, /* Authoritative server. */ ns_t_md = 3, /* Mail destination. */ ns_t_mf = 4, /* Mail forwarder. */ ns_t_cname = 5, /* Canonical name. */ ns_t_soa = 6, /* Start of authority zone. */ ns_t_mb = 7, /* Mailbox domain name. */ ns_t_mg = 8, /* Mail group member. */ ns_t_mr = 9, /* Mail rename name. */ ns_t_null = 10, /* Null resource record. */ ns_t_wks = 11, /* Well known service. */ ns_t_ptr = 12, /* Domain name pointer. */ ns_t_hinfo = 13, /* Host information. */ ns_t_minfo = 14, /* Mailbox information. */ ns_t_mx = 15, /* Mail routing information. */ ns_t_txt = 16, /* Text strings. */ ns_t_rp = 17, /* Responsible person. */ ns_t_afsdb = 18, /* AFS cell database. */ ns_t_x25 = 19, /* X_25 calling address. */ ns_t_isdn = 20, /* ISDN calling address. */ ns_t_rt = 21, /* Router. */ ns_t_nsap = 22, /* NSAP address. */ ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */ ns_t_sig = 24, /* Security signature. */ ns_t_key = 25, /* Security key. */ ns_t_px = 26, /* X.400 mail mapping. */ ns_t_gpos = 27, /* Geographical position (withdrawn). */ ns_t_aaaa = 28, /* Ip6 Address. */ ns_t_loc = 29, /* Location Information. */ ns_t_nxt = 30, /* Next domain (security). */ ns_t_eid = 31, /* Endpoint identifier. */ ns_t_nimloc = 32, /* Nimrod Locator. */ ns_t_srv = 33, /* Server Selection. */ ns_t_atma = 34, /* ATM Address */ ns_t_naptr = 35, /* Naming Authority PoinTeR */ ns_t_kx = 36, /* Key Exchange */ ns_t_cert = 37, /* Certification record */ ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */ ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */ ns_t_sink = 40, /* Kitchen sink (experimentatl) */ ns_t_opt = 41, /* EDNS0 option (meta-RR) */ ns_t_apl = 42, /* Address prefix list (RFC 3123) */ ns_t_tkey = 249, /* Transaction key */ ns_t_tsig = 250, /* Transaction signature. */ ns_t_ixfr = 251, /* Incremental zone transfer. */ ns_t_axfr = 252, /* Transfer zone of authority. */ ns_t_mailb = 253, /* Transfer mailbox records. */ ns_t_maila = 254, /* Transfer mail agent records. */ ns_t_any = 255, /* Wildcard match. */ ns_t_zxfr = 256, /* BIND-specific, nonstandard. */ ns_t_max = 65536 } ns_type; /* Exclusively a QTYPE? (not also an RTYPE) */ #define ns_t_qt_p(t) (ns_t_xfr_p(t) || (t) == ns_t_any || \ (t) == ns_t_mailb || (t) == ns_t_maila) /* Some kind of meta-RR? (not a QTYPE, but also not an RTYPE) */ #define ns_t_mrr_p(t) ((t) == ns_t_tsig || (t) == ns_t_opt) /* Exclusively an RTYPE? (not also a QTYPE or a meta-RR) */ #define ns_t_rr_p(t) (!ns_t_qt_p(t) && !ns_t_mrr_p(t)) #define ns_t_udp_p(t) ((t) != ns_t_axfr && (t) != ns_t_zxfr) #define ns_t_xfr_p(t) ((t) == ns_t_axfr || (t) == ns_t_ixfr || \ (t) == ns_t_zxfr) /* * Values for class field */ typedef enum __ns_class { ns_c_invalid = 0, /* Cookie. */ ns_c_in = 1, /* Internet. */ ns_c_2 = 2, /* unallocated/unsupported. */ ns_c_chaos = 3, /* MIT Chaos-net. */ ns_c_hs = 4, /* MIT Hesiod. */ /* Query class values which do not appear in resource records */ ns_c_none = 254, /* for prereq. sections in update requests */ ns_c_any = 255, /* Wildcard match. */ ns_c_max = 65536 } ns_class; /* DNSSEC constants. */ typedef enum __ns_key_types { ns_kt_rsa = 1, /* key type RSA/MD5 */ ns_kt_dh = 2, /* Diffie Hellman */ ns_kt_dsa = 3, /* Digital Signature Standard (MANDATORY) */ ns_kt_private = 254 /* Private key type starts with OID */ } ns_key_types; typedef enum __ns_cert_types { cert_t_pkix = 1, /* PKIX (X.509v3) */ cert_t_spki = 2, /* SPKI */ cert_t_pgp = 3, /* PGP */ cert_t_url = 253, /* URL private type */ cert_t_oid = 254 /* OID private type */ } ns_cert_types; /* Flags field of the KEY RR rdata. */ #define NS_KEY_TYPEMASK 0xC000 /* Mask for "type" bits */ #define NS_KEY_TYPE_AUTH_CONF 0x0000 /* Key usable for both */ #define NS_KEY_TYPE_CONF_ONLY 0x8000 /* Key usable for confidentiality */ #define NS_KEY_TYPE_AUTH_ONLY 0x4000 /* Key usable for authentication */ #define NS_KEY_TYPE_NO_KEY 0xC000 /* No key usable for either; no key */ /* The type bits can also be interpreted independently, as single bits: */ #define NS_KEY_NO_AUTH 0x8000 /* Key unusable for authentication */ #define NS_KEY_NO_CONF 0x4000 /* Key unusable for confidentiality */ #define NS_KEY_RESERVED2 0x2000 /* Security is *mandatory* if bit=0 */ #define NS_KEY_EXTENDED_FLAGS 0x1000 /* reserved - must be zero */ #define NS_KEY_RESERVED4 0x0800 /* reserved - must be zero */ #define NS_KEY_RESERVED5 0x0400 /* reserved - must be zero */ #define NS_KEY_NAME_TYPE 0x0300 /* these bits determine the type */ #define NS_KEY_NAME_USER 0x0000 /* key is assoc. with user */ #define NS_KEY_NAME_ENTITY 0x0200 /* key is assoc. with entity eg host */ #define NS_KEY_NAME_ZONE 0x0100 /* key is zone key */ #define NS_KEY_NAME_RESERVED 0x0300 /* reserved meaning */ #define NS_KEY_RESERVED8 0x0080 /* reserved - must be zero */ #define NS_KEY_RESERVED9 0x0040 /* reserved - must be zero */ #define NS_KEY_RESERVED10 0x0020 /* reserved - must be zero */ #define NS_KEY_RESERVED11 0x0010 /* reserved - must be zero */ #define NS_KEY_SIGNATORYMASK 0x000F /* key can sign RR's of same name */ #define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED2 | \ NS_KEY_RESERVED4 | \ NS_KEY_RESERVED5 | \ NS_KEY_RESERVED8 | \ NS_KEY_RESERVED9 | \ NS_KEY_RESERVED10 | \ NS_KEY_RESERVED11 ) #define NS_KEY_RESERVED_BITMASK2 0xFFFF /* no bits defined here */ /* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */ #define NS_ALG_MD5RSA 1 /* MD5 with RSA */ #define NS_ALG_DH 2 /* Diffie Hellman KEY */ #define NS_ALG_DSA 3 /* DSA KEY */ #define NS_ALG_DSS NS_ALG_DSA #define NS_ALG_EXPIRE_ONLY 253 /* No alg, no security */ #define NS_ALG_PRIVATE_OID 254 /* Key begins with OID giving alg */ /* Protocol values */ /* value 0 is reserved */ #define NS_KEY_PROT_TLS 1 #define NS_KEY_PROT_EMAIL 2 #define NS_KEY_PROT_DNSSEC 3 #define NS_KEY_PROT_IPSEC 4 #define NS_KEY_PROT_ANY 255 /* Signatures */ #define NS_MD5RSA_MIN_BITS 512 /* Size of a mod or exp in bits */ #define NS_MD5RSA_MAX_BITS 4096 /* Total of binary mod and exp */ #define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3) /* Max length of text sig block */ #define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4) #define NS_MD5RSA_MIN_SIZE ((NS_MD5RSA_MIN_BITS+7)/8) #define NS_MD5RSA_MAX_SIZE ((NS_MD5RSA_MAX_BITS+7)/8) #define NS_DSA_SIG_SIZE 41 #define NS_DSA_MIN_SIZE 213 #define NS_DSA_MAX_BYTES 405 /* Offsets into SIG record rdata to find various values */ #define NS_SIG_TYPE 0 /* Type flags */ #define NS_SIG_ALG 2 /* Algorithm */ #define NS_SIG_LABELS 3 /* How many labels in name */ #define NS_SIG_OTTL 4 /* Original TTL */ #define NS_SIG_EXPIR 8 /* Expiration time */ #define NS_SIG_SIGNED 12 /* Signature time */ #define NS_SIG_FOOT 16 /* Key footprint */ #define NS_SIG_SIGNER 18 /* Domain name of who signed it */ /* How RR types are represented as bit-flags in NXT records */ #define NS_NXT_BITS 8 #define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS))) #define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS))) #define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS))) #define NS_NXT_MAX 127 /* * EDNS0 extended flags, host order. */ #define NS_OPT_DNSSEC_OK 0x8000U /* * Inline versions of get/put short/long. Pointer is advanced. */ #define NS_GET16(s, cp) do { \ const u_char *t_cp = (const u_char *)(cp); \ (s) = ((uint16_t)t_cp[0] << 8) \ | ((uint16_t)t_cp[1]) \ ; \ (cp) += NS_INT16SZ; \ } while (/*CONSTCOND*/0) #define NS_GET32(l, cp) do { \ const u_char *t_cp = (const u_char *)(cp); \ (l) = ((uint32_t)t_cp[0] << 24) \ | ((uint32_t)t_cp[1] << 16) \ | ((uint32_t)t_cp[2] << 8) \ | ((uint32_t)t_cp[3]) \ ; \ (cp) += NS_INT32SZ; \ } while (/*CONSTCOND*/0) #define NS_PUT16(s, cp) do { \ uint32_t t_s = (uint32_t)(s); \ u_char *t_cp = (u_char *)(cp); \ *t_cp++ = t_s >> 8; \ *t_cp = t_s; \ (cp) += NS_INT16SZ; \ } while (/*CONSTCOND*/0) #define NS_PUT32(l, cp) do { \ uint32_t t_l = (uint32_t)(l); \ u_char *t_cp = (u_char *)(cp); \ *t_cp++ = t_l >> 24; \ *t_cp++ = t_l >> 16; \ *t_cp++ = t_l >> 8; \ *t_cp = t_l; \ (cp) += NS_INT32SZ; \ } while (/*CONSTCOND*/0) /* * ANSI C identifier hiding for bind's lib/nameser. */ #define ns_msg_getflag __ns_msg_getflag #define ns_get16 __ns_get16 #define ns_get32 __ns_get32 #define ns_put16 __ns_put16 #define ns_put32 __ns_put32 #define ns_initparse __ns_initparse #define ns_skiprr __ns_skiprr #define ns_parserr __ns_parserr #define ns_sprintrr __ns_sprintrr #define ns_sprintrrf __ns_sprintrrf #define ns_format_ttl __ns_format_ttl #define ns_parse_ttl __ns_parse_ttl #define ns_datetosecs __ns_datetosecs #define ns_name_ntol __ns_name_ntol #define ns_name_ntop __ns_name_ntop #define ns_name_pton __ns_name_pton #define ns_name_unpack __ns_name_unpack #define ns_name_pack __ns_name_pack #define ns_name_compress __ns_name_compress #define ns_name_uncompress __ns_name_uncompress #define ns_name_skip __ns_name_skip #define ns_name_rollback __ns_name_rollback #define ns_sign __ns_sign #define ns_sign2 __ns_sign2 #define ns_sign_tcp __ns_sign_tcp #define ns_sign_tcp2 __ns_sign_tcp2 #define ns_sign_tcp_init __ns_sign_tcp_init #define ns_find_tsig __ns_find_tsig #define ns_verify __ns_verify #define ns_verify_tcp __ns_verify_tcp #define ns_verify_tcp_init __ns_verify_tcp_init #define ns_samedomain __ns_samedomain #define ns_subdomain __ns_subdomain #define ns_makecanon __ns_makecanon #define ns_samename __ns_samename __BEGIN_DECLS int ns_msg_getflag(ns_msg, int); uint16_t ns_get16(const u_char *); uint32_t ns_get32(const u_char *); void ns_put16(uint16_t, u_char *); void ns_put32(uint32_t, u_char *); int ns_initparse(const u_char *, int, ns_msg *); int ns_skiprr(const u_char *, const u_char *, ns_sect, int); int ns_parserr(ns_msg *, ns_sect, int, ns_rr *); int ns_sprintrr(const ns_msg *, const ns_rr *, const char *, const char *, char *, size_t); int ns_sprintrrf(const u_char *, size_t, const char *, ns_class, ns_type, u_long, const u_char *, size_t, const char *, const char *, char *, size_t); int ns_format_ttl(u_long, char *, size_t); int ns_parse_ttl(const char *, u_long *); uint32_t ns_datetosecs(const char *cp, int *errp); int ns_name_ntol(const u_char *, u_char *, size_t); int ns_name_ntop(const u_char *, char *, size_t); int ns_name_pton(const char *, u_char *, size_t); int ns_name_unpack(const u_char *, const u_char *, const u_char *, u_char *, size_t); int ns_name_pack(const u_char *, u_char *, int, const u_char **, const u_char **); int ns_name_uncompress(const u_char *, const u_char *, const u_char *, char *, size_t); int ns_name_compress(const char *, u_char *, size_t, const u_char **, const u_char **); int ns_name_skip(const u_char **, const u_char *); void ns_name_rollback(const u_char *, const u_char **, const u_char **); int ns_sign(u_char *, int *, int, int, void *, const u_char *, int, u_char *, int *, time_t); int ns_sign2(u_char *, int *, int, int, void *, const u_char *, int, u_char *, int *, time_t, u_char **, u_char **); int ns_sign_tcp(u_char *, int *, int, int, ns_tcp_tsig_state *, int); int ns_sign_tcp2(u_char *, int *, int, int, ns_tcp_tsig_state *, int, u_char **, u_char **); int ns_sign_tcp_init(void *, const u_char *, int, ns_tcp_tsig_state *); u_char *ns_find_tsig(u_char *, u_char *); int ns_verify(u_char *, int *, void *, const u_char *, int, u_char *, int *, time_t *, int); int ns_verify_tcp(u_char *, int *, ns_tcp_tsig_state *, int); int ns_verify_tcp_init(void *, const u_char *, int, ns_tcp_tsig_state *); int ns_samedomain(const char *, const char *); int ns_subdomain(const char *, const char *); int ns_makecanon(const char *, char *, size_t); int ns_samename(const char *, const char *); __END_DECLS #ifdef BIND_4_COMPAT #include #endif #if 0 # include # define XLOG(...) \ __libc_android_log_print(ANDROID_LOG_DEBUG,"libc",__VA_ARGS__) #else #define XLOG(...) do {} while (0) #endif #endif /* !_ARPA_NAMESER_H_ */ ================================================ FILE: packages/finch/arpa/nameser_compat.h ================================================ /* $NetBSD: nameser_compat.h,v 1.1.1.2 2004/11/07 01:28:27 christos Exp $ */ /* Copyright (c) 1983, 1989 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * from nameser.h 8.1 (Berkeley) 6/2/93 * Id: nameser_compat.h,v 1.1.2.3.4.2 2004/07/01 04:43:41 marka Exp */ /* * This version of this file is derived from Android 2.3 "Gingerbread", * which contains uncredited changes by Android/Google developers. It has * been modified in 2011 for use in the Android build of Mozilla Firefox by * Mozilla contributors (including Michael Edwards , * and Steve Workman ). * These changes are offered under the same license as the original NetBSD * file, whose copyright and license are unchanged above. */ #ifndef _ARPA_NAMESER_COMPAT_ #define _ARPA_NAMESER_COMPAT_ #define __BIND 19950621 /* (DEAD) interface version stamp. */ #include #ifndef BYTE_ORDER #if (BSD >= 199103) # include #else #ifdef __linux # include #else #define LITTLE_ENDIAN 1234 /* least-significant byte first (vax, pc) */ #define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */ #define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp)*/ #if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \ defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \ defined(__alpha__) || defined(__alpha) || \ (defined(__Lynx__) && defined(__x86__)) #define BYTE_ORDER LITTLE_ENDIAN #endif #if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \ defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \ defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\ defined(apollo) || defined(__convex__) || defined(_CRAY) || \ defined(__hppa) || defined(__hp9000) || \ defined(__hp9000s300) || defined(__hp9000s700) || \ defined(__hp3000s900) || defined(__hpux) || defined(MPE) || \ defined (BIT_ZERO_ON_LEFT) || defined(m68k) || defined(__sparc) || \ (defined(__Lynx__) && \ (defined(__68k__) || defined(__sparc__) || defined(__powerpc__))) #define BYTE_ORDER BIG_ENDIAN #endif #endif /* __linux */ #endif /* BSD */ #endif /* BYTE_ORDER */ #if !defined(BYTE_ORDER) || \ (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \ BYTE_ORDER != PDP_ENDIAN) /* you must determine what the correct bit order is for * your compiler - the next line is an intentional error * which will force your compiles to bomb until you fix * the above macros. */ #error "Undefined or invalid BYTE_ORDER"; #endif /* * Structure for query header. The order of the fields is machine- and * compiler-dependent, depending on the byte/bit order and the layout * of bit fields. We use bit fields only in int variables, as this * is all ANSI requires. This requires a somewhat confusing rearrangement. */ typedef struct { unsigned id :16; /* query identification number */ #if BYTE_ORDER == BIG_ENDIAN /* fields in third byte */ unsigned qr: 1; /* response flag */ unsigned opcode: 4; /* purpose of message */ unsigned aa: 1; /* authoritive answer */ unsigned tc: 1; /* truncated message */ unsigned rd: 1; /* recursion desired */ /* fields in fourth byte */ unsigned ra: 1; /* recursion available */ unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */ unsigned ad: 1; /* authentic data from named */ unsigned cd: 1; /* checking disabled by resolver */ unsigned rcode :4; /* response code */ #endif #if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN /* fields in third byte */ unsigned rd :1; /* recursion desired */ unsigned tc :1; /* truncated message */ unsigned aa :1; /* authoritive answer */ unsigned opcode :4; /* purpose of message */ unsigned qr :1; /* response flag */ /* fields in fourth byte */ unsigned rcode :4; /* response code */ unsigned cd: 1; /* checking disabled by resolver */ unsigned ad: 1; /* authentic data from named */ unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */ unsigned ra :1; /* recursion available */ #endif /* remaining bytes */ unsigned qdcount :16; /* number of question entries */ unsigned ancount :16; /* number of answer entries */ unsigned nscount :16; /* number of authority entries */ unsigned arcount :16; /* number of resource entries */ } HEADER; #define PACKETSZ NS_PACKETSZ #define MAXDNAME NS_MAXDNAME #define MAXCDNAME NS_MAXCDNAME #define MAXLABEL NS_MAXLABEL #define HFIXEDSZ NS_HFIXEDSZ #define QFIXEDSZ NS_QFIXEDSZ #define RRFIXEDSZ NS_RRFIXEDSZ #define INT32SZ NS_INT32SZ #define INT16SZ NS_INT16SZ #define INT8SZ NS_INT8SZ #define INADDRSZ NS_INADDRSZ #define IN6ADDRSZ NS_IN6ADDRSZ #define INDIR_MASK NS_CMPRSFLGS #define NAMESERVER_PORT NS_DEFAULTPORT #define S_ZONE ns_s_zn #define S_PREREQ ns_s_pr #define S_UPDATE ns_s_ud #define S_ADDT ns_s_ar #define QUERY ns_o_query #define IQUERY ns_o_iquery #define STATUS ns_o_status #define NS_NOTIFY_OP ns_o_notify #define NS_UPDATE_OP ns_o_update #define NOERROR ns_r_noerror #define FORMERR ns_r_formerr #define SERVFAIL ns_r_servfail #define NXDOMAIN ns_r_nxdomain #define NOTIMP ns_r_notimpl #define REFUSED ns_r_refused #define YXDOMAIN ns_r_yxdomain #define YXRRSET ns_r_yxrrset #define NXRRSET ns_r_nxrrset #define NOTAUTH ns_r_notauth #define NOTZONE ns_r_notzone /*#define BADSIG ns_r_badsig*/ /*#define BADKEY ns_r_badkey*/ /*#define BADTIME ns_r_badtime*/ #define DELETE ns_uop_delete #define ADD ns_uop_add #define T_A ns_t_a #define T_NS ns_t_ns #define T_MD ns_t_md #define T_MF ns_t_mf #define T_CNAME ns_t_cname #define T_SOA ns_t_soa #define T_MB ns_t_mb #define T_MG ns_t_mg #define T_MR ns_t_mr #define T_NULL ns_t_null #define T_WKS ns_t_wks #define T_PTR ns_t_ptr #define T_HINFO ns_t_hinfo #define T_MINFO ns_t_minfo #define T_MX ns_t_mx #define T_TXT ns_t_txt #define T_RP ns_t_rp #define T_AFSDB ns_t_afsdb #define T_X25 ns_t_x25 #define T_ISDN ns_t_isdn #define T_RT ns_t_rt #define T_NSAP ns_t_nsap #define T_NSAP_PTR ns_t_nsap_ptr #define T_SIG ns_t_sig #define T_KEY ns_t_key #define T_PX ns_t_px #define T_GPOS ns_t_gpos #define T_AAAA ns_t_aaaa #define T_LOC ns_t_loc #define T_NXT ns_t_nxt #define T_EID ns_t_eid #define T_NIMLOC ns_t_nimloc #define T_SRV ns_t_srv #define T_ATMA ns_t_atma #define T_NAPTR ns_t_naptr #define T_A6 ns_t_a6 #define T_TSIG ns_t_tsig #define T_IXFR ns_t_ixfr #define T_AXFR ns_t_axfr #define T_MAILB ns_t_mailb #define T_MAILA ns_t_maila #define T_ANY ns_t_any #define C_IN ns_c_in #define C_CHAOS ns_c_chaos #define C_HS ns_c_hs /* BIND_UPDATE */ #define C_NONE ns_c_none #define C_ANY ns_c_any #define GETSHORT NS_GET16 #define GETLONG NS_GET32 #define PUTSHORT NS_PUT16 #define PUTLONG NS_PUT32 #endif /* _ARPA_NAMESER_COMPAT_ */ ================================================ FILE: packages/finch/bonjour-makefile.patch ================================================ diff -u -r ../pidgin-2.10.12/libpurple/protocols/bonjour/Makefile.in ./libpurple/protocols/bonjour/Makefile.in --- ../pidgin-2.10.12/libpurple/protocols/bonjour/Makefile.in 2015-12-31 18:19:51.000000000 -0500 +++ ./libpurple/protocols/bonjour/Makefile.in 2016-05-05 04:28:23.297133517 -0400 @@ -592,7 +592,7 @@ } libbonjour.la: $(libbonjour_la_OBJECTS) $(libbonjour_la_DEPENDENCIES) $(EXTRA_libbonjour_la_DEPENDENCIES) - $(AM_V_CCLD)$(libbonjour_la_LINK) $(am_libbonjour_la_rpath) $(libbonjour_la_OBJECTS) $(libbonjour_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libbonjour_la_LINK) $(am_libbonjour_la_rpath) $(libbonjour_la_OBJECTS) $(libbonjour_la_LIBADD) $(LIBS) -lpurple mostlyclean-compile: -rm -f *.$(OBJEXT) ================================================ FILE: packages/finch/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://pidgin.im/ TERMUX_PKG_DESCRIPTION="Text-based multi-protocol instant messaging client" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.13.0 TERMUX_PKG_REVISION=3 TERMUX_PKG_SHA256=2747150c6f711146bddd333c496870bfd55058bab22ffb7e4eb784018ec46d8f TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/pidgin/Pidgin/${TERMUX_PKG_VERSION}/pidgin-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_DEPENDS="libiconv, libgnutls, libxml2, ncurses-ui-libs, glib" TERMUX_PKG_BREAKS="finch-dev" TERMUX_PKG_REPLACES="finch-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-gtkui --disable-gstreamer --disable-vv --disable-idn --disable-meanwhile --disable-avahi --disable-dbus --disable-perl --disable-tcl --without-zephyr --with-ncurses-headers=$TERMUX_PREFIX/include --without-python " TERMUX_PKG_RM_AFTER_INSTALL="share/sounds/purple lib/purple-2/libmsn.so" termux_step_pre_configure() { # For arpa: CFLAGS+=" -isystem $TERMUX_PKG_BUILDER_DIR" } termux_step_post_configure() { # Hack to compile first version of libpurple-ciphers.la cp $TERMUX_PREFIX/lib/libxml2.so $TERMUX_PREFIX/lib/libpurple.so cd $TERMUX_PKG_BUILDDIR/libpurple/ciphers make libpurple-ciphers.la cd .. make libpurple.la # Put a more proper version in lib: cp .libs/libpurple.so $TERMUX_PREFIX/lib/ make clean } termux_step_post_make_install() { cd $TERMUX_PREFIX/lib for lib in jabber oscar; do ln -f -s purple-2/lib${lib}.so . done } ================================================ FILE: packages/finch/configure.patch ================================================ diff -u -r ../pidgin-2.10.11/configure ./configure --- ../pidgin-2.10.11/configure 2014-11-23 11:42:00.000000000 -0500 +++ ./configure 2014-12-28 16:09:30.872081387 -0500 @@ -19876,7 +19876,6 @@ "-Wcast-align" \ "-Wdeclaration-after-statement" \ "-Wendif-labels" \ - "-Werror-implicit-function-declaration" \ "-Wextra -Wno-unused-parameter" \ "-Wformat-security" \ "-Werror=format-security" \ ================================================ FILE: packages/finch/dont-build-nullclient-example.patch ================================================ diff -u -r ../pidgin-2.10.9/libpurple/example/Makefile.in ./libpurple/example/Makefile.in --- ../pidgin-2.10.9/libpurple/example/Makefile.in 2014-02-02 22:30:21.000000000 +0100 +++ ./libpurple/example/Makefile.in 2014-03-09 22:35:03.000000000 +0100 @@ -51,7 +51,6 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -noinst_PROGRAMS = nullclient$(EXEEXT) subdir = libpurple/example DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ================================================ FILE: packages/finch/gg-makefile.patch ================================================ diff -u -r ../pidgin-2.10.12/libpurple/protocols/gg/Makefile.in ./libpurple/protocols/gg/Makefile.in --- ../pidgin-2.10.12/libpurple/protocols/gg/Makefile.in 2015-12-31 18:19:51.000000000 -0500 +++ ./libpurple/protocols/gg/Makefile.in 2016-05-05 04:29:27.412205753 -0400 @@ -697,7 +697,7 @@ } libgg.la: $(libgg_la_OBJECTS) $(libgg_la_DEPENDENCIES) $(EXTRA_libgg_la_DEPENDENCIES) - $(AM_V_CCLD)$(libgg_la_LINK) $(am_libgg_la_rpath) $(libgg_la_OBJECTS) $(libgg_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libgg_la_LINK) $(am_libgg_la_rpath) $(libgg_la_OBJECTS) $(libgg_la_LIBADD) $(LIBS) -lpurple mostlyclean-compile: -rm -f *.$(OBJEXT) ================================================ FILE: packages/finch/irc-makefile.patch ================================================ diff -u -r ../pidgin-2.10.11/libpurple/protocols/irc/Makefile.in ./libpurple/protocols/irc/Makefile.in --- ../pidgin-2.10.11/libpurple/protocols/irc/Makefile.in 2014-11-23 11:41:59.000000000 -0500 +++ ./libpurple/protocols/irc/Makefile.in 2015-12-17 18:48:54.684544173 -0500 @@ -564,7 +564,7 @@ } libirc.la: $(libirc_la_OBJECTS) $(libirc_la_DEPENDENCIES) $(EXTRA_libirc_la_DEPENDENCIES) - $(AM_V_CCLD)$(libirc_la_LINK) $(am_libirc_la_rpath) $(libirc_la_OBJECTS) $(libirc_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libirc_la_LINK) $(am_libirc_la_rpath) $(libirc_la_OBJECTS) $(libirc_la_LIBADD) $(LIBS) -lpurple mostlyclean-compile: -rm -f *.$(OBJEXT) ================================================ FILE: packages/finch/jabber-makefile.patch ================================================ diff -u -r ../pidgin-2.10.12/libpurple/protocols/jabber/Makefile.in ./libpurple/protocols/jabber/Makefile.in --- ../pidgin-2.10.12/libpurple/protocols/jabber/Makefile.in 2015-12-31 18:19:52.000000000 -0500 +++ ./libpurple/protocols/jabber/Makefile.in 2016-05-05 04:17:05.462969023 -0400 @@ -649,10 +649,10 @@ } libjabber.la: $(libjabber_la_OBJECTS) $(libjabber_la_DEPENDENCIES) $(EXTRA_libjabber_la_DEPENDENCIES) - $(AM_V_CCLD)$(libjabber_la_LINK) $(am_libjabber_la_rpath) $(libjabber_la_OBJECTS) $(libjabber_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libjabber_la_LINK) $(am_libjabber_la_rpath) $(libjabber_la_OBJECTS) $(libjabber_la_LIBADD) $(LIBS) -lpurple libxmpp.la: $(libxmpp_la_OBJECTS) $(libxmpp_la_DEPENDENCIES) $(EXTRA_libxmpp_la_DEPENDENCIES) - $(AM_V_CCLD)$(libxmpp_la_LINK) $(am_libxmpp_la_rpath) $(libxmpp_la_OBJECTS) $(libxmpp_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libxmpp_la_LINK) $(am_libxmpp_la_rpath) $(libxmpp_la_OBJECTS) $(libxmpp_la_LIBADD) $(LIBS) -lpurple mostlyclean-compile: -rm -f *.$(OBJEXT) ================================================ FILE: packages/finch/libgnt-gntmain.c.patch ================================================ diff -u -r ../pidgin-2.10.12/finch/libgnt/gntmain.c ./finch/libgnt/gntmain.c --- ../pidgin-2.10.12/finch/libgnt/gntmain.c 2015-12-31 18:19:40.000000000 -0500 +++ ./finch/libgnt/gntmain.c 2016-05-05 04:09:16.281843580 -0400 @@ -493,7 +493,8 @@ refresh(); #ifdef ALL_MOUSE_EVENTS - if ((mouse_enabled = gnt_style_get_bool(GNT_STYLE_MOUSE, FALSE))) + /* Termux modification: Enable mouse events by default. */ + if ((mouse_enabled = gnt_style_get_bool(GNT_STYLE_MOUSE, TRUE))) mousemask(ALL_MOUSE_EVENTS | REPORT_MOUSE_POSITION, NULL); #endif ================================================ FILE: packages/finch/oscar-makefile.patch ================================================ diff -u -r ../pidgin-2.10.12/libpurple/protocols/oscar/Makefile.in ./libpurple/protocols/oscar/Makefile.in --- ../pidgin-2.10.12/libpurple/protocols/oscar/Makefile.in 2015-12-31 18:19:52.000000000 -0500 +++ ./libpurple/protocols/oscar/Makefile.in 2016-05-05 04:27:46.529665679 -0400 @@ -652,13 +652,13 @@ } libaim.la: $(libaim_la_OBJECTS) $(libaim_la_DEPENDENCIES) $(EXTRA_libaim_la_DEPENDENCIES) - $(AM_V_CCLD)$(libaim_la_LINK) $(am_libaim_la_rpath) $(libaim_la_OBJECTS) $(libaim_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libaim_la_LINK) $(am_libaim_la_rpath) $(libaim_la_OBJECTS) $(libaim_la_LIBADD) $(LIBS) -lpurple libicq.la: $(libicq_la_OBJECTS) $(libicq_la_DEPENDENCIES) $(EXTRA_libicq_la_DEPENDENCIES) - $(AM_V_CCLD)$(libicq_la_LINK) $(am_libicq_la_rpath) $(libicq_la_OBJECTS) $(libicq_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libicq_la_LINK) $(am_libicq_la_rpath) $(libicq_la_OBJECTS) $(libicq_la_LIBADD) $(LIBS) -lpurple liboscar.la: $(liboscar_la_OBJECTS) $(liboscar_la_DEPENDENCIES) $(EXTRA_liboscar_la_DEPENDENCIES) - $(AM_V_CCLD)$(liboscar_la_LINK) $(am_liboscar_la_rpath) $(liboscar_la_OBJECTS) $(liboscar_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(liboscar_la_LINK) $(am_liboscar_la_rpath) $(liboscar_la_OBJECTS) $(liboscar_la_LIBADD) $(LIBS) -lpurple mostlyclean-compile: -rm -f *.$(OBJEXT) ================================================ FILE: packages/finch/sametime-makefile.patch ================================================ diff -u -r ../pidgin-2.10.12/libpurple/protocols/sametime/Makefile.in ./libpurple/protocols/sametime/Makefile.in --- ../pidgin-2.10.12/libpurple/protocols/sametime/Makefile.in 2015-12-31 18:19:52.000000000 -0500 +++ ./libpurple/protocols/sametime/Makefile.in 2016-05-05 04:55:56.307866256 -0400 @@ -565,7 +565,7 @@ } libsametime.la: $(libsametime_la_OBJECTS) $(libsametime_la_DEPENDENCIES) $(EXTRA_libsametime_la_DEPENDENCIES) - $(AM_V_CCLD)$(libsametime_la_LINK) $(am_libsametime_la_rpath) $(libsametime_la_OBJECTS) $(libsametime_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libsametime_la_LINK) $(am_libsametime_la_rpath) $(libsametime_la_OBJECTS) $(libsametime_la_LIBADD) $(LIBS) -lpurple mostlyclean-compile: -rm -f *.$(OBJEXT) ================================================ FILE: packages/finch/silc-makefile.patch ================================================ diff -u -r ../pidgin-2.10.12/libpurple/protocols/silc/Makefile.in ./libpurple/protocols/silc/Makefile.in --- ../pidgin-2.10.12/libpurple/protocols/silc/Makefile.in 2015-12-31 18:19:52.000000000 -0500 +++ ./libpurple/protocols/silc/Makefile.in 2016-05-05 04:56:33.511264315 -0400 @@ -582,7 +582,7 @@ } libsilcpurple.la: $(libsilcpurple_la_OBJECTS) $(libsilcpurple_la_DEPENDENCIES) $(EXTRA_libsilcpurple_la_DEPENDENCIES) - $(AM_V_CCLD)$(libsilcpurple_la_LINK) $(am_libsilcpurple_la_rpath) $(libsilcpurple_la_OBJECTS) $(libsilcpurple_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libsilcpurple_la_LINK) $(am_libsilcpurple_la_rpath) $(libsilcpurple_la_OBJECTS) $(libsilcpurple_la_LIBADD) $(LIBS) -lpurple mostlyclean-compile: -rm -f *.$(OBJEXT) ================================================ FILE: packages/finch/silc10-makefile.patch ================================================ diff -u -r ../pidgin-2.10.12/libpurple/protocols/silc10/Makefile.in ./libpurple/protocols/silc10/Makefile.in --- ../pidgin-2.10.12/libpurple/protocols/silc10/Makefile.in 2015-12-31 18:19:52.000000000 -0500 +++ ./libpurple/protocols/silc10/Makefile.in 2016-05-05 04:57:07.446716791 -0400 @@ -571,7 +571,7 @@ } libsilcpurple.la: $(libsilcpurple_la_OBJECTS) $(libsilcpurple_la_DEPENDENCIES) $(EXTRA_libsilcpurple_la_DEPENDENCIES) - $(AM_V_CCLD)$(libsilcpurple_la_LINK) $(am_libsilcpurple_la_rpath) $(libsilcpurple_la_OBJECTS) $(libsilcpurple_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libsilcpurple_la_LINK) $(am_libsilcpurple_la_rpath) $(libsilcpurple_la_OBJECTS) $(libsilcpurple_la_LIBADD) $(LIBS) -lpurple mostlyclean-compile: -rm -f *.$(OBJEXT) ================================================ FILE: packages/finch/simple-makefile.patch ================================================ diff -u -r ../pidgin-2.10.12/libpurple/protocols/simple/Makefile.in ./libpurple/protocols/simple/Makefile.in --- ../pidgin-2.10.12/libpurple/protocols/simple/Makefile.in 2015-12-31 18:19:52.000000000 -0500 +++ ./libpurple/protocols/simple/Makefile.in 2016-05-05 04:58:18.813569692 -0400 @@ -565,7 +565,7 @@ } libsimple.la: $(libsimple_la_OBJECTS) $(libsimple_la_DEPENDENCIES) $(EXTRA_libsimple_la_DEPENDENCIES) - $(AM_V_CCLD)$(libsimple_la_LINK) $(am_libsimple_la_rpath) $(libsimple_la_OBJECTS) $(libsimple_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libsimple_la_LINK) $(am_libsimple_la_rpath) $(libsimple_la_OBJECTS) $(libsimple_la_LIBADD) $(LIBS) -lpurple mostlyclean-compile: -rm -f *.$(OBJEXT) ================================================ FILE: packages/finch/ssl-makefile.patch ================================================ diff -u -r ../pidgin-2.10.12/libpurple/plugins/ssl/Makefile.in ./libpurple/plugins/ssl/Makefile.in --- ../pidgin-2.10.12/libpurple/plugins/ssl/Makefile.in 2015-12-31 18:19:51.000000000 -0500 +++ ./libpurple/plugins/ssl/Makefile.in 2016-05-06 05:14:11.266023479 -0400 @@ -632,13 +632,13 @@ $(AM_V_CCLD)$(nss_prefs_la_LINK) $(am_nss_prefs_la_rpath) $(nss_prefs_la_OBJECTS) $(nss_prefs_la_LIBADD) $(LIBS) ssl-gnutls.la: $(ssl_gnutls_la_OBJECTS) $(ssl_gnutls_la_DEPENDENCIES) $(EXTRA_ssl_gnutls_la_DEPENDENCIES) - $(AM_V_CCLD)$(ssl_gnutls_la_LINK) $(am_ssl_gnutls_la_rpath) $(ssl_gnutls_la_OBJECTS) $(ssl_gnutls_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(ssl_gnutls_la_LINK) $(am_ssl_gnutls_la_rpath) $(ssl_gnutls_la_OBJECTS) $(ssl_gnutls_la_LIBADD) $(LIBS) -lpurple ssl-nss.la: $(ssl_nss_la_OBJECTS) $(ssl_nss_la_DEPENDENCIES) $(EXTRA_ssl_nss_la_DEPENDENCIES) $(AM_V_CCLD)$(ssl_nss_la_LINK) $(am_ssl_nss_la_rpath) $(ssl_nss_la_OBJECTS) $(ssl_nss_la_LIBADD) $(LIBS) ssl.la: $(ssl_la_OBJECTS) $(ssl_la_DEPENDENCIES) $(EXTRA_ssl_la_DEPENDENCIES) - $(AM_V_CCLD)$(ssl_la_LINK) $(am_ssl_la_rpath) $(ssl_la_OBJECTS) $(ssl_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(ssl_la_LINK) $(am_ssl_la_rpath) $(ssl_la_OBJECTS) $(ssl_la_LIBADD) $(LIBS) -lpurple mostlyclean-compile: -rm -f *.$(OBJEXT) ================================================ FILE: packages/findutils/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/findutils/ TERMUX_PKG_DESCRIPTION="Utilities to find files meeting specified criteria and perform various actions on the files which are found" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=4.7.0 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/findutils/findutils-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=c5fefbdf9858f7e4feb86f036e1247a54c79fc2d8e4b7064d5aaa1f47dfa789a TERMUX_PKG_DEPENDS="libandroid-support" TERMUX_PKG_ESSENTIAL=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" gl_cv_func_fflush_stdin=yes SORT_SUPPORTS_Z=yes SORT=$TERMUX_PREFIX/bin/applets/sort " # Remove locale and updatedb which in Termux is provided by mlocate: TERMUX_PKG_RM_AFTER_INSTALL=" bin/locate bin/updatedb share/man/man1/locate.1 share/man/man1/updatedb.1 share/man/man5/locatedb.5 " termux_step_pre_configure() { # This is needed for find to implement support for the # -fstype parameter by parsing /proc/self/mountinfo: CPPFLAGS+=" -DMOUNTED_GETMNTENT1=1" } ================================================ FILE: packages/findutils/configure.patch ================================================ diff -uNr findutils-4.6.0/configure findutils-4.6.0.mod/configure --- findutils-4.6.0/configure 2015-12-28 23:31:23.000000000 +0200 +++ findutils-4.6.0.mod/configure 2019-08-16 17:21:04.358640627 +0300 @@ -15945,7 +15945,7 @@ if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then -$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h +#$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h LIBTHREAD= LTLIBTHREAD= ================================================ FILE: packages/findutils/find-parser.c.patch ================================================ diff -u -r ../findutils-4.7.0/find/parser.c ./find/parser.c --- ../findutils-4.7.0/find/parser.c 2019-08-29 19:10:57.000000000 +0000 +++ ./find/parser.c 2019-09-08 08:27:46.805564375 +0000 @@ -69,10 +69,10 @@ #ifndef HAVE_ENDGRENT -# define endgrent () +# define endgrent() #endif #ifndef HAVE_ENDPWENT -# define endpwent () +# define endpwent() #endif static bool parse_accesscheck (const struct parser_table*, char *argv[], int *arg_ptr); ================================================ FILE: packages/findutils/gl-lib-mountlist.c.patch ================================================ diff -u -r ../findutils-4.6.0/gl/lib/mountlist.c ./gl/lib/mountlist.c --- ../findutils-4.6.0/gl/lib/mountlist.c 2015-12-24 17:41:44.000000000 +0100 +++ ./gl/lib/mountlist.c 2017-06-26 14:11:45.311482879 +0200 @@ -33,6 +33,10 @@ #include +#ifdef __ANDROID__ +# include /* makedev() macro */ +#endif + #if HAVE_SYS_PARAM_H # include #endif ================================================ FILE: packages/fish/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://fishshell.com/ TERMUX_PKG_DESCRIPTION="Shell geared towards interactive use" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=3.0.2 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/fish-shell/fish-shell/releases/download/$TERMUX_PKG_VERSION/fish-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=14728ccc6b8e053d01526ebbd0822ca4eb0235e6487e832ec1d0d22f1395430e # fish calls 'tput' from ncurses-utils, at least when cancelling (Ctrl+C) a command line. # man is needed since fish calls apropos during command completion. TERMUX_PKG_DEPENDS="libc++, ncurses, libandroid-support, ncurses-utils, man, bc, pcre2" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" ac_cv_file__proc_self_stat=yes ac_cv_func_wcstod_l=no --without-included-pcre2 " termux_step_pre_configure() { CXXFLAGS+=" $CPPFLAGS" } termux_step_post_make_install() { cat >> $TERMUX_PREFIX/etc/fish/config.fish < 0): - # HACK: Use some fallbacks in case we can't get anything else. - # `mandoc` does not provide `manpath` or `man --path` and $MANPATH might not be set. - # The alternative is reading its config file (/etc/man.conf) - if os.path.isfile('/etc/man.conf'): - data = open('/etc/man.conf', 'r') - for line in data: - if ('manpath' in line or 'MANPATH' in line): - p = line.split(' ')[1] - p = p.split()[0] - parent_paths.append(p) - if (not parent_paths): - sys.stderr.write("Unable to get the manpath, falling back to /usr/share/man:/usr/local/share/man. Please set $MANPATH if that is not correct.\n") - parent_paths = ["/usr/share/man", "/usr/local/share/man"] + parent_paths = ["@TERMUX_PREFIX@/share/man"] result = [] for parent_path in parent_paths: for section in ['man1', 'man6', 'man8']: ================================================ FILE: packages/fish/share-functions-__fish_print_help.fish.patch ================================================ diff -u -r ../fish-3.0.0/share/functions/__fish_print_help.fish ./share/functions/__fish_print_help.fish --- ../fish-3.0.0/share/functions/__fish_print_help.fish 2018-12-28 13:01:03.000000000 +0000 +++ ./share/functions/__fish_print_help.fish 2018-12-28 22:55:42.761223014 +0000 @@ -22,7 +22,7 @@ set mfish -mfish end if test -e "$__fish_data_dir/man/man1/$item.1" - set help (nroff -c -man $mfish -t $rLL "$__fish_data_dir/man/man1/$item.1" 2>/dev/null) + set help (mandoc "$__fish_datadir/man/man1/$item.1" ^/dev/null) else if test -e "$__fish_data_dir/man/man1/$item.1.gz" set help (gunzip -c "$__fish_data_dir/man/man1/$item.1.gz" 2>/dev/null | nroff -c -man $mfish -t $rLL 2>/dev/null) end @@ -80,6 +80,6 @@ # skip it end end - end | ul # post-process with `ul`, to interpret the old-style grotty escapes + end echo # print a trailing blank line end ================================================ FILE: packages/fish/src-env.cpp.patch ================================================ diff -u -r ../fish-3.0.1/src/env.cpp ./src/env.cpp --- ../fish-3.0.1/src/env.cpp 2019-02-11 12:13:15.000000000 +0000 +++ ./src/env.cpp 2019-02-13 22:19:56.975817836 +0000 @@ -1663,7 +1663,7 @@ auto pwuid = getpwuid(geteuid()); const char *uname = pwuid ? pwuid->pw_name : NULL; // /tmp/fish.user - std::string tmpdir = "/tmp/fish."; + std::string tmpdir = "@TERMUX_PREFIX@/tmp/fish."; if (uname) { tmpdir.append(uname); } ================================================ FILE: packages/fish/src-fish.cpp.patch ================================================ diff -u -r ../fish-2.4.0/src/fish.cpp ./src/fish.cpp --- ../fish-2.4.0/src/fish.cpp 2016-11-07 22:20:54.000000000 -0500 +++ ./src/fish.cpp 2016-12-29 02:39:05.173696719 -0500 @@ -421,6 +421,8 @@ } int main(int argc, char **argv) { + // Termux patch: Setup TMPDIR for use by fish functions such as funced and psub. + if (getenv("TMPDIR") == NULL) putenv("TMPDIR=@TERMUX_PREFIX@/tmp"); int res = 1; int my_optind = 0; ================================================ FILE: packages/fish/src-wutil.cpp.patch ================================================ diff -u -r ../fish-2.6.0/src/wutil.cpp ./src/wutil.cpp --- ../fish-2.6.0/src/wutil.cpp 2017-06-03 14:45:13.000000000 +0200 +++ ./src/wutil.cpp 2017-07-13 22:31:47.791569324 +0200 @@ -290,7 +290,7 @@ // have to grub through sys_nerr and sys_errlist directly On GNU toolchain, this will produce a // deprecation warning from the linker (!!), which appears impossible to suppress! const char *safe_strerror(int err) { -#if defined(__UCLIBC__) +#if defined(__UCLIBC__) || defined(__ANDROID__) // uClibc does not have sys_errlist, however, its strerror is believed to be async-safe. // See issue #808. return strerror(err); ================================================ FILE: packages/flex/Makefile.in.patch ================================================ diff -u -r ../flex-2.6.4/Makefile.in ./Makefile.in --- ../flex-2.6.4/Makefile.in 2017-05-06 16:49:09.000000000 +0200 +++ ./Makefile.in 2018-04-29 23:46:48.128733975 +0200 @@ -453,7 +453,6 @@ doc \ examples \ po \ - tests \ tools all: all-recursive ================================================ FILE: packages/flex/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/westes/flex TERMUX_PKG_DESCRIPTION="Fast lexical analyser generator" TERMUX_PKG_LICENSE="BSD 2-Clause" TERMUX_PKG_VERSION=2.6.4 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/westes/flex/releases/download/v${TERMUX_PKG_VERSION}/flex-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995 TERMUX_PKG_DEPENDS="m4" TERMUX_PKG_HOSTBUILD=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS+="ac_cv_path_M4=$TERMUX_PREFIX/bin/m4" TERMUX_PKG_CONFLICTS="flex-dev" TERMUX_PKG_REPLACES="flex-dev" # Work around https://github.com/westes/flex/issues/241 when building # under ubuntu 17.10: TERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS="CFLAGS=-D_GNU_SOURCE=1" termux_step_pre_configure() { mkdir -p $TERMUX_PKG_BUILDDIR/src/ cp $TERMUX_PKG_HOSTBUILD_DIR/src/stage1flex $TERMUX_PKG_BUILDDIR/src/stage1flex touch -d "next hour" $TERMUX_PKG_BUILDDIR/src/stage1flex } ================================================ FILE: packages/fontconfig/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.freedesktop.org/wiki/Software/fontconfig/ TERMUX_PKG_DESCRIPTION="Library for configuring and customizing font access" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_VERSION=2.13.1 TERMUX_PKG_REVISION=4 TERMUX_PKG_SHA256=f655dd2a986d7aa97e052261b36aa67b0a64989496361eca8d604e6414006741 TERMUX_PKG_SRCURL=https://www.freedesktop.org/software/fontconfig/release/fontconfig-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_DEPENDS="freetype, libxml2, libpng, libuuid, zlib" TERMUX_PKG_BREAKS="fontconfig-dev" TERMUX_PKG_REPLACES="fontconfig-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --enable-libxml2 --enable-iconv=no --disable-docs --with-default-fonts=/system/fonts --with-add-fonts=$TERMUX_PREFIX/share/fonts " ================================================ FILE: packages/fontconfig/fcatomic.c.patch ================================================ diff -uNr fontconfig-2.13.1/src/fcatomic.c fontconfig-2.13.1.mod/src/fcatomic.c --- fontconfig-2.13.1/src/fcatomic.c 2018-03-15 10:44:44.000000000 +0200 +++ fontconfig-2.13.1.mod/src/fcatomic.c 2018-10-03 02:20:37.073426762 +0300 @@ -130,15 +130,12 @@ unlink ((char *) atomic->tmp); return FcFalse; } - ret = link ((char *) atomic->tmp, (char *) atomic->lck); - if (ret < 0 && (errno == EPERM || errno == ENOTSUP || errno == EACCES)) - { + /* the filesystem where atomic->lck points to may not supports * the hard link. so better try to fallback */ ret = mkdir ((char *) atomic->lck, 0600); no_link = FcTrue; - } (void) unlink ((char *) atomic->tmp); #else ret = mkdir ((char *) atomic->lck, 0600); ================================================ FILE: packages/fontconfig/fontconfig-utils.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="bin" TERMUX_SUBPKG_DESCRIPTION="Fontconfig binaries" TERMUX_SUBPKG_DEPENDS="libpng" ================================================ FILE: packages/fortune/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.fefe.de/fortune/ TERMUX_PKG_DESCRIPTION="Revealer of fortunes" TERMUX_PKG_LICENSE="Public Domain" TERMUX_PKG_VERSION=1.2 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=http://dl.fefe.de/fortune-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SHA256=cbb246a500366db39ce035632eb4954e09f1e03b28f2c4688864bfa8661b236a termux_step_make_install() { cd $TERMUX_PKG_SRCDIR $CC $CFLAGS $LDFLAGS fortune.c -o $TERMUX_PREFIX/bin/fortune mkdir -p $TERMUX_PREFIX/share/man/man6 cp debian/fortune.6 $TERMUX_PREFIX/share/man/man6/ local TARFILE=$TERMUX_PKG_CACHEDIR/f.tar.gz termux_download \ http://http.debian.net/debian/pool/main/f/fortune-mod/fortune-mod_1.99.1.orig.tar.gz \ $TARFILE \ fc51aee1f73c936c885f4e0f8b6b48f4f68103e3896eaddc6a45d2b71e14eace cd $TERMUX_PKG_TMPDIR mkdir datfiles cd datfiles tar xf $TARFILE cd fortune-mod-1.99.1/datfiles rm -Rf html off Makefile mkdir -p $TERMUX_PREFIX/share/games/fortunes cp * $TERMUX_PREFIX/share/games/fortunes } ================================================ FILE: packages/fortune/fortune.c.patch ================================================ diff -u -r ../fortune-1.2/fortune.c ./fortune.c --- ../fortune-1.2/fortune.c 2008-02-15 08:20:30.000000000 -0500 +++ ./fortune.c 2016-04-12 04:08:49.426592095 -0400 @@ -51,7 +51,7 @@ #endif #define VERSION "1.0" -#define FORTUNEDIR "/usr/share/games/fortunes" +#define FORTUNEDIR "@TERMUX_PREFIX@/share/games/fortunes" struct option const long_options[] = { ================================================ FILE: packages/fossil/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.fossil-scm.org TERMUX_PKG_DESCRIPTION="DSCM with built-in wiki, http interface and server, tickets database" TERMUX_PKG_LICENSE="BSD 2-Clause" TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas" TERMUX_PKG_VERSION=2.9 TERMUX_PKG_SRCURL=https://www.fossil-scm.org/index.html/uv/fossil-src-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=1cb2ada92d43e3e7e008fe77f5e743d301c7ea34d4c36c42f255f873e73d8b4f TERMUX_PKG_DEPENDS="libsqlite, openssl, zlib" termux_step_pre_configure() { # Avoid mixup of flags between cross compilation # and native build. CC="$CC $CPPFLAGS $CFLAGS $LDFLAGS" unset CFLAGS LDFLAGS } termux_step_configure() { $TERMUX_PKG_SRCDIR/configure \ --prefix=$TERMUX_PREFIX \ --host=$TERMUX_HOST_PLATFORM \ --json \ --disable-internal-sqlite \ --with-openssl=$TERMUX_PREFIX \ --with-zlib=$TERMUX_PREFIX } ================================================ FILE: packages/fossil/src-main.c.patch ================================================ diff -u -r ../fossil-2.6/src/main.c ./src/main.c --- ../fossil-2.6/src/main.c 2018-05-04 12:56:42.000000000 +0000 +++ ./src/main.c 2018-09-12 06:03:45.920702759 +0000 @@ -300,7 +300,7 @@ */ db_unsave_encryption_key(); #endif -#if defined(_WIN32) || defined(__BIONIC__) +#if defined(_WIN32) /* ** Free the secure getpass() buffer now. */ ================================================ FILE: packages/fossil/src-popen.c.patch ================================================ Index: src/popen.c ================================================================== --- a/src/popen.c +++ b/src/popen.c @@ -189,11 +189,11 @@ close(1); fd = dup(pin[1]); if( fd!=1 ) nErr++; close(pin[0]); close(pin[1]); - execl("/bin/sh", "/bin/sh", "-c", zCmd, (char*)0); + execl("@TERMUX_PREFIX@/bin/sh", "@TERMUX_PREFIX@/bin/sh", "-c", zCmd, (char*)0); return 1; }else{ /* This is the parent process */ close(pin[1]); *pfdIn = pin[0]; ================================================ FILE: packages/fossil/src-user.c.patch ================================================ diff -u -r ../fossil-2.6/src/user.c ./src/user.c --- ../fossil-2.6/src/user.c 2018-05-04 12:56:42.000000000 +0000 +++ ./src/user.c 2018-09-12 06:01:49.062037139 +0000 @@ -40,7 +40,7 @@ blob_append(pBlob, z, -1); } -#if defined(_WIN32) || defined(__BIONIC__) +#if defined(_WIN32) #ifdef _WIN32 #include #endif ================================================ FILE: packages/freetype/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.freetype.org TERMUX_PKG_DESCRIPTION="Software font engine capable of producing high-quality output" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.10.1 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=16dbfa488a21fe827dc27eaf708f42f7aa3bb997d745d31a19781628c36ba26f TERMUX_PKG_SRCURL=https://download.savannah.gnu.org/releases/freetype/freetype-$TERMUX_PKG_VERSION.tar.xz TERMUX_PKG_DEPENDS="libbz2, libpng, zlib" TERMUX_PKG_BREAKS="freetype-dev" TERMUX_PKG_REPLACES="freetype-dev" # Use with-harfbuzz=no to avoid circular dependency between freetype and harfbuzz: TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-harfbuzz=no" # not install these files anymore so install them manually. termux_step_post_make_install() { install -Dm700 freetype-config $TERMUX_PREFIX/bin/freetype-config install -Dm600 ../src/docs/freetype-config.1 $TERMUX_PREFIX/share/man/man1/freetype-config.1 } ================================================ FILE: packages/fribidi/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/fribidi/fribidi/ TERMUX_PKG_DESCRIPTION="Implementation of the Unicode Bidirectional Algorithm" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=1.0.7 TERMUX_PKG_SRCURL=https://github.com/fribidi/fribidi/releases/download/v$TERMUX_PKG_VERSION/fribidi-$TERMUX_PKG_VERSION.tar.bz2 TERMUX_PKG_SHA256=5ab5f21e9f2fc57b4b40f8ea8f14dba78a5cc46d9cf94bc5e00a58e6886a935d TERMUX_PKG_DEPENDS="glib" TERMUX_PKG_BREAKS="fribidi-dev" TERMUX_PKG_REPLACES="fribidi-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-docs" ================================================ FILE: packages/frobtads/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.tads.org/frobtads.htm TERMUX_PKG_DESCRIPTION="TADS is a free authoring system for writing your own Interactive Fiction" TERMUX_PKG_LICENSE="non-free" TERMUX_PKG_VERSION=1.2.4 TERMUX_PKG_REVISION=4 TERMUX_PKG_SRCURL=https://github.com/realnc/frobtads/releases/download/$TERMUX_PKG_VERSION/frobtads-$TERMUX_PKG_VERSION.tar.bz2 TERMUX_PKG_SHA256=705be5849293844f499a85280e793941b0eacb362b90d49d85ae8308e4c5b63c TERMUX_PKG_RM_AFTER_INSTALL="share/frobtads/tads3/doc share/frobtads/tads3/lib/webuires" TERMUX_PKG_DEPENDS="libc++, ncurses, libcurl" TERMUX_PKG_LICENSE_FILE="doc/COPYING" ================================================ FILE: packages/frobtads/no_asprintf.patch ================================================ diff -u -r ../frobtads-1.2.3/src/osfrobtads.h ./src/osfrobtads.h --- ../frobtads-1.2.3/src/osfrobtads.h 2013-05-17 21:46:51.000000000 +0200 +++ ./src/osfrobtads.h 2014-02-24 17:38:59.000000000 +0100 @@ -428,8 +428,10 @@ * that aren't available on all Unix variants. Eventually these will * need to be replaced with more thorough versions that encompass * other Unix variants. */ +#ifndef __ANDROID__ int asprintf(char **strp, const char *fmt, ...); int vasprintf(char **strp, const char *fmt, va_list ap); +#endif #define os_asprintf asprintf #define os_vasprintf vasprintf ================================================ FILE: packages/fsmon/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/nowsecure/fsmon TERMUX_PKG_DESCRIPTION="Filesystem monitor with fanotify and inotify backends" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=1.5 TERMUX_PKG_SRCURL=https://github.com/nowsecure/fsmon/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=37ea1c83297976f5c7058637a328150dea57743d5eb55ebfc3a8075d262d67c2 TERMUX_PKG_BUILD_IN_SRC=true termux_step_make() { make FANOTIFY_CFLAGS="-DHAVE_FANOTIFY=1 -DHAVE_SYS_FANOTIFY=0" } ================================================ FILE: packages/fwknop/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.cipherdyne.org/fwknop/ TERMUX_PKG_DESCRIPTION="fwknop: Single Packet Authorization > Port Knocking" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.6.10 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=f6c09bec97ed8e474a98ae14f9f53e1bcdda33393f20667b6af3fb6bb894ca77 TERMUX_PKG_SRCURL=https://www.cipherdyne.org/fwknop/download/fwknop-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_DEPENDS="gpgme" TERMUX_PKG_BREAKS="fwknop-dev" TERMUX_PKG_REPLACES="fwknop-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-server --with-gpgme --with-gpg=$TERMUX_PREFIX/bin/gpg2 " ================================================ FILE: packages/fzf/bin-fzf-tmux.patch ================================================ diff -u -r ../fzf-0.11.1/bin/fzf-tmux ./bin/fzf-tmux --- ../fzf-0.11.1/bin/fzf-tmux 2015-11-30 10:39:45.000000000 -0500 +++ ./bin/fzf-tmux 2016-01-10 19:11:38.223664557 -0500 @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/bash # fzf-tmux: starts fzf in a tmux pane # usage: fzf-tmux [-u|-d [HEIGHT[%]]] [-l|-r [WIDTH[%]]] [--] [FZF OPTIONS] @@ -91,10 +91,10 @@ # Clean up named pipes on exit id=$RANDOM -argsf="${TMPDIR:-/tmp}/fzf-args-$id" -fifo1="${TMPDIR:-/tmp}/fzf-fifo1-$id" -fifo2="${TMPDIR:-/tmp}/fzf-fifo2-$id" -fifo3="${TMPDIR:-/tmp}/fzf-fifo3-$id" +argsf="${TMPDIR:-@TERMUX_PREFIX@/tmp}/fzf-args-$id" +fifo1="${TMPDIR:-@TERMUX_PREFIX@/tmp}/fzf-fifo1-$id" +fifo2="${TMPDIR:-@TERMUX_PREFIX@/tmp}/fzf-fifo2-$id" +fifo3="${TMPDIR:-@TERMUX_PREFIX@/tmp}/fzf-fifo3-$id" cleanup() { rm -f $argsf $fifo1 $fifo2 $fifo3 } ================================================ FILE: packages/fzf/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/junegunn/fzf TERMUX_PKG_DESCRIPTION="Command-line fuzzy finder" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=0.19.0 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/junegunn/fzf/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=4d7ee0b621287e64ed450d187e5022d906aa378c5390d8c7c1f843417d2f3422 # Depend on findutils as fzf uses the -fstype option, which busybox # find does not support, when invoking find: TERMUX_PKG_DEPENDS="bash, findutils" termux_step_pre_configure() { # Certain packages are not safe to build on device because their # build.sh script deletes specific files in $TERMUX_PREFIX. if $TERMUX_ON_DEVICE_BUILD; then termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds." fi } termux_step_make() { termux_setup_golang export GOPATH=$TERMUX_PKG_BUILDDIR mkdir -p $GOPATH/src/github.com/junegunn mv $TERMUX_PKG_SRCDIR $GOPATH/src/github.com/junegunn/fzf TERMUX_PKG_SRCDIR=$GOPATH/src/github.com/junegunn/fzf cd $GOPATH/src/github.com/junegunn/fzf go get -d -v github.com/junegunn/fzf go build } termux_step_make_install() { cd $GOPATH/src/github.com/junegunn/fzf install -Dm700 fzf $TERMUX_PREFIX/bin/fzf # Install fzf-tmux, a bash script for launching fzf in a tmux pane: install -Dm700 $TERMUX_PKG_SRCDIR/bin/fzf-tmux $TERMUX_PREFIX/bin/fzf-tmux # Install the fzf.1 man page: mkdir -p $TERMUX_PREFIX/share/man/man1/ cp $TERMUX_PKG_SRCDIR/man/man1/fzf.1 $TERMUX_PREFIX/share/man/man1/ # Install bash completion script: mkdir -p $TERMUX_PREFIX/share/bash-completion/completions/ cp $TERMUX_PKG_SRCDIR/shell/completion.bash $TERMUX_PREFIX/share/bash-completion/completions/fzf # Install the rest of the shell scripts: mkdir -p $TERMUX_PREFIX/share/fzf cp $TERMUX_PKG_SRCDIR/shell/* $TERMUX_PREFIX/share/fzf/ # Install the nvim plugin: mkdir -p $TERMUX_PREFIX/share/nvim/runtime/plugin cp $TERMUX_PKG_SRCDIR/plugin/fzf.vim $TERMUX_PREFIX/share/nvim/runtime/plugin/ } ================================================ FILE: packages/game-repo/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/termux/game-packages TERMUX_PKG_DESCRIPTION="Package repository containing games for termux" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_MAINTAINER="Henrik Grimler @Grimler91" TERMUX_PKG_VERSION=1.1 TERMUX_PKG_DEPENDS="termux-keyring" TERMUX_PKG_SKIP_SRC_EXTRACT=true TERMUX_PKG_PLATFORM_INDEPENDENT=true termux_step_make_install() { mkdir -p $TERMUX_PREFIX/etc/apt/sources.list.d echo "deb https://dl.bintray.com/grimler/game-packages-24 games stable" > $TERMUX_PREFIX/etc/apt/sources.list.d/game.list } termux_step_create_debscripts() { echo "#!$TERMUX_PREFIX/bin/sh" > postinst echo "echo Downloading updated package list ..." >> postinst echo "apt update" >> postinst echo "exit 0" >> postinst } ================================================ FILE: packages/gawk/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gawk/ TERMUX_PKG_DESCRIPTION="Programming language designed for text processing" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=5.0.1 TERMUX_PKG_REVISION=4 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gawk/gawk-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=8e4e86f04ed789648b66f757329743a0d6dfb5294c3b91b756a474f1ce05a794 TERMUX_PKG_DEPENDS="libandroid-support, libgmp, libmpfr, readline" TERMUX_PKG_BREAKS="gawk-dev" TERMUX_PKG_REPLACES="gawk-dev" TERMUX_PKG_ESSENTIAL=true TERMUX_PKG_RM_AFTER_INSTALL="bin/gawk-* bin/igawk share/man/man1/igawk.1" termux_step_pre_configure() { # Certain packages are not safe to build on device because their # build.sh script deletes specific files in $TERMUX_PREFIX. if $TERMUX_ON_DEVICE_BUILD; then termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds." fi # Remove old symlink to force a fresh timestamp: rm -f $TERMUX_PREFIX/bin/awk # http://cross-lfs.org/view/CLFS-2.1.0/ppc64-64/temp-system/gawk.html cp -v extension/Makefile.in{,.orig} sed -e 's/check-recursive all-recursive: check-for-shared-lib-support/check-recursive all-recursive:/' extension/Makefile.in.orig > extension/Makefile.in } ================================================ FILE: packages/gawk/io.c.patch ================================================ diff -u -r ../gawk-4.2.1/io.c ./io.c --- ../gawk-4.2.1/io.c 2018-02-19 17:55:00.000000000 +0000 +++ ./io.c 2018-02-27 11:12:19.067766916 +0000 @@ -2025,7 +2025,7 @@ set_sigpipe_to_default(); - execl("/bin/sh", "sh", "-c", command, NULL); + execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", command, NULL); _exit(errno == ENOENT ? 127 : 126); case -1: @@ -2077,7 +2077,7 @@ signal(SIGPIPE, SIG_DFL); - execl("/bin/sh", "sh", "-c", command, NULL); + execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", command, NULL); _exit(errno == ENOENT ? 127 : 126); case -1: @@ -2364,7 +2364,7 @@ /* stderr does NOT get dup'ed onto child's stdout */ #ifdef __EMX__ - pid = spawnl(P_NOWAIT, "/bin/sh", "sh", "-c", str, NULL); + pid = spawnl(P_NOWAIT, "@TERMUX_PREFIX@/bin/sh", "sh", "-c", str, NULL); #else /* __MINGW32__ */ pid = spawnl(P_NOWAIT, getenv("ComSpec"), "cmd.exe", "/c", qcmd = quote_cmd(str), NULL); @@ -2422,7 +2422,7 @@ fatal(_("close of pipe failed (%s)"), strerror(errno)); /* stderr does NOT get dup'ed onto child's stdout */ set_sigpipe_to_default(); - execl("/bin/sh", "sh", "-c", str, NULL); + execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", str, NULL); _exit(errno == ENOENT ? 127 : 126); } #endif /* NOT __EMX__, NOT __MINGW32__ */ @@ -2634,7 +2634,7 @@ os_close_on_exec(save_stdout, cmd, "pipe", "from"); /* saved stdout of the parent process */ #ifdef __EMX__ - pid = spawnl(P_NOWAIT, "/bin/sh", "sh", "-c", cmd, NULL); + pid = spawnl(P_NOWAIT, "@TERMUX_PREFIX@/bin/sh", "sh", "-c", cmd, NULL); #else /* __MINGW32__ */ pid = spawnl(P_NOWAIT, getenv("ComSpec"), "cmd.exe", "/c", qcmd = quote_cmd(cmd), NULL); @@ -2659,7 +2659,7 @@ if (close(p[0]) == -1 || close(p[1]) == -1) fatal(_("close of pipe failed (%s)"), strerror(errno)); set_sigpipe_to_default(); - execl("/bin/sh", "sh", "-c", cmd, NULL); + execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", cmd, NULL); _exit(errno == ENOENT ? 127 : 126); } #endif /* NOT __EMX__, NOT __MINGW32__ */ ================================================ FILE: packages/gawk/main.c.patch ================================================ diff -u -r ../gawk-4.2.1/main.c ./main.c --- ../gawk-4.2.1/main.c 2018-02-23 08:44:11.000000000 +0000 +++ ./main.c 2018-10-28 21:59:28.583118833 +0000 @@ -246,10 +246,12 @@ if ((cp = getenv("GAWK_LOCALE_DIR")) != NULL) locale_dir = cp; -#if defined(F_GETFL) && defined(O_APPEND) +#if defined(F_GETFL) && defined(O_APPEND) && !defined(__ANDROID__) // 1/2018: This is needed on modern BSD systems so that the // inplace tests pass. I think it's a bug in those kernels // but let's just work around it anyway. + // Do not do this for Android as it interferes with SELinux, + // see https://github.com/termux/termux-packages/issues/2979 int flags = fcntl(fileno(stderr), F_GETFL, NULL); if (flags >= 0 && (flags & O_APPEND) == 0) { flags |= O_APPEND; ================================================ FILE: packages/gawk/no_pw_gecos.patch ================================================ diff -u -r ../gawk-4.1.0/awklib/eg/lib/pwcat.c ./awklib/eg/lib/pwcat.c --- ../gawk-4.1.0/awklib/eg/lib/pwcat.c 2013-05-09 15:05:20.000000000 +0200 +++ ./awklib/eg/lib/pwcat.c 2014-02-05 23:33:08.000000000 +0100 @@ -23,6 +23,7 @@ int main(int argc, char **argv) { +#ifndef __ANDROID__ struct passwd *p; while ((p = getpwent()) != NULL) @@ -37,5 +38,6 @@ #endif endpwent(); +#endif return 0; } ================================================ FILE: packages/gawk/stack_index.patch ================================================ diff -u -r ../gawk-4.1.0/extension/stack.c ./extension/stack.c --- ../gawk-4.1.0/extension/stack.c 2013-05-02 21:51:30.000000000 +0200 +++ ./extension/stack.c 2014-02-12 16:54:08.000000000 +0100 @@ -31,14 +31,14 @@ static size_t size; static void **stack; -static int index = -1; +static int stack_index = -1; /* stack_empty --- return true if stack is empty */ int stack_empty() { - return index < 0; + return stack_index < 0; } /* stack_top --- return top object on the stack */ @@ -49,7 +49,7 @@ if (stack_empty() || stack == NULL) return NULL; - return stack[index]; + return stack[stack_index]; } /* stack_pop --- pop top object and return it */ @@ -60,7 +60,7 @@ if (stack_empty() || stack == NULL) return NULL; - return stack[index--]; + return stack[stack_index--]; } /* stack_push --- push an object onto the stack */ @@ -75,7 +75,7 @@ if (stack == NULL) return 0; size = INITIAL_STACK; - } else if (index + 1 >= size) { + } else if (stack_index + 1 >= size) { if (new_size < size) return 0; new_stack = realloc(stack, new_size * sizeof(void *)); @@ -85,6 +85,6 @@ stack = new_stack; } - stack[++index] = object; + stack[++stack_index] = object; return 1; } ================================================ FILE: packages/gbt/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/jtyr/gbt TERMUX_PKG_DESCRIPTION="Highly configurable prompt builder for Bash and ZSH written in Go" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=2.0.0 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/jtyr/gbt/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=b324695dc432e8e22bc257f7a6ec576f482ec418fb9c9a8301f47bfdf7766998 _COMMIT=29dc3dac6c06518073a8e879d2b6ec65291ddab2 termux_step_make_install() { cd $TERMUX_PKG_SRCDIR termux_setup_golang export GOPATH=$HOME/go mkdir -p $GOPATH/{bin,pkg,src/github.com/jtyr} ln -fs $TERMUX_PKG_SRCDIR $GOPATH/src/github.com/jtyr/gbt go build -ldflags="-s -w -X main.version=$TERMUX_PKG_VERSION -X main.build=${_COMMIT::6}" -o $TERMUX_PREFIX/bin/gbt github.com/jtyr/gbt/cmd/gbt mkdir -p $TERMUX_PREFIX/{doc/gbt,share/gbt} cp -r $TERMUX_PKG_SRCDIR/{sources,themes} $TERMUX_PREFIX/share/gbt/ cp -r $TERMUX_PKG_SRCDIR/{LICENSE,README.md} $TERMUX_PREFIX/doc/gbt/ } ================================================ FILE: packages/gcal/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gcal/ TERMUX_PKG_DESCRIPTION="Program for calculating and printing calendars" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=4.1 TERMUX_PKG_REVISION=2 TERMUX_PKG_SHA256=91b56c40b93eee9bda27ec63e95a6316d848e3ee047b5880ed71e5e8e60f61ab TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gcal/gcal-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_DEPENDS="ncurses" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" ac_cv_header_spawn_h=no " termux_step_pre_configure() { # Certain packages are not safe to build on device because their # build.sh script deletes specific files in $TERMUX_PREFIX. if $TERMUX_ON_DEVICE_BUILD; then termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds." fi } termux_step_post_make_install() { # XXX: share/info/dir is currently included in emacs. # We should probably make texinfo regenerate that file # just as the man package does with the man database. rm -f $TERMUX_PREFIX/share/info/dir } ================================================ FILE: packages/gdb/archive_c_st_mtime.patch ================================================ diff -u -r ../gdb-7.6.2/bfd/archive.c ./bfd/archive.c --- ../gdb-7.6.2/bfd/archive.c 2013-12-08 05:33:13.000000000 +0100 +++ ./bfd/archive.c 2014-01-07 16:43:01.858311352 +0100 @@ -1880,7 +1880,7 @@ { /* Assume we just "made" the member, and fake it. */ struct bfd_in_memory *bim = (struct bfd_in_memory *) member->iostream; - time (&status.st_mtime); + time ((time_t*) &status.st_mtime); status.st_uid = getuid (); status.st_gid = getgid (); status.st_mode = 0644; ================================================ FILE: packages/gdb/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gdb/ TERMUX_PKG_DESCRIPTION="The standard GNU Debugger that runs on many Unix-like systems and works for many programming languages" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=8.3.1 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gdb/gdb-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=1e55b4d7cdca7b34be12f4ceae651623aa73b2fd640152313f9f66a7149757c4 TERMUX_PKG_DEPENDS="libc++, liblzma, libexpat, readline, ncurses, libmpfr, zlib" TERMUX_PKG_BREAKS="gdb-dev" TERMUX_PKG_REPLACES="gdb-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --with-system-readline --with-curses ac_cv_func_getpwent=no ac_cv_func_getpwnam=no " TERMUX_PKG_RM_AFTER_INSTALL="share/gdb/python share/gdb/syscalls share/gdb/system-gdbinit" TERMUX_PKG_MAKE_INSTALL_TARGET="-C gdb install" TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { # Fix "undefined reference to 'rpl_gettimeofday'" when building: export gl_cv_func_gettimeofday_clobber=no export gl_cv_func_gettimeofday_posix_signature=yes export gl_cv_func_realpath_works=yes export gl_cv_func_lstat_dereferences_slashed_symlink=yes export gl_cv_func_memchr_works=yes export gl_cv_func_stat_file_slash=yes export gl_cv_func_frexp_no_libm=no export gl_cv_func_strerror_0_works=yes export gl_cv_func_working_strerror=yes export gl_cv_func_getcwd_path_max=yes } ================================================ FILE: packages/gdb/fix-tmp_prefix.patch ================================================ diff -uNr gdb-8.0.1/gdb/compile/compile.c gdb-8.0.1.mod/gdb/compile/compile.c --- gdb-8.0.1/gdb/compile/compile.c 2017-09-07 17:28:11.000000000 +0300 +++ gdb-8.0.1.mod/gdb/compile/compile.c 2017-09-14 13:21:59.592863458 +0300 @@ -44,7 +44,7 @@ /* Initial filename for temporary files. */ -#define TMP_PREFIX "/tmp/gdbobj-" +#define TMP_PREFIX "@TERMUX_PREFIX@/tmp/gdbobj-" /* Hold "compile" commands. */ ================================================ FILE: packages/gdb/gdb-amd64-linux-nat.c.patch ================================================ diff -u -r ../gdb-7.11.1/gdb/amd64-linux-nat.c ./gdb/amd64-linux-nat.c --- ../gdb-7.11.1/gdb/amd64-linux-nat.c 2016-02-09 22:19:39.000000000 -0500 +++ ./gdb/amd64-linux-nat.c 2016-06-17 17:06:35.515474250 -0400 @@ -272,8 +272,10 @@ #endif /* FIXME: ezannoni-2003-07-09 see comment above about include file order. We could be getting bogus values for these two. */ +#ifndef __ANDROID__ gdb_assert (FS < ELF_NGREG); gdb_assert (GS < ELF_NGREG); +#endif switch (idx) { case FS: ================================================ FILE: packages/gdb/gdb-cli-cli-cmds.c.patch ================================================ diff -u -r ../gdb-8.3/gdb/cli/cli-cmds.c ./gdb/cli/cli-cmds.c --- ../gdb-8.3/gdb/cli/cli-cmds.c 2019-05-11 18:19:02.000000000 +0000 +++ ./gdb/cli/cli-cmds.c 2019-05-11 22:43:31.962874247 +0000 @@ -851,7 +851,7 @@ } if ((editor = getenv ("EDITOR")) == NULL) - editor = "/bin/ex"; + editor = "@TERMUX_PREFIX@/bin/applets/vi"; fn = symtab_to_fullname (sal.symtab); ================================================ FILE: packages/gdb/gdb-common-job-control.c.patch ================================================ diff -u -r ../gdb-8.1/gdb/common/job-control.c ./gdb/common/job-control.c --- ../gdb-8.1/gdb/common/job-control.c 2018-01-05 05:07:23.000000000 +0100 +++ ./gdb/common/job-control.c 2018-02-01 21:19:44.732858138 +0100 @@ -45,10 +45,7 @@ if (job_control) { #ifdef HAVE_SETPGID - /* The call setpgid (0, 0) is supposed to work and mean the same - thing as this, but on Ultrix 4.2A it fails with EPERM (and - setpgid (getpid (), getpid ()) succeeds). */ - retval = setpgid (getpid (), getpid ()); + retval = setpgid (0, 0); #else #ifdef HAVE_SETPGRP #ifdef SETPGRP_VOID ================================================ FILE: packages/gdb/gdb-common-pathstuff.c.patch ================================================ diff -u -r ../gdb-8.3/gdb/common/pathstuff.c ./gdb/common/pathstuff.c --- ../gdb-8.3/gdb/common/pathstuff.c 2019-02-27 04:51:50.000000000 +0000 +++ ./gdb/common/pathstuff.c 2019-05-11 22:45:37.765420769 +0000 @@ -262,7 +262,7 @@ if (tmp != nullptr) return tmp; - return "/tmp"; + return "@TERMUX_PREFIX@/tmp"; #endif } @@ -273,7 +273,7 @@ { const char *ret = getenv ("SHELL"); if (ret == NULL) - ret = "/bin/sh"; + ret = "@TERMUX_PREFIX@/bin/bash"; return ret; } ================================================ FILE: packages/gdb/gdb-common-signals-state-save-restore.c.patch ================================================ diff -u -r ../gdb-8.1/gdb/common/signals-state-save-restore.c ./gdb/common/signals-state-save-restore.c --- ../gdb-8.1/gdb/common/signals-state-save-restore.c 2018-01-31 03:58:50.000000000 +0100 +++ ./gdb/common/signals-state-save-restore.c 2018-02-01 21:38:47.791540495 +0100 @@ -69,6 +69,7 @@ && oldact->sa_handler != SIG_DFL && oldact->sa_handler != SIG_IGN) { +#ifndef __ANDROID__ found_preinstalled = true; /* Use raw fprintf here because we're being called in early @@ -78,6 +79,7 @@ _("warning: Found custom handler for signal " "%d (%s) preinstalled.\n"), i, strsignal (i)); +#endif } } ================================================ FILE: packages/gdb/gdb-gdbserver-configure.patch ================================================ diff -u -r ../gdb-7.11/gdb/gdbserver/configure ./gdb/gdbserver/configure --- ../gdb-7.11/gdb/gdbserver/configure 2016-02-09 22:19:39.000000000 -0500 +++ ./gdb/gdbserver/configure 2016-03-10 10:17:40.111988028 -0500 @@ -6735,17 +6735,6 @@ case "${target}" in - *-android*) - # Starting with NDK version 9, actually includes definitions - # of Elf32_auxv_t and Elf64_auxv_t. But sadly, includes - # which defines some of the ELF types incorrectly, - # leading to conflicts with the defintions from . - # This makes it impossible for us to include both and - # , which means that, in practice, we do not have - # access to Elf32_auxv_t and Elf64_auxv_t on this platform. - # Therefore, do not try to auto-detect availability, as it would - # get it wrong on this platform. - ;; *) ac_fn_c_check_type "$LINENO" "Elf32_auxv_t" "ac_cv_type_Elf32_auxv_t" "#include ================================================ FILE: packages/gdb/gdb-gnulib-import-string.in.h.patch ================================================ diff -u -r ../gdb-8.1/gdb/gnulib/import/string.in.h ./gdb/gnulib/import/string.in.h --- ../gdb-8.1/gdb/gnulib/import/string.in.h 2017-06-04 17:51:26.000000000 +0200 +++ ./gdb/gnulib/import/string.in.h 2018-02-01 22:09:38.398023253 +0100 @@ -183,9 +183,8 @@ #if @GNULIB_MEMPCPY@ # if ! @HAVE_MEMPCPY@ _GL_FUNCDECL_SYS (mempcpy, void *, - (void *restrict __dest, void const *restrict __src, - size_t __n) - _GL_ARG_NONNULL ((1, 2))); + (void * __dest, void const * __src, + size_t __n)); # endif _GL_CXXALIAS_SYS (mempcpy, void *, (void *restrict __dest, void const *restrict __src, ================================================ FILE: packages/gdb/gdb-ser-pipe.c.patch ================================================ diff -u -r ../gdb-8.1/gdb/ser-pipe.c ./gdb/ser-pipe.c --- ../gdb-8.1/gdb/ser-pipe.c 2018-01-05 04:07:23.000000000 +0000 +++ ./gdb/ser-pipe.c 2018-01-31 22:21:26.902931647 +0000 @@ -122,7 +122,7 @@ } close_most_fds (); - execl ("/bin/sh", "sh", "-c", name, (char *) 0); + execl ("@TERMUX_PREFIX@/bin/sh", "sh", "-c", name, (char *) 0); _exit (127); } ================================================ FILE: packages/gdb/gdb-solib.c.patch ================================================ diff -u -r ../gdb-7.10.1/gdb/solib.c ./gdb/solib.c --- ../gdb-7.10.1/gdb/solib.c 2015-12-05 10:16:45.000000000 -0500 +++ ./gdb/solib.c 2016-02-07 17:29:11.431584611 -0500 @@ -1703,6 +1703,16 @@ add_alias_cmd ("solib-absolute-prefix", "sysroot", class_support, 0, &showlist); +#ifdef __ANDROID__ + /* Termux modification to find system shared libraries. */ + solib_search_path = +# ifdef __LP64__ + "/system/lib64:/system/vendor/lib64"; +# else + "/system/lib:/system/vendor/lib"; +# endif +#endif + add_setshow_optional_filename_cmd ("solib-search-path", class_support, &solib_search_path, _("\ Set the search path for loading non-absolute shared library symbol files."), ================================================ FILE: packages/gdb/gregset.h.patch ================================================ diff -u -r ../gdb-7.8.1/gdb/gregset.h ./gdb/gregset.h --- ../gdb-7.8.1/gdb/gregset.h 2014-06-11 12:34:41.000000000 -0400 +++ ./gdb/gregset.h 2014-12-22 07:09:39.011700414 -0500 @@ -23,13 +23,7 @@ #include #endif -#ifndef GDB_GREGSET_T -#define GDB_GREGSET_T gregset_t -#endif - -#ifndef GDB_FPREGSET_T -#define GDB_FPREGSET_T fpregset_t -#endif +#include "nm.h" typedef GDB_GREGSET_T gdb_gregset_t; typedef GDB_FPREGSET_T gdb_fpregset_t; ================================================ FILE: packages/gdb/linux_thread_db_no_th_unique.patch ================================================ diff -u -r ../gdb-7.6.2/gdb/linux-thread-db.c ./gdb/linux-thread-db.c --- ../gdb-7.6.2/gdb/linux-thread-db.c 2013-12-08 05:33:13.000000000 +0100 +++ ./gdb/linux-thread-db.c 2014-01-07 16:43:01.866311352 +0100 @@ -447,9 +447,6 @@ struct thread_db_info *info; struct thread_get_info_inout io = {0}; - /* Just in case td_ta_map_lwp2thr doesn't initialize it completely. */ - th.th_unique = 0; - /* This ptid comes from linux-nat.c, which should always fill in the LWP. */ gdb_assert (GET_LWP (ptid) != 0); ================================================ FILE: packages/gdb/readline-histlib.h.patch.debug ================================================ --- ./readline/histlib.h 2017-06-04 15:51:27.000000000 +0000 +++ ../histlib.h 2018-03-21 15:09:37.286670845 +0000 @@ -52,7 +52,7 @@ #ifndef member # ifndef strchr -extern char *strchr (); +extern char __attribute__((overloadable)) *strchr (); # endif #define member(c, s) ((c) ? ((char *)strchr ((s), (c)) != (char *)NULL) : 0) #endif ================================================ FILE: packages/gdb/readline.patch ================================================ diff -u -r ../gdb-7.6.2/readline/complete.c ./readline/complete.c --- ../gdb-7.6.2/readline/complete.c 2013-12-08 05:11:52.000000000 +0100 +++ ./readline/complete.c 2014-01-07 16:43:59.170309785 +0100 @@ -2026,7 +2026,7 @@ const char *text; int state; { -#if defined (__WIN32__) || defined (__OPENNT) +#if defined (__WIN32__) || defined (__OPENNT) || defined (__ANDROID__) return (char *)NULL; #else /* !__WIN32__ && !__OPENNT) */ static char *username = (char *)NULL; ================================================ FILE: packages/gdbm/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org.ua/software/gdbm/ TERMUX_PKG_DESCRIPTION="Library of database functions that use extensible hashing" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=1.18.1 TERMUX_PKG_REVISION=2 TERMUX_PKG_SHA256=86e613527e5dba544e73208f42b78b7c022d4fa5a6d5498bf18c8d6f745b91dc TERMUX_PKG_BREAKS="gdbm-dev" TERMUX_PKG_REPLACES="gdbm-dev" TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gdbm/gdbm-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--without-readline --enable-libgdbm-compat" ================================================ FILE: packages/gdbm/termios_h.patch ================================================ diff -r -u ../gdbm-1.10.90/src/gdbmtool.c ./src/gdbmtool.c --- ../gdbm-1.10.90/src/gdbmtool.c 2013-05-16 22:22:16.000000000 +0200 +++ ./src/gdbmtool.c 2014-02-04 03:38:54.000000000 +0100 @@ -24,9 +24,7 @@ #include #include #include -#ifdef HAVE_SYS_TERMIOS_H -# include -#endif +#include #include #ifdef HAVE_LOCALE_H # include ================================================ FILE: packages/gdk-pixbuf/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://developer.gnome.org/gdk-pixbuf/ TERMUX_PKG_DESCRIPTION="Library for image loading and manipulation" TERMUX_PKG_LICENSE="LGPL-2.1" TERMUX_PKG_VERSION=2.40.0 TERMUX_PKG_SRCURL=ftp://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/${TERMUX_PKG_VERSION:0:4}/gdk-pixbuf-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=1582595099537ca8ff3b99c6804350b4c058bb8ad67411bbaae024ee7cead4e6 TERMUX_PKG_DEPENDS="glib, libpng, libtiff, libjpeg-turbo" TERMUX_PKG_BREAKS="gdk-pixbuf-dev" TERMUX_PKG_REPLACES="gdk-pixbuf-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -Dgio_sniffing=false -Dgir=false -Dx11=false " ================================================ FILE: packages/gegl/6bcf95fd0f32cf5e8b1ddbe17b14d9ad049bded8.patch ================================================ From 6bcf95fd0f32cf5e8b1ddbe17b14d9ad049bded8 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 27 Oct 2019 14:10:08 +0100 Subject: [PATCH] meson: fix cpu detection Use host_machine.cpu_family() instead of cpu(). Only the former provides a stable/defined set of values. Also don't error out on some arches for no good reason. This fixes the build on 32bit Windows. --- meson.build | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index af133a0f1..540498921 100644 --- a/meson.build +++ b/meson.build @@ -73,23 +73,21 @@ if os_osx and cc.get_id() != 'clang' endif -host_cpu = host_machine.cpu() -if host_cpu.startswith('i') and host_cpu.endswith('86') +host_cpu_family = host_machine.cpu_family() +if host_cpu_family == 'x86' have_x86 = true config.set10('ARCH_X86', true) -elif host_cpu == 'x86_64' +elif host_cpu_family == 'x86_64' have_x86 = true config.set10('ARCH_X86', true) config.set10('ARCH_X86_64', true) -elif host_cpu == 'ppc' or host_cpu == 'powerpc' +elif host_cpu_family == 'ppc' have_ppc = true config.set10('ARCH_PPC', true) -elif host_cpu == 'ppc64' or host_cpu == 'powerpc64' +elif host_cpu_family == 'ppc64' have_ppc = true config.set10('ARCH_PPC', true) config.set10('ARCH_PPC64', true) -else - error('Unknown host architecture') endif ################################################################################ ================================================ FILE: packages/gegl/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://gegl.org/ TERMUX_PKG_DESCRIPTION="Data flow based image processing framework" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=0.4.18 TERMUX_PKG_SRCURL=https://download.gimp.org/pub/gegl/${TERMUX_PKG_VERSION:0:3}/gegl-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=c946dfb45beb7fe0fb95b89a25395b449eda2b205ba3e8a1ffb1ef992d9eca64 TERMUX_PKG_DEPENDS="libandroid-support, libc++, ffmpeg, babl, json-glib, libjpeg-turbo, libpng, libjasper, littlecms, libtiff, librsvg, zlib" TERMUX_PKG_BREAKS="gegl-dev" TERMUX_PKG_REPLACES="gegl-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-Dintrospection=false" ================================================ FILE: packages/geoip2-database/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://dev.maxmind.com/geoip/geoip2/geolite2/ TERMUX_PKG_DESCRIPTION="GeoLite2 IP geolocation databases compiled by MaxMind" TERMUX_PKG_LICENSE="CC0-1.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_PLATFORM_INDEPENDENT=true TERMUX_PKG_BUILD_IN_SRC=true # MaxMind removed databases from public access: # https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/ # Reusing files from the our last build (2019.12.21). TERMUX_PKG_VERSION=20191221 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://dl.bintray.com/xeffyr/sources/geoip2-database/geolite2-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=7afd73d90325d4a8aa3707c0c4a34f89a4b469fe43b4f3a3d69da23884af1e70 termux_step_make_install() { install -Dm600 \ -t "$TERMUX_PREFIX"/share/GeoIP/ \ "${TERMUX_PKG_SRCDIR}"/GeoLite2-{ASN,Country,City}.mmdb } ================================================ FILE: packages/getconf/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/termux/getconf TERMUX_PKG_DESCRIPTION="Utility to print configuration values" TERMUX_PKG_LICENSE="BSD 2-Clause" TERMUX_PKG_VERSION=0.5 TERMUX_PKG_SHA256=8192701051d2a2bf8d1ae7b1c0922c3f1d4a039b9ad99496636b0122667d595c TERMUX_PKG_SRCURL=https://github.com/termux/getconf/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/geth/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://geth.ethereum.org/ TERMUX_PKG_DESCRIPTION="Go implementation of the Ethereum protocol" TERMUX_PKG_LICENSE="LGPL-3.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.9.6 TERMUX_PKG_SRCURL=https://github.com/ethereum/go-ethereum/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=3000f787735ee302088d17d406eafc2ec26eaffc083d876b2fa07ec7dfbb94f9 termux_step_make() { termux_setup_golang export GOPATH=$TERMUX_PKG_BUILDDIR mkdir -p "$GOPATH"/src/github.com/ethereum ln -sf "$TERMUX_PKG_SRCDIR" "$GOPATH"/src/github.com/ethereum/go-ethereum cd "$GOPATH"/src/github.com/ethereum/go-ethereum for applet in geth abigen bootnode ethkey evm rlpdump puppeth; do (cd ./cmd/"$applet" && go build -v) done unset applet } termux_step_make_install() { for applet in geth abigen bootnode ethkey evm rlpdump puppeth; do install -Dm700 \ "$TERMUX_PKG_SRCDIR/cmd/$applet/$applet" \ "$TERMUX_PREFIX"/bin/ done unset applet } ================================================ FILE: packages/geth/fix-names-conflict.patch ================================================ --- go-ethereum-1.8.23/vendor/github.com/karalabe/usb/hidapi/libusb/hid.c 2019-02-20 10:48:12.000000000 +0200 +++ go-ethereum-1.8.23.mod/vendor/github.com/karalabe/usb/hidapi/libusb/hid.c 2019-04-10 12:56:56.087538378 +0300 @@ -60,9 +60,9 @@ pthread_cond_t cond; int count; int trip_count; -} pthread_barrier_t; +} _pthread_barrier_t; -static int pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count) +static int _pthread_barrier_init(_pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count) { if(count == 0) { errno = EINVAL; @@ -82,14 +82,14 @@ return 0; } -static int pthread_barrier_destroy(pthread_barrier_t *barrier) +static int _pthread_barrier_destroy(_pthread_barrier_t *barrier) { pthread_cond_destroy(&barrier->cond); pthread_mutex_destroy(&barrier->mutex); return 0; } -static int pthread_barrier_wait(pthread_barrier_t *barrier) +static int _pthread_barrier_wait(_pthread_barrier_t *barrier) { pthread_mutex_lock(&barrier->mutex); ++(barrier->count); @@ -164,7 +164,7 @@ pthread_t thread; pthread_mutex_t mutex; /* Protects input_reports */ pthread_cond_t condition; - pthread_barrier_t barrier; /* Ensures correct startup sequence */ + _pthread_barrier_t barrier; /* Ensures correct startup sequence */ int shutdown_thread; int cancelled; struct libusb_transfer *transfer; @@ -185,7 +185,7 @@ pthread_mutex_init(&dev->mutex, NULL); pthread_cond_init(&dev->condition, NULL); - pthread_barrier_init(&dev->barrier, NULL, 2); + _pthread_barrier_init(&dev->barrier, NULL, 2); return dev; } @@ -193,7 +193,7 @@ static void free_hid_device(hid_device *dev) { /* Clean up the thread objects */ - pthread_barrier_destroy(&dev->barrier); + _pthread_barrier_destroy(&dev->barrier); pthread_cond_destroy(&dev->condition); pthread_mutex_destroy(&dev->mutex); @@ -817,7 +817,7 @@ libusb_submit_transfer(dev->transfer); /* Notify the main thread that the read thread is up and running. */ - pthread_barrier_wait(&dev->barrier); + _pthread_barrier_wait(&dev->barrier); /* Handle all the events. */ while (!dev->shutdown_thread) { @@ -973,7 +973,7 @@ pthread_create(&dev->thread, NULL, read_thread, dev); /* Wait here for the read thread to be initialized. */ - pthread_barrier_wait(&dev->barrier); + _pthread_barrier_wait(&dev->barrier); } free(dev_path); ================================================ FILE: packages/geth/geth-utils.subpackage.sh ================================================ TERMUX_SUBPKG_DESCRIPTION="Additional utilities for Geth (like abigen, bootnode, evm, puppeth)" TERMUX_SUBPKG_INCLUDE=" bin/abigen bin/bootnode bin/ethkey bin/evm bin/rlpdump bin/swarm bin/puppeth" ================================================ FILE: packages/getmail/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://pyropus.ca/software/getmail/ TERMUX_PKG_DESCRIPTION="fetchmail replacement relatively easy to configure" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=5.14 TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/getmail-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=f3a99fe74564237d12ca8d4582e113c067c9205b5ab640f72b4e8447606a99c1 TERMUX_PKG_DEPENDS="python2" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_PLATFORM_INDEPENDENT=true termux_step_make_install() { python2 setup.py install --prefix=$TERMUX_PREFIX --force } termux_step_post_massage() { find . -path '*.pyc' -delete } ================================================ FILE: packages/getmail/utilities.py.patch ================================================ diff -u -r ../getmail-5.1/getmailcore/utilities.py ./getmailcore/utilities.py --- ../getmail-5.1/getmailcore/utilities.py 2017-07-16 05:26:01.000000000 +0200 +++ ./getmailcore/utilities.py 2017-07-26 13:36:30.196152312 +0200 @@ -47,6 +47,7 @@ import sys import tempfile import errno +import shutil try: import subprocess except ImportError, o: @@ -340,7 +341,7 @@ # Move message file from Maildir/tmp to Maildir/new try: - os.link(fname_tmp, fname_new) + shutil.copy2(fname_tmp, fname_new) os.unlink(fname_tmp) except OSError: ================================================ FILE: packages/gettext/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gettext/ TERMUX_PKG_DESCRIPTION="GNU Internationalization utilities" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=0.20.1 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gettext/gettext-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=53f02fbbec9e798b0faaf7c73272f83608e835c6288dd58be6c9bb54624a3800 TERMUX_PKG_DEPENDS="libc++, libiconv, pcre, liblzma, libxml2, libcroco, ncurses, libunistring, zlib" TERMUX_PKG_BREAKS="gettext-dev" TERMUX_PKG_REPLACES="gettext-dev" TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { autoreconf } ================================================ FILE: packages/gettext/gnulib-libmakefile.am.patch ================================================ diff -uNr gettext-0.20.1/gettext-tools/gnulib-lib/Makefile.am gettext-0.20.1.mod/gettext-tools/gnulib-lib/Makefile.am --- gettext-0.20.1/gettext-tools/gnulib-lib/Makefile.am 2019-04-11 12:22:44.000000000 +0300 +++ gettext-0.20.1.mod/gettext-tools/gnulib-lib/Makefile.am 2019-05-21 15:02:52.740488355 +0300 @@ -73,10 +73,11 @@ RELOCATABLE_LIBRARY_PATH = $(libdir) # Linking with C++ libraries is needed _only_ on mingw and Cygwin. +# .. termux edit because i can't be bothered fixing it properly. if !WOE32DLL libgettextlib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ - $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(libgettextlib_la_LDFLAGS) $(LDFLAGS) \ + $(CCLD) $(AM_CFLAGS) $(CFLAGS) -lcroco-0.6 -lglib-2.0 -landroid-support -lpcre -lxml2 -lz -llzma -lm -lncurses -lunistring -liconv $(LDFLAGS) \ -o $@ else libgettextlib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ ================================================ FILE: packages/gettext/msginit.c.patch ================================================ diff -uNr gettext-0.20.1/gettext-tools/src/msginit.c gettext-0.20.1.mod/gettext-tools/src/msginit.c --- gettext-0.20.1/gettext-tools/src/msginit.c 2019-05-12 00:11:31.000000000 +0300 +++ gettext-0.20.1.mod/gettext-tools/src/msginit.c 2019-05-21 15:05:49.363213216 +0300 @@ -1136,6 +1136,7 @@ static const char * get_user_fullname () { +#ifndef __ANDROID__ #if HAVE_PWD_H struct passwd *pwd; @@ -1159,7 +1160,7 @@ return result; } #endif - +#endif return NULL; } ================================================ FILE: packages/gflags/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/gflags/gflags TERMUX_PKG_DESCRIPTION="A C++ library that implements commandline flags processing" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=2.2.2 TERMUX_PKG_REVISION=6 TERMUX_PKG_SRCURL=https://github.com/gflags/gflags/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf TERMUX_PKG_DEPENDS="libc++" TERMUX_PKG_BREAKS="gflags-dev" TERMUX_PKG_REPLACES="gflags-dev" TERMUX_PKG_FORCE_CMAKE=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_LIBS=ON -DINSTALL_HEADERS=ON " termux_step_post_make_install() { #Any old packages using the library name of libgflags ln -sfr "$TERMUX_PREFIX"/lib/pkgconfig/gflags.pc \ "$TERMUX_PREFIX"/lib/pkgconfig/libgflags.pc } ================================================ FILE: packages/ghostscript/arch-aarch64.h ================================================ /* Parameters derived from machine and compiler architecture. */ /* This file is generated mechanically by genarch.c. */ /* ---------------- Scalar alignments ---------------- */ #define ARCH_ALIGN_SHORT_MOD 2 #define ARCH_ALIGN_INT_MOD 4 #define ARCH_ALIGN_LONG_MOD 8 #define ARCH_ALIGN_PTR_MOD 8 #define ARCH_ALIGN_FLOAT_MOD 4 #define ARCH_ALIGN_DOUBLE_MOD 8 /* ---------------- Scalar sizes ---------------- */ #define ARCH_LOG2_SIZEOF_CHAR 0 #define ARCH_LOG2_SIZEOF_SHORT 1 #define ARCH_LOG2_SIZEOF_INT 2 #define ARCH_LOG2_SIZEOF_LONG 3 #define ARCH_LOG2_SIZEOF_LONG_LONG 3 #define ARCH_SIZEOF_GX_COLOR_INDEX 8 #define ARCH_SIZEOF_PTR 8 #define ARCH_SIZEOF_FLOAT 4 #define ARCH_SIZEOF_DOUBLE 8 #define ARCH_FLOAT_MANTISSA_BITS 24 #define ARCH_DOUBLE_MANTISSA_BITS 53 /* ---------------- Unsigned max values ---------------- */ #define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) #define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) #define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) #define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) /* ---------------- Miscellaneous ---------------- */ #define ARCH_IS_BIG_ENDIAN 0 #define ARCH_PTRS_ARE_SIGNED 0 #define ARCH_FLOATS_ARE_IEEE 1 #define ARCH_ARITH_RSHIFT 2 #define ARCH_DIV_NEG_POS_TRUNCATES 1 ================================================ FILE: packages/ghostscript/arch-arm.h ================================================ /* Parameters derived from machine and compiler architecture. */ /* This file is generated mechanically by genarch.c. */ /* ---------------- Scalar alignments ---------------- */ #define ARCH_ALIGN_SHORT_MOD 2 #define ARCH_ALIGN_INT_MOD 4 #define ARCH_ALIGN_LONG_MOD 4 #define ARCH_ALIGN_PTR_MOD 4 #define ARCH_ALIGN_FLOAT_MOD 4 #define ARCH_ALIGN_DOUBLE_MOD 8 /* ---------------- Scalar sizes ---------------- */ #define ARCH_LOG2_SIZEOF_CHAR 0 #define ARCH_LOG2_SIZEOF_SHORT 1 #define ARCH_LOG2_SIZEOF_INT 2 #define ARCH_LOG2_SIZEOF_LONG 2 #define ARCH_LOG2_SIZEOF_LONG_LONG 3 #define ARCH_SIZEOF_GX_COLOR_INDEX 8 #define ARCH_SIZEOF_PTR 4 #define ARCH_SIZEOF_FLOAT 4 #define ARCH_SIZEOF_DOUBLE 8 #define ARCH_FLOAT_MANTISSA_BITS 24 #define ARCH_DOUBLE_MANTISSA_BITS 53 /* ---------------- Unsigned max values ---------------- */ #define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) #define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) #define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) #define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) /* ---------------- Miscellaneous ---------------- */ #define ARCH_IS_BIG_ENDIAN 0 #define ARCH_PTRS_ARE_SIGNED 0 #define ARCH_FLOATS_ARE_IEEE 1 #define ARCH_ARITH_RSHIFT 2 #define ARCH_DIV_NEG_POS_TRUNCATES 1 ================================================ FILE: packages/ghostscript/arch-i686.h ================================================ /* Parameters derived from machine and compiler architecture. */ /* This file is generated mechanically by genarch.c. */ /* ---------------- Scalar alignments ---------------- */ #define ARCH_ALIGN_SHORT_MOD 2 #define ARCH_ALIGN_INT_MOD 4 #define ARCH_ALIGN_LONG_MOD 4 #define ARCH_ALIGN_PTR_MOD 4 #define ARCH_ALIGN_FLOAT_MOD 4 #define ARCH_ALIGN_DOUBLE_MOD 4 /* ---------------- Scalar sizes ---------------- */ #define ARCH_LOG2_SIZEOF_CHAR 0 #define ARCH_LOG2_SIZEOF_SHORT 1 #define ARCH_LOG2_SIZEOF_INT 2 #define ARCH_LOG2_SIZEOF_LONG 2 #define ARCH_LOG2_SIZEOF_LONG_LONG 3 #define ARCH_SIZEOF_GX_COLOR_INDEX 8 #define ARCH_SIZEOF_PTR 4 #define ARCH_SIZEOF_FLOAT 4 #define ARCH_SIZEOF_DOUBLE 8 #define ARCH_FLOAT_MANTISSA_BITS 24 #define ARCH_DOUBLE_MANTISSA_BITS 53 /* ---------------- Unsigned max values ---------------- */ #define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) #define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) #define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) #define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) /* ---------------- Miscellaneous ---------------- */ #define ARCH_IS_BIG_ENDIAN 0 #define ARCH_PTRS_ARE_SIGNED 0 #define ARCH_FLOATS_ARE_IEEE 1 #define ARCH_ARITH_RSHIFT 2 #define ARCH_DIV_NEG_POS_TRUNCATES 1 ================================================ FILE: packages/ghostscript/arch-x86_64.h ================================================ /* Parameters derived from machine and compiler architecture. */ /* This file is generated mechanically by genarch.c. */ /* ---------------- Scalar alignments ---------------- */ #define ARCH_ALIGN_SHORT_MOD 2 #define ARCH_ALIGN_INT_MOD 4 #define ARCH_ALIGN_LONG_MOD 8 #define ARCH_ALIGN_PTR_MOD 8 #define ARCH_ALIGN_FLOAT_MOD 4 #define ARCH_ALIGN_DOUBLE_MOD 8 /* ---------------- Scalar sizes ---------------- */ #define ARCH_LOG2_SIZEOF_CHAR 0 #define ARCH_LOG2_SIZEOF_SHORT 1 #define ARCH_LOG2_SIZEOF_INT 2 #define ARCH_LOG2_SIZEOF_LONG 3 #define ARCH_LOG2_SIZEOF_LONG_LONG 3 #define ARCH_SIZEOF_GX_COLOR_INDEX 8 #define ARCH_SIZEOF_PTR 8 #define ARCH_SIZEOF_FLOAT 4 #define ARCH_SIZEOF_DOUBLE 8 #define ARCH_FLOAT_MANTISSA_BITS 24 #define ARCH_DOUBLE_MANTISSA_BITS 53 /* ---------------- Unsigned max values ---------------- */ #define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) #define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) #define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) #define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) /* ---------------- Miscellaneous ---------------- */ #define ARCH_IS_BIG_ENDIAN 0 #define ARCH_PTRS_ARE_SIGNED 0 #define ARCH_FLOATS_ARE_IEEE 1 #define ARCH_ARITH_RSHIFT 2 #define ARCH_DIV_NEG_POS_TRUNCATES 1 ================================================ FILE: packages/ghostscript/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.ghostscript.com/ TERMUX_PKG_DESCRIPTION="Interpreter for the PostScript language and for PDF" TERMUX_PKG_LICENSE="AGPL-V3" TERMUX_PKG_VERSION=9.50 TERMUX_PKG_SHA256=dd94c5a06c03c58b47b929d03260f491d4807eaf5be83abd283278927b11c9ee TERMUX_PKG_SRCURL=https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${TERMUX_PKG_VERSION//.}/ghostpdl-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="libandroid-support, libiconv, libtiff, libjpeg-turbo, libpng, libexpat, freetype, fontconfig, libidn, littlecms, openjpeg" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" ac_cv_lib_lcms2__cmsCreateMutex=yes CCAUX=gcc --build=$TERMUX_BUILD_TUPLE --enable-little-endian --with-arch_h=$TERMUX_PKG_BUILDER_DIR/arch-${TERMUX_ARCH}.h --without-pcl --without-x --with-system-libtiff " termux_step_post_extract_package() { rm -rdf $TERMUX_PKG_SRCDIR/{jpeg,libpng,expat,jasper,freetype,lcms2,tiff,openjpeg} } termux_step_pre_configure() { # Use `make -j1` otherwise build may fail with error # about missing 'arch.h'. TERMUX_MAKE_PROCESSES=1 } ================================================ FILE: packages/ghostscript/configure.patch ================================================ --- ./configure 2017-03-16 10:12:59.000000000 +0000 +++ ./configure 2017-03-18 15:14:30.363309054 +0000 @@ -3772,7 +3772,7 @@ echo $AUXFLAGS_MAK_LINE06 >> $AUXFLAGS_MAK.in echo $AUXFLAGS_MAK_LINE07 >> $AUXFLAGS_MAK.in - ../$0 CC="$CCAUX" CFLAGS="$CFLAGSAUX" LDFLAGS="$LDFLAGSAUX" CCAUX= CFLAGSAUX= CFLAGSAUX= MAKEFILE=$AUXFLAGS_MAK --host= --build= --without-libtiff --disable-contrib --disable-fontconfig --disable-dbus --disable-freetype --disable-fapi --disable-cups --disable-openjpeg --disable-gtk --with-libiconv=no --without-libidn --without-libpaper --without-pdftoraster --without-ijs --without-luratech --without-jbig2dec --without-x --with-drivers="" + $0 CC="$CCAUX" CFLAGS="$CFLAGSAUX" LDFLAGS="$LDFLAGSAUX" CCAUX= CFLAGSAUX= CFLAGSAUX= MAKEFILE=$AUXFLAGS_MAK --host= --build= --without-libtiff --disable-contrib --disable-fontconfig --disable-dbus --disable-freetype --disable-fapi --disable-cups --disable-openjpeg --disable-gtk --with-libiconv=no --without-libidn --without-libpaper --without-pdftoraster --without-ijs --without-luratech --without-jbig2dec --without-x --with-drivers="" status=$? cp config.log ../configaux.log if test $status -eq 0 ; then ================================================ FILE: packages/ghostscript/gserrors.h.patch ================================================ --- ./base/gserrors.h 2017-03-16 09:20:11.000000000 +0000 +++ ./base/gserrors.h 2017-03-18 21:02:46.586737629 +0000 @@ -148,14 +148,13 @@ * */ -#ifndef __printflike +/* Redefine cdefs.h's __printflike function: */ #if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7 #define __printflike(fmtarg, firstvararg) \ __attribute__((__format__ (__printf__, fmtarg, firstvararg))) #else #define __printflike(fmtarg, firstvararg) #endif -#endif const char *gs_errstr(int code); ================================================ FILE: packages/giflib/Makefile.patch ================================================ diff -u -r ../giflib-5.1.9/Makefile ./Makefile --- ../giflib-5.1.9/Makefile 2019-03-28 18:57:23.000000000 +0000 +++ ./Makefile 2019-03-29 22:55:30.125971028 +0000 @@ -14,7 +14,7 @@ TAR = tar INSTALL = install -PREFIX = /usr/local +PREFIX ?= /usr/local BINDIR = $(PREFIX)/bin INCDIR = $(PREFIX)/include LIBDIR = $(PREFIX)/lib ================================================ FILE: packages/giflib/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://sourceforge.net/projects/giflib/ TERMUX_PKG_DESCRIPTION="A library for reading and writing gif images" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=5.2.1 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=31da5562f44c5f15d63340a09a4fd62b48c45620cd302f77a6d9acf0077879bd TERMUX_PKG_BREAKS="giflib-dev" TERMUX_PKG_REPLACES="giflib-dev" TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/giflib-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/giflib/giflib-utils.subpackage.sh ================================================ TERMUX_SUBPKG_DESCRIPTION="A set of utilities that comes with giflib package" TERMUX_SUBPKG_CONFLICTS="giflib (<< 5.1.4-4)" TERMUX_SUBPKG_INCLUDE=" bin/ share/man/" ================================================ FILE: packages/gifsicle/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.lcdf.org/gifsicle/ TERMUX_PKG_DESCRIPTION="Tool for creating, editing, and getting information about GIF images and animations" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.92 TERMUX_PKG_SHA256=5ab556c01d65fddf980749e3ccf50b7fd40de738b6df679999294cc5fabfce65 TERMUX_PKG_SRCURL=https://www.lcdf.org/gifsicle/gifsicle-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-gifview" ================================================ FILE: packages/git/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://git-scm.com/ TERMUX_PKG_DESCRIPTION="Fast, scalable, distributed revision control system" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.24.0 TERMUX_PKG_SRCURL=https://www.kernel.org/pub/software/scm/git/git-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=9f71d61973626d8b28c4cdf8e2484b4bf13870ed643fed982d68b2cfd754371b # less is required as a pager for git log, and the busybox less does not handle used escape sequences. TERMUX_PKG_DEPENDS="libcurl, libiconv, less, openssl, pcre2, zlib" ## This requires a working $TERMUX_PREFIX/bin/sh on the host building: TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" ac_cv_fread_reads_directories=yes ac_cv_header_libintl_h=no ac_cv_snprintf_returns_bogus=no --with-curl --without-tcltk --with-shell=$TERMUX_PREFIX/bin/sh " # expat is only used by git-http-push for remote lock management over DAV, so disable: # NO_INSTALL_HARDLINKS to use symlinks instead of hardlinks (which does not work on Android M): TERMUX_PKG_EXTRA_MAKE_ARGS=" NO_NSEC=1 NO_GETTEXT=1 NO_EXPAT=1 NO_INSTALL_HARDLINKS=1 PERL_PATH=$TERMUX_PREFIX/bin/perl USE_LIBPCRE2=1 " TERMUX_PKG_BUILD_IN_SRC=true # Things to remove to save space: # bin/git-cvsserver - server emulating CVS # bin/git-shell - restricted login shell for Git-only SSH access TERMUX_PKG_RM_AFTER_INSTALL=" bin/git-cvsserver bin/git-shell libexec/git-core/git-shell libexec/git-core/git-cvsserver share/man/man1/git-cvsserver.1 share/man/man1/git-shell.1 " termux_step_pre_configure() { # Certain packages are not safe to build on device because their # build.sh script deletes specific files in $TERMUX_PREFIX. if $TERMUX_ON_DEVICE_BUILD; then termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds." fi # Setup perl so that the build process can execute it: rm -f $TERMUX_PREFIX/bin/perl ln -s $(which perl) $TERMUX_PREFIX/bin/perl # Force fresh perl files (otherwise files from earlier builds # remains without bumped modification times, so are not picked # up by the package): rm -Rf $TERMUX_PREFIX/share/git-perl # Fixes build if utfcpp is installed: CPPFLAGS="-I$TERMUX_PKG_SRCDIR $CPPFLAGS" } termux_step_make() { make -j $TERMUX_MAKE_PROCESSES $TERMUX_PKG_EXTRA_MAKE_ARGS make -j $TERMUX_MAKE_PROCESSES -C contrib/subtree $TERMUX_PKG_EXTRA_MAKE_ARGS } termux_step_make_install() { make $TERMUX_PKG_EXTRA_MAKE_ARGS install make -C contrib/subtree $TERMUX_PKG_EXTRA_MAKE_ARGS install # Installing man requires asciidoc and xmlto, so git uses separate make targets for man pages make -j $TERMUX_MAKE_PROCESSES install-man make -j $TERMUX_MAKE_PROCESSES -C contrib/subtree install-man } termux_step_post_make_install() { mkdir -p $TERMUX_PREFIX/etc/bash_completion.d/ cp $TERMUX_PKG_SRCDIR/contrib/completion/git-completion.bash \ $TERMUX_PKG_SRCDIR/contrib/completion/git-prompt.sh \ $TERMUX_PREFIX/etc/bash_completion.d/ # Remove the build machine perl setup in termux_step_pre_configure to avoid it being packaged: rm $TERMUX_PREFIX/bin/perl # Remove clutter: rm -Rf $TERMUX_PREFIX/lib/*-linux*/perl # Remove duplicated binaries in bin/ with symlink to the one in libexec/git-core: (cd $TERMUX_PREFIX/bin; ln -s -f ../libexec/git-core/git git) (cd $TERMUX_PREFIX/bin; ln -s -f ../libexec/git-core/git-upload-pack git-upload-pack) } termux_step_post_massage() { if [ ! -f libexec/git-core/git-remote-https ]; then termux_error_exit "Git built without https support" fi } ================================================ FILE: packages/git/config.c.patch ================================================ diff -u -r ../git-2.19.0/config.c ./config.c --- ../git-2.19.0/config.c 2018-09-10 18:39:13.000000000 +0000 +++ ./config.c 2018-09-11 21:16:14.404718876 +0000 @@ -77,6 +77,25 @@ static int pack_compression_seen; static int zlib_compression_seen; +/* + * Protecting the project-specific git configuration file (.git/config) is + * not possible on a shared file system on Android, which on an unpatched + * git causes operations such as clone to fail with an error message. + * + * For the Termux git package we introduce a warning about the configuration + * file being unprotected, but proceed in order to allow git repositories + * to be cloned to shared storage accessible to other apps. + */ +static void termux_warn_once_about_lockfile() +{ + static int already_warned; + if (!already_warned) { + warning("Cannot protect .git/config on this file system" + " - do not store sensitive information here."); + already_warned = 1; + } +} + static int config_file_fgetc(struct config_source *conf) { return getc_unlocked(conf->u.file); @@ -2792,9 +2811,13 @@ in_fd = -1; if (chmod(get_lock_file_path(&lock), st.st_mode & 07777) < 0) { +#ifdef __ANDROID__ + termux_warn_once_about_lockfile(); +#else error_errno(_("chmod on %s failed"), get_lock_file_path(&lock)); ret = CONFIG_NO_WRITE; goto out_free; +#endif } if (store.seen_nr == 0) { @@ -3030,9 +3053,13 @@ } if (chmod(get_lock_file_path(&lock), st.st_mode & 07777) < 0) { +#ifdef __ANDROID__ + termux_warn_once_about_lockfile(); +#else ret = error_errno(_("chmod on %s failed"), get_lock_file_path(&lock)); goto out; +#endif } while (fgets(buf, sizeof(buf), config_file)) { ================================================ FILE: packages/git/config.mak.uname.patch ================================================ Set uname_S to Linux instead of detecting build machine. Android does not support -lrt. diff -u -r ../git-2.10.0/config.mak.uname ./config.mak.uname --- ../git-2.10.0/config.mak.uname 2016-09-02 21:59:09.000000000 -0400 +++ ./config.mak.uname 2016-09-03 17:27:41.964893344 -0400 @@ -1,6 +1,6 @@ # Platform specific Makefile tweaks based on uname detection -uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') +uname_S := Linux uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') @@ -36,8 +36,6 @@ HAVE_DEV_TTY = YesPlease HAVE_CLOCK_GETTIME = YesPlease HAVE_CLOCK_MONOTONIC = YesPlease - # -lrt is needed for clock_gettime on glibc <= 2.16 - NEEDS_LIBRT = YesPlease HAVE_GETDELIM = YesPlease SANE_TEXT_GREP=-a endif ================================================ FILE: packages/git/disable_daemon_syslog.patch ================================================ diff -u -r ../git-2.17.0/daemon.c ./daemon.c --- ../git-2.17.0/daemon.c 2018-04-02 19:44:04.000000000 +0200 +++ ./daemon.c 2018-04-03 23:10:19.566140810 +0200 @@ -82,9 +82,11 @@ { switch (log_destination) { case LOG_DESTINATION_SYSLOG: { + /* char buf[1024]; vsnprintf(buf, sizeof(buf), err, params); syslog(priority, "%s", buf); + */ break; } case LOG_DESTINATION_STDERR: @@ -1432,7 +1434,9 @@ } if (log_destination == LOG_DESTINATION_SYSLOG) { + /* openlog("git-daemon", LOG_PID, LOG_DAEMON); + */ set_die_routine(daemon_die); } else /* avoid splitting a message in the middle */ ================================================ FILE: packages/git/git.patch ================================================ Fix ST_CTIME_NSEC and ST_MTIME_NSEC macros on Android. diff -u -r ../git-1.8.5.3/git-compat-util.h ./git-compat-util.h --- ../git-1.8.5.3/git-compat-util.h 2014-01-14 18:10:09.000000000 +0100 +++ ./git-compat-util.h 2014-01-22 13:07:19.000000000 +0100 @@ -657,6 +657,10 @@ # define FORCE_DIR_SET_GID 0 #endif +#ifdef __ANDROID__ +#define ST_CTIME_NSEC(st) ((unsigned int)((st).st_ctime_nsec)) +#define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtime_nsec)) +#else #ifdef NO_NSEC #undef USE_NSEC #define ST_CTIME_NSEC(st) 0 @@ -670,6 +674,7 @@ #define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtim.tv_nsec)) #endif #endif +#endif #ifdef UNRELIABLE_FSTAT #define fstat_is_reliable() 0 ================================================ FILE: packages/git/help.c.patch ================================================ diff -u -r ../git-2.9.3/help.c ./help.c --- ../git-2.9.3/help.c 2016-08-12 15:38:45.000000000 -0400 +++ ./help.c 2016-08-23 06:15:57.698156213 -0400 @@ -307,7 +307,7 @@ static const char bad_interpreter_advice[] = N_("'%s' appears to be a git command, but we were not\n" - "able to execute it. Maybe git-%s is broken?"); + "able to execute it. Maybe you need to 'pkg install perl'?"); const char *help_unknown_cmd(const char *cmd) { @@ -339,7 +339,7 @@ * it's a bad interpreter in the #! line. */ if (!strcmp(candidate, cmd)) - die(_(bad_interpreter_advice), cmd, cmd); + die(_(bad_interpreter_advice), cmd); /* Does the candidate appear in common_cmds list? */ while (n < ARRAY_SIZE(common_cmds) && ================================================ FILE: packages/git/run-command.c.patch ================================================ diff -u -r ../git-2.18.0/run-command.c ./run-command.c --- ../git-2.18.0/run-command.c 2018-06-21 17:18:50.000000000 +0000 +++ ./run-command.c 2018-06-23 21:33:38.289465325 +0000 @@ -490,8 +490,10 @@ #else CHECK_BUG(pthread_sigmask(SIG_SETMASK, &all, &as->old), "blocking all signals"); +# ifndef __ANDROID__ CHECK_BUG(pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &as->cs), "disabling cancellation"); +# endif #endif } @@ -501,8 +503,10 @@ if (sigprocmask(SIG_SETMASK, &as->old, NULL)) die_errno("sigprocmask"); #else +# ifndef __ANDROID__ CHECK_BUG(pthread_setcancelstate(as->cs, NULL), "re-enabling cancellation"); +# endif CHECK_BUG(pthread_sigmask(SIG_SETMASK, &as->old, NULL), "restoring signal mask"); #endif ================================================ FILE: packages/git/tempfile.c.patch ================================================ diff -u -r ../git-2.8.1/tempfile.c ./tempfile.c --- ../git-2.8.1/tempfile.c 2016-04-03 15:07:18.000000000 -0400 +++ ./tempfile.c 2016-04-28 07:22:47.339509915 -0400 @@ -170,7 +170,7 @@ tmpdir = getenv("TMPDIR"); if (!tmpdir) - tmpdir = "/tmp"; + tmpdir = "@TERMUX_PREFIX@/tmp"; strbuf_addf(&tempfile->filename, "%s/%s", tmpdir, template); tempfile->fd = git_mkstemps_mode(tempfile->filename.buf, suffixlen, mode); ================================================ FILE: packages/git-crypt/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.agwa.name/projects/git-crypt/ TERMUX_PKG_DESCRIPTION="Enables transparent encryption and decryption of files for a git repository" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_MAINTAINER="@jottr" TERMUX_PKG_VERSION=0.6.0 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/AGWA/git-crypt/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=777c0c7aadbbc758b69aff1339ca61697011ef7b92f1d1ee9518a8ee7702bb78 TERMUX_PKG_DEPENDS="git, libc++, openssl" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DCMAKE_BUILD_TYPE=Release -Dbuild_parse=yes -Dbuild_xmlparser=yes" TERMUX_PKG_EXTRA_MAKE_ARGS="make ENABLE_MAN=yes" termux_step_make() { cd $TERMUX_PKG_SRCDIR make } termux_step_make_install() { cd $TERMUX_PKG_SRCDIR make install } ================================================ FILE: packages/git-lfs/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://git-lfs.github.com/ TERMUX_PKG_DESCRIPTION="Git extension for versioning large files" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=2.9.1 TERMUX_PKG_SRCURL=https://github.com/git-lfs/git-lfs/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=f5a444f00e30b663ae32b34ebee82356ec2af62a8d6eafceaa4f18bfa9b6e600 termux_step_make() { termux_setup_golang export GOPATH=$TERMUX_PKG_BUILDDIR mkdir -p "$GOPATH"/github.com/git-lfs ln -sf "$TERMUX_PKG_SRCDIR" "$GOPATH"/github.com/git-lfs/git-lfs cd "$GOPATH"/github.com/git-lfs/git-lfs ! $TERMUX_ON_DEVICE_BUILD && GOOS=linux GOARCH=amd64 CC=gcc LD=gcc go generate github.com/git-lfs/git-lfs/commands go build git-lfs.go } termux_step_make_install() { install -Dm700 \ "$GOPATH"/github.com/git-lfs/git-lfs/git-lfs \ "$TERMUX_PREFIX"/bin/git-lfs } termux_step_post_make_install() { ## Remove read-only files generated in build process. chmod -R 700 "$TERMUX_PKG_BUILDDIR"/pkg rm -rf "$TERMUX_PKG_BUILDDIR"/pkg } ================================================ FILE: packages/gitea/app.ini ================================================ ; Either "dev", "prod" or "test", default is "dev" RUN_MODE = prod [repository] ROOT = @TERMUX_PREFIX@/var/gitea [database] DB_TYPE=sqlite3 PATH=@TERMUX_PREFIX@/var/gitea/gitea.db [log] ROOT_PATH=@TERMUX_PREFIX@/var/log/gitea MODE=file LEVEL=Info ; Update mirrors [cron.update_mirrors] SCHEDULE = @every 120m ================================================ FILE: packages/gitea/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://gitea.io TERMUX_PKG_DESCRIPTION="Git with a cup of tea, painless self-hosted git service" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.10.0 TERMUX_PKG_SRCURL=https://github.com/go-gitea/gitea/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=a45044ef8242f5cd0d0d914c9ef1d5f97483bd6985c27efef6d99dbdf38f759d TERMUX_PKG_DEPENDS="dash, git" termux_step_make() { echo 'replace github.com/go-macaron/cors v0.0.0-20190309005821-6fd6a9bfe14e9 => github.com/go-macaron/cors 6fd6a9bfe14e' >> $TERMUX_PKG_SRCDIR/go.mod termux_setup_golang export GOPATH=$TERMUX_PKG_BUILDDIR mkdir -p "$GOPATH"/src/code.gitea.io cp -a "$TERMUX_PKG_SRCDIR" "$GOPATH"/src/code.gitea.io/gitea cd "$GOPATH"/src/code.gitea.io/gitea # go-bindata shoudn't be cross-compiled GOOS=linux GOARCH=amd64 go get -u github.com/jteeuwen/go-bindata/... export PATH="$PATH:$GOPATH/bin" CGO_ENABLED=0 CGO_LDFLAGS="" CGO_CFLAGS="" GOOS=linux GOARCH=amd64 make generate #CGO_ENABLED=0 CGO_LDFLAGS="" CGO_CFLAGS="" LDFLAGS="" TAGS="bindata sqlite" make all LDFLAGS="" TAGS="bindata sqlite" make all } termux_step_make_install() { install -Dm700 \ "$GOPATH"/src/code.gitea.io/gitea/gitea \ "$TERMUX_PREFIX"/bin/gitea mkdir -p "$TERMUX_PREFIX"/etc/gitea sed "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" \ "$TERMUX_PKG_BUILDER_DIR"/app.ini > "$TERMUX_PREFIX"/etc/gitea/app.ini sed "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" \ "$TERMUX_PKG_BUILDER_DIR"/gitea-service.sh > "$TERMUX_PREFIX"/bin/gitea-service.sh chmod 700 ${TERMUX_PREFIX}/bin/gitea-service.sh } termux_step_post_massage() { mkdir -p "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX"/var/gitea mkdir -p "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX"/var/log/gitea } ================================================ FILE: packages/gitea/gitea-service.sh ================================================ #!/bin/sh export GITEA_WORK_DIR=@TERMUX_PREFIX@/var/gitea exec @TERMUX_PREFIX@/bin/gitea web -c @TERMUX_PREFIX@/etc/gitea/app.ini ================================================ FILE: packages/gkermit/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.columbia.edu/kermit/gkermit.html TERMUX_PKG_DESCRIPTION="Simple, Portable, Free File Transfer Software for UNIX" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.00 TERMUX_PKG_SRCURL=ftp://kermit.columbia.edu/kermit/archives/gku${TERMUX_PKG_VERSION/./}.tar.gz TERMUX_PKG_SHA256=3dbe63291277c4795255343b48b860777fb0a160163d7e1d30b1ee68585593eb TERMUX_PKG_DEPENDS="libandroid-support" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_MAKE_PROCESSES=1 termux_step_post_extract_package() { filename=$(basename "$TERMUX_PKG_SRCURL") local file="$TERMUX_PKG_CACHEDIR/$filename" tar xf "$file" -C "$TERMUX_PKG_SRCDIR" } ================================================ FILE: packages/gkermit/makefile.patch ================================================ --- ../gkermit/makefile 1999-12-26 22:28:38.000000000 +0200 +++ ./makefile 2017-12-16 13:45:36.154185777 +0200 @@ -29,16 +29,16 @@ # Sample installation values - change or override as needed. -BINDIR = /usr/local/bin -MANDIR = /usr/man/manl -TEXTDIR = /usr/local/doc -INFODIR = /usr/local/info -MANEXT = l +BINDIR = $(prefix)/bin +MANDIR = $(prefix)/share/man/man1 +TEXTDIR = $(prefix)/doc +INFODIR = $(prefix)/info +MANEXT = 1 # Default compiler and flags -CC=cc -CFLAGS= -DPOSIX -O $(KFLAGS) +GWART_CC = cc +CFLAGS= -DPOSIX -O $(KFLAGS) -DERRNO_H # Object files @@ -49,10 +49,10 @@ all: gwart gkermit gwart.o: gwart.c - $(CC) $(CFLAGS) -c gwart.c + $(GWART_CC) $(CFLAGS) -c gwart.c gwart: gwart.o - $(CC) -o gwart gwart.o + $(GWART_CC) -o gwart gwart.o .c.o: $(CC) $(CFLAGS) -c $< @@ -67,7 +67,8 @@ gcmdline.o: gcmdline.c gkermit.h gkermit: gproto.o gkermit.o gunixio.o gcmdline.o - $(CC) -o gkermit $(OBJECTS) + $(CC) -o gkermit -v -landroid-support \ + -L$(prefix)/lib -fPIE -pie $(OBJECTS) bsd: gwart $(MAKE) "CC=$(CC)" "CFLAGS=-DBSD -O $(KFLAGS)" gkermit @@ -118,6 +119,13 @@ @cp README $(TEXTDIR)/gkermit.txt @chmod 644 $(TEXTDIR)/gkermit.txt @ls -lg $(TEXTDIR)/gkermit.txt + @if test -d $(MANDIR); then \ + echo "$(MANDIR) exists..." ; \ + else \ + echo "Creating $(MANDIR)/..." ; \ + mkdir -p $(MANDIR) ; \ + chmod 755 $(MANDIR) ; \ + fi @echo Installing man page in $(MANDIR)/gkermit.$(MANEXT)... @cp gkermit.nr $(MANDIR)/gkermit.$(MANEXT) @chmod 644 $(MANDIR)/gkermit.$(MANEXT) ================================================ FILE: packages/glib/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://developer.gnome.org/glib/ TERMUX_PKG_DESCRIPTION="Library providing core building blocks for libraries and applications written in C" TERMUX_PKG_LICENSE="LGPL-2.1" TERMUX_PKG_VERSION=2.62.3 TERMUX_PKG_SRCURL=https://ftp.gnome.org/pub/gnome/sources/glib/${TERMUX_PKG_VERSION:0:4}/glib-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=4400adc9f0d3ffcfe8e84225210370ce3f9853afb81812ddadb685325aa655c4 # libandroid-support to get langinfo.h in include path. TERMUX_PKG_DEPENDS="libffi, libiconv, pcre, libandroid-support, zlib" TERMUX_PKG_BREAKS="glib-dev" TERMUX_PKG_REPLACES="glib-dev" TERMUX_PKG_RM_AFTER_INSTALL="share/gtk-doc lib/locale share/glib-2.0/gettext share/gdb/auto-load share/glib-2.0/codegen share/glib-2.0/gdb bin/gtester-report bin/glib-gettextize bin/gdbus-codegen" # Needed by pkg-config for glib-2.0: TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -Dlibmount=false -Diconv=external " termux_step_pre_configure() { # glib checks for __BIONIC__ instead of __ANDROID__: CFLAGS+=" -D__BIONIC__=1" } ================================================ FILE: packages/glib/fix-hardcoded-paths.patch ================================================ diff -uNr glib-2.58.3/gio/gdbusaddress.c glib-2.58.3.mod/gio/gdbusaddress.c --- glib-2.58.3/gio/gdbusaddress.c 2019-01-21 15:38:50.000000000 +0200 +++ glib-2.58.3.mod/gio/gdbusaddress.c 2019-03-02 02:08:55.324976201 +0200 @@ -1628,7 +1628,7 @@ ret = g_strdup (g_getenv ("DBUS_SYSTEM_BUS_ADDRESS")); if (ret == NULL) { - ret = g_strdup ("unix:path=/var/run/dbus/system_bus_socket"); + ret = g_strdup ("unix:path=@TERMUX_PREFIX@/var/run/dbus/system_bus_socket"); } break; diff -uNr glib-2.58.3/gio/gdbusprivate.c glib-2.58.3.mod/gio/gdbusprivate.c --- glib-2.58.3/gio/gdbusprivate.c 2019-01-21 15:38:50.000000000 +0200 +++ glib-2.58.3.mod/gio/gdbusprivate.c 2019-03-02 02:08:55.328309547 +0200 @@ -2098,17 +2098,17 @@ /* TODO: use PACKAGE_LOCALSTATEDIR ? */ ret = NULL; first_error = NULL; - if (!g_file_get_contents ("/var/lib/dbus/machine-id", + if (!g_file_get_contents ("@TERMUX_PREFIX@/var/lib/dbus/machine-id", &ret, NULL, &first_error) && - !g_file_get_contents ("/etc/machine-id", + !g_file_get_contents ("@TERMUX_PREFIX@/etc/machine-id", &ret, NULL, NULL)) { g_propagate_prefixed_error (error, first_error, - _("Unable to load /var/lib/dbus/machine-id or /etc/machine-id: ")); + _("Unable to load @TERMUX_PREFIX@/var/lib/dbus/machine-id or @TERMUX_PREFIX@/etc/machine-id: ")); } else { diff -uNr glib-2.58.3/gio/gnetworking.h.in glib-2.58.3.mod/gio/gnetworking.h.in --- glib-2.58.3/gio/gnetworking.h.in 2019-01-21 15:38:50.000000000 +0200 +++ glib-2.58.3.mod/gio/gnetworking.h.in 2019-03-02 02:08:55.331642893 +0200 @@ -55,7 +55,7 @@ #endif #ifndef _PATH_RESCONF -#define _PATH_RESCONF "/etc/resolv.conf" +#define _PATH_RESCONF "@TERMUX_PREFIX@/etc/resolv.conf" #endif #ifndef CMSG_LEN diff -uNr glib-2.58.3/gio/gunixmounts.c glib-2.58.3.mod/gio/gunixmounts.c --- glib-2.58.3/gio/gunixmounts.c 2019-01-21 15:38:50.000000000 +0200 +++ glib-2.58.3.mod/gio/gunixmounts.c 2019-03-02 02:08:55.331642893 +0200 @@ -539,7 +539,7 @@ return _PATH_MOUNTED; # endif #else - return "/etc/mtab"; + return "@TERMUX_PREFIX@/etc/mtab"; #endif } @@ -666,7 +666,7 @@ mountinfo_path = _PATH_MOUNTED; # endif #else - mountinfo_path = "/etc/mtab"; + mountinfo_path = "@TERMUX_PREFIX@/etc/mtab"; #endif return mountinfo_path; @@ -960,7 +960,7 @@ #elif defined(VFSTAB) return VFSTAB; #else - return "/etc/fstab"; + return "@TERMUX_PREFIX@/etc/fstab"; #endif #endif } @@ -2955,7 +2955,7 @@ /* see if device with similar major:minor as /dev/root is mention * in /etc/mtab (it usually is) */ - f = fopen ("/etc/mtab", "r"); + f = fopen ("@TERMUX_PREFIX@/etc/mtab", "r"); if (f != NULL) { struct mntent *entp; diff -uNr glib-2.58.3/gio/tests/org.gtk.test.gschema.override.orig glib-2.58.3.mod/gio/tests/org.gtk.test.gschema.override.orig --- glib-2.58.3/gio/tests/org.gtk.test.gschema.override.orig 2019-01-21 15:38:50.000000000 +0200 +++ glib-2.58.3.mod/gio/tests/org.gtk.test.gschema.override.orig 1970-01-01 03:00:00.000000000 +0300 @@ -1,2 +0,0 @@ -[org.gtk.test.per-desktop:GNOME-Classic] -desktop = "GNOME Classic" diff -uNr glib-2.58.3/gio/tests/org.gtk.test.gschema.xml.orig glib-2.58.3.mod/gio/tests/org.gtk.test.gschema.xml.orig --- glib-2.58.3/gio/tests/org.gtk.test.gschema.xml.orig 2019-01-21 15:38:50.000000000 +0200 +++ glib-2.58.3.mod/gio/tests/org.gtk.test.gschema.xml.orig 1970-01-01 03:00:00.000000000 +0300 @@ -1,222 +0,0 @@ - - - - - "Hello, earthlings" - A greeting - - Greeting of the invading martians - - - - "So long" - - - - - - - - - - true - - - - - - true - - - 25 - - - -1234 - - - 1234 - - - -123456 - - - 123456 - - - -123456789 - - - 123456789 - - - 123.456 - - - "a string, it seems" - - - "/a/object/path" - - - - - - ("one",(2,3)) - - - [0,1,2,3,4,5] - - - - { - "AC": [0,0, 0,0,0,0,0,0], - "IV": [0,0, 0,0,0,0,0,0] - } - - - - - - - "Unnamed" - - - "BackSpace" - - - - - - false - - - false - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - "" - - - [48, 49] - - - [] - - - 'foo' - - - ['mourning', 'laughing'] - - - 33 - - - - - - - 'bar' - - - - - - [] - - - - - - - - - [] - - - 'bar' - - - - - - 33 - - - - - - - 33 - - - - - - 0 - - - - - - - a paragraph. - - with some whitespace. - - because not everyone has a great editor. - - - - - lots of space is as one. - - 0 - - - - - - 0 - - - '' - - - - 42 - - 0 - - - - - - "GNOME" - - - - diff -uNr glib-2.58.3/gio/xdgmime/xdgmime.c glib-2.58.3.mod/gio/xdgmime/xdgmime.c --- glib-2.58.3/gio/xdgmime/xdgmime.c 2019-01-21 15:38:50.000000000 +0200 +++ glib-2.58.3.mod/gio/xdgmime/xdgmime.c 2019-03-02 02:08:55.334976238 +0200 @@ -255,7 +255,7 @@ xdg_data_dirs = getenv ("XDG_DATA_DIRS"); if (xdg_data_dirs == NULL) - xdg_data_dirs = "/usr/local/share/:/usr/share/"; + xdg_data_dirs = "@TERMUX_PREFIX@/local/share/:@TERMUX_PREFIX@/share/"; ptr = xdg_data_dirs; diff -uNr glib-2.58.3/glib/gcharset.c glib-2.58.3.mod/glib/gcharset.c --- glib-2.58.3/glib/gcharset.c 2019-01-21 15:38:50.000000000 +0200 +++ glib-2.58.3.mod/glib/gcharset.c 2019-03-02 02:08:55.334976238 +0200 @@ -298,7 +298,7 @@ if (g_once_init_enter (&alias_table)) { GHashTable *table = g_hash_table_new (g_str_hash, g_str_equal); - read_aliases ("/usr/share/locale/locale.alias", table); + read_aliases ("@TERMUX_PREFIX@/share/locale/locale.alias", table); g_once_init_leave (&alias_table, table); } ================================================ FILE: packages/glib/glib-bin.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="share/bash-completion/ share/man/man1/ bin/" TERMUX_SUBPKG_DESCRIPTION="Programs for the GLib library" ================================================ FILE: packages/glib/glib-gspawn.c.patch ================================================ diff -u -r ../glib-2.58.1/glib/gspawn.c ./glib/gspawn.c --- ../glib-2.58.1/glib/gspawn.c 2018-09-21 14:23:53.000000000 +0000 +++ ./glib/gspawn.c 2018-10-07 18:17:08.394012273 +0000 @@ -2020,7 +2022,7 @@ new_argv = g_new0 (gchar*, argc + 2); /* /bin/sh and NULL */ - new_argv[0] = (char *) "/bin/sh"; + new_argv[0] = (char *) "@TERMUX_PREFIX@/bin/sh"; new_argv[1] = (char *) file; while (argc > 0) { @@ -2099,7 +2101,7 @@ * what to search if PATH is unset. POSIX may, dunno. */ - path = "/bin:/usr/bin:."; + path = "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets:."; } len = strlen (file) + 1; ================================================ FILE: packages/glib/glib-gtimezone.c.patch ================================================ diff -u -r ../glib-2.58.1/glib/gtimezone.c ./glib/gtimezone.c --- ../glib-2.58.1/glib/gtimezone.c 2018-09-21 14:23:53.000000000 +0000 +++ ./glib/gtimezone.c 2018-10-07 18:37:37.275489744 +0000 @@ -43,6 +43,10 @@ #include #endif +#ifdef __ANDROID__ +#include +#endif + /** * SECTION:timezone * @title: GTimeZone @@ -399,7 +403,136 @@ gtz->transitions = NULL; } -#ifdef G_OS_UNIX +#ifdef __ANDROID__ +/* Android uses a 'persist.sys.timezone' system property for the + * current timezone instead of a /etc/localtime file: + * https://android.googlesource.com/platform/ndk/+/android-2.2_r1/docs/system/libc/OVERVIEW.TXT#67 + * + * There are no files under /usr/share/zoneinfo - instead a single + * /system/usr/share/zoneinfo/tzdata file is used which contains all + * files compiled together with the following tool: + * https://android.googlesource.com/platform/system/timezone/+/master/zone_compactor/main/java/ZoneCompactor.java + */ +static GBytes * +zone_info_android (const gchar *identifier, + gchar **out_identifier) +{ + char sys_timezone[PROP_VALUE_MAX]; + GMappedFile *file; + gchar *tzdata; + gsize tzdata_length; + const gsize index_entry_size = 52; + gint32 header_index_offset, header_data_offset; + gint32 entry_count, current_index; + char* entry_name; + gint32 entry_offset, entry_length; + guint32 entry_name_start, entry_name_end; + guint32 zoneinfo_start, zoneinfo_end; + GBytes *zoneinfo; + GError *error = NULL; + + if (identifier == NULL) + { + if (__system_property_get ("persist.sys.timezone", sys_timezone) < 1) + { + g_warning ("__system_property_get(\"persist.sys.timezone\") failed"); + return NULL; + } + identifier = sys_timezone; + } + + file = g_mapped_file_new ("/system/usr/share/zoneinfo/tzdata", FALSE, &error); + if (file == NULL) + { + g_warning ("Failed mapping tzdata file: %s", error->message); + g_error_free (error); + return NULL; + } + + tzdata = g_mapped_file_get_contents (file); + tzdata_length = g_mapped_file_get_length (file); + if (tzdata == NULL || tzdata_length < 24) + { + g_warning ("Too small tzdata file"); + goto error; + } + + header_index_offset = gint32_from_be (*((gint32_be*) (tzdata + 12))); + header_data_offset = gint32_from_be (*((gint32_be*) (tzdata + 16))); + + if (header_index_offset < 0 || header_data_offset < 0 || header_data_offset < index_entry_size) + { + g_warning ("Invalid tzdata content"); + goto error; + } + + entry_count = (header_data_offset - header_index_offset) / index_entry_size; + if (entry_count < 1) + { + g_warning ("No index entry found"); + goto error; + } + + current_index = 0; + while (current_index < entry_count) + { + if (!g_uint_checked_mul (&entry_name_start, current_index, index_entry_size) || + !g_uint_checked_add (&entry_name_start, entry_name_start, header_index_offset) || + !g_uint_checked_add (&entry_name_end, entry_name_start, 40)) + { + g_warning ("Overflow when computing entry name offset"); + goto error; + } + + entry_name = tzdata + entry_name_start; + + /* The name should be null terminated within the 40 chars. */ + if (memchr (entry_name, 0, 40) == NULL) + { + g_warning ("Invalid index entry"); + goto error; + } + + if (strcmp (entry_name, identifier) == 0) + { + entry_offset = gint32_from_be (*(gint32_be*) (entry_name + 40)); + entry_length = gint32_from_be (*(gint32_be*) (entry_name + 44)); + if (entry_length == 0 || entry_length > 65536) + { + /* Use a reasonable but arbitrary max length of an entry. */ + g_warning ("Invalid zoneinfo entry length"); + goto error; + } + + if (!g_uint_checked_add (&zoneinfo_start, header_data_offset, entry_offset) || + !g_uint_checked_add (&zoneinfo_end, zoneinfo_start, entry_length) || + zoneinfo_end > tzdata_length) + { + g_warning ("Too large zoneinfo entry length"); + goto error; + } + + zoneinfo = g_bytes_new_with_free_func (tzdata + zoneinfo_start, + entry_length, + (GDestroyNotify)g_mapped_file_unref, + g_mapped_file_ref (file)); + g_mapped_file_unref (file); + + if (out_identifier != NULL) + *out_identifier = g_strdup (identifier); + + return zoneinfo; + } + current_index++; + } + +error: + g_mapped_file_unref (file); + return NULL; +} + +#elif defined(G_OS_UNIX) + static GBytes* zone_info_unix (const gchar *identifier, gchar **out_identifier) @@ -506,6 +641,10 @@ return zoneinfo; } +#endif + +#ifdef G_OS_UNIX + static void init_zone_from_iana_info (GTimeZone *gtz, GBytes *zoneinfo, @@ -1483,7 +1622,11 @@ if (tz->t_info == NULL) { #ifdef G_OS_UNIX +# ifdef __ANDROID__ + GBytes *zoneinfo = zone_info_android (identifier, &resolved_identifier); +# else GBytes *zoneinfo = zone_info_unix (identifier, &resolved_identifier); +# endif if (zoneinfo != NULL) { init_zone_from_iana_info (tz, zoneinfo, g_steal_pointer (&resolved_identifier)); ================================================ FILE: packages/glib/glib-gutils.c.patch ================================================ diff -u -r ../glib-2.60.2/glib/gutils.c ./glib/gutils.c --- ../glib-2.60.2/glib/gutils.c 2019-05-03 13:43:28.000000000 +0000 +++ ./glib/gutils.c 2019-05-11 19:59:12.830415366 +0000 @@ -378,7 +378,7 @@ * what to search if PATH is unset. POSIX may, dunno. */ - path = "/bin:/usr/bin:."; + path = "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets:."; } #else n = GetModuleFileNameW (NULL, wfilename, MAXPATHLEN); @@ -958,7 +958,7 @@ if (tmp == NULL || *tmp == '\0') { g_free (tmp); - tmp = g_strdup ("/tmp"); + tmp = g_strdup ("@TERMUX_PREFIX@/tmp"); } #endif /* !G_OS_WIN32 */ @@ -2080,7 +2080,7 @@ */ #ifndef G_OS_WIN32 if (!data_dirs || !data_dirs[0]) - data_dirs = "/usr/local/share/:/usr/share/"; + data_dirs = "@TERMUX_PREFIX@/share/"; data_dir_vector = g_strsplit (data_dirs, G_SEARCHPATH_SEPARATOR_S, 0); #else @@ -2174,7 +2174,7 @@ } #else if (!conf_dirs || !conf_dirs[0]) - conf_dirs = "/etc/xdg"; + conf_dirs = "@TERMUX_PREFIX@/etc/xdg"; conf_dir_vector = g_strsplit (conf_dirs, G_SEARCHPATH_SEPARATOR_S, 0); #endif ================================================ FILE: packages/glib/meson.build.patch ================================================ diff -u -r ../glib-2.60.2/meson.build ./meson.build --- ../glib-2.60.2/meson.build 2019-05-03 13:43:28.000000000 +0000 +++ ./meson.build 2019-05-11 20:10:26.054269305 +0000 @@ -360,7 +360,6 @@ # https://wiki.gnome.org/Projects/GLib/CompilerRequirements#Function_pointer_conversions. '-Wno-pedantic', '-Werror=declaration-after-statement', - '-Werror=format=2', '-Werror=implicit-function-declaration', '-Werror=init-self', '-Werror=missing-include-dirs', --- ./meson.build.orig 2019-06-11 00:18:20.480045589 +0000 +++ ./meson.build 2019-06-11 00:19:34.408583457 +0000 @@ -1780,23 +1780,8 @@ endif endif -# First check in libc, fallback to libintl, and as last chance build -# proxy-libintl subproject. -# FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible -# implementations. This could be extended if issues are found in some platforms. -if cc.has_function('ngettext') libintl = [] have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset') -else - libintl = cc.find_library('intl', required : false) - if not libintl.found() - libintl = subproject('proxy-libintl').get_variable('intl_dep') - have_bind_textdomain_codeset = true # proxy-libintl supports it - else - have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', - dependencies : libintl) - endif -endif glib_conf.set('HAVE_BIND_TEXTDOMAIN_CODESET', have_bind_textdomain_codeset) ================================================ FILE: packages/global/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/global/ TERMUX_PKG_DESCRIPTION="Source code search and browse tools" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=6.6.3 TERMUX_PKG_SHA256=cbee98ef6c1b064bc5b062d14a6d94dca67289e8374860817057db7688bc651c TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/global/global-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" ac_cv_posix1_2008_realpath=yes --with-posix-sort=$TERMUX_PREFIX/bin/sort --with-ncurses=$TERMUX_PREFIX " # coreutils provides the posix sort executable: TERMUX_PKG_DEPENDS="coreutils, ncurses, libltdl" ================================================ FILE: packages/global/echo-path.patch ================================================ diff -uNr global-6.6.1.orig/globash/globash.in global-6.6.1/globash/globash.in --- global-6.6.1.orig/globash/globash.in 2017-12-16 07:19:15.000000000 +0200 +++ global-6.6.1/globash/globash.in 2017-12-19 18:37:51.034558917 +0200 @@ -36,7 +36,7 @@ # Use /bin/echo, because in some systems, built-in echo of /bin/sh # does not accept -n option. # -ECHO='/bin/echo' +ECHO='@TERMUX_PREFIX@/bin/echo' # # global command name # ================================================ FILE: packages/global/libutil-makepath.c.patch ================================================ diff -u -r ../global-6.5.2/libutil/makepath.c ./libutil/makepath.c --- ../global-6.5.2/libutil/makepath.c 2015-12-16 00:02:48.000000000 -0500 +++ ./libutil/makepath.c 2015-12-25 21:36:31.333892462 -0500 @@ -122,6 +122,9 @@ * ~/dir/... */ if (*++file == '/') { +#ifdef __ANDROID__ + return makepath("@TERMUX_HOME@", file, NULL); +#else uid_t uid; file++; uid = getuid(); @@ -129,11 +132,15 @@ if (pw->pw_uid == uid) break; } +#endif } /* * ~user/dir/... */ else { +#ifdef __ANDROID__ + pw = NULL; +#else const char *name = strmake(file, "/"); file = locatestring(file, "/", MATCH_FIRST); if (file != NULL) @@ -144,12 +151,15 @@ if (!strcmp(pw->pw_name, name)) break; } +#endif } if (errno) die("cannot open passwd file. (errno = %d)", errno); if (pw == NULL) die("home directory not found."); +#ifndef __ANDROID__ endpwent(); +#endif return makepath(pw->pw_dir, file, NULL); /* * absolute path ================================================ FILE: packages/gmic/CImg.h.patch ================================================ diff -uNr gmic-2.6.7/src/CImg.h gmic-2.6.7.mod/src/CImg.h --- gmic-2.6.7/src/CImg.h 2019-06-28 09:56:12.000000000 +0300 +++ gmic-2.6.7.mod/src/CImg.h 2019-06-29 18:45:02.595895578 +0300 @@ -60774,8 +60774,8 @@ _cimg_test_temporary_path("D:\\Temp"); _cimg_test_temporary_path("D:"); #else - _cimg_test_temporary_path("/tmp"); - _cimg_test_temporary_path("/var/tmp"); + _cimg_test_temporary_path("@TERMUX_PREFIX@/tmp"); + _cimg_test_temporary_path("@TERMUX_PREFIX@/var/tmp"); #endif if (!path_found) { *s_path = 0; ================================================ FILE: packages/gmic/Makefile.patch ================================================ diff -u -r ../gmic-2.7.4/src/Makefile ./src/Makefile --- ../gmic-2.7.4/src/Makefile 2019-10-10 06:24:59.000000000 +0000 +++ ./src/Makefile 2019-10-23 07:19:39.327118798 +0000 @@ -202,7 +202,7 @@ # Enable multi-threading support. PARALLEL_CFLAGS = -Dgmic_is_parallel ifneq ($(OS),Windows) -PARALLEL_LIBS = -lpthread +#PARALLEL_LIBS = -lpthread endif # Enable parallelization in CImg, using OpenMP. @@ -342,8 +342,8 @@ GMIC_CLI_CFLAGS = $(MANDATORY_CFLAGS) $(ABORT_CFLAGS) $(PARALLEL_CFLAGS) $(EIGEN_CFLAGS) $(FFTW_CFLAGS) $(CURL_CFLAGS) $(PNG_CFLAGS) $(JPEG_CFLAGS) $(TIFF_CFLAGS) GMIC_CLI_LIBS = $(MANDATORY_LIBS) $(PARALLEL_LIBS) $(EIGEN_LIBS) $(FFTW_LIBS) $(CURL_LIBS) $(PNG_LIBS) $(JPEG_LIBS) $(TIFF_LIBS) ifeq ($(OS),Unix) # Unix. -GMIC_CLI_CFLAGS += $(OPENMP_CFLAGS) $(X11_CFLAGS) $(OPENEXR_CFLAGS) $(OPENCV_CFLAGS) # $(XSHM_CFLAGS) # $(MAGICK_CFLAGS) -GMIC_CLI_LIBS += $(OPENMP_LIBS) $(X11_LIBS) $(OPENEXR_LIBS) $(OPENCV_LIBS) # $(XSHM_LIBS) # $(MAGICK_LIBS) +#GMIC_CLI_CFLAGS += $(OPENMP_CFLAGS) $(X11_CFLAGS) $(OPENEXR_CFLAGS) $(OPENCV_CFLAGS) # $(XSHM_CFLAGS) # $(MAGICK_CFLAGS) +#GMIC_CLI_LIBS += $(OPENMP_LIBS) $(X11_LIBS) $(OPENEXR_LIBS) $(OPENCV_LIBS) # $(XSHM_LIBS) # $(MAGICK_LIBS) else ifeq ($(OS),Darwin) # MacOSX. GMIC_CLI_CFLAGS += $(X11_CFLAGS) $(OPENEXR_CFLAGS) $(OPENCV_CFLAGS) @@ -356,7 +356,7 @@ cli: $(MAKE) "CFLAGS+=$(GMIC_CLI_CFLAGS) $(OPT_CFLAGS)" "LIBS+=$(GMIC_CLI_LIBS)" _cli - $(STRIP) gmic$(EXE) + $(STRIP) gmic$(EXE) gmic-gm$(EXE) debug: $(MAKE) "CFLAGS+=$(GMIC_CLI_CFLAGS) $(DEBUG_CFLAGS)" "LIBS+=$(GMIC_CLI_LIBS)" _cli @@ -364,6 +364,8 @@ _cli: gmic.cpp gmic.h gmic_stdlib.h CImg.h $(CXX) -o gmic_cli.o -c gmic.cpp $(CFLAGS) $(CXX) -o gmic gmic_cli.cpp gmic_cli.o $(CFLAGS) $(LIBS) + $(CXX) -o gmic_cli_gm.o -c gmic.cpp $(CFLAGS) $(MAGICK_CFLAGS) + $(CXX) -o gmic-gm gmic_cli.cpp gmic_cli_gm.o $(CFLAGS) $(MAGICK_CFLAGS) $(LIBS) $(MAGICK_LIBS) # CLI (static) #------------- ================================================ FILE: packages/gmic/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://gmic.eu TERMUX_PKG_DESCRIPTION="Full-featured framework for image processing" TERMUX_PKG_LICENSE="CeCILL-2.1" TERMUX_PKG_VERSION=2.7.5 TERMUX_PKG_SRCURL=https://gmic.eu/files/source/gmic_$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=a6854264c8ab4e7df33e19fe98314b6abcf663060e9baa18731f163eaabc1401 TERMUX_PKG_DEPENDS="libc++, libcurl, fftw, libpng, libjpeg-turbo, libtiff, zlib" TERMUX_PKG_BUILD_DEPENDS="graphicsmagick" TERMUX_PKG_BUILD_IN_SRC=true termux_step_configure() { return 0; } termux_step_make() { cd src/ make USR="$TERMUX_PREFIX" STRIP="$STRIP" \ CFLAGS="$CXXFLAGS" LIBS="$LDFLAGS" cli } termux_step_make_install() { cp src/gmic $TERMUX_PREFIX/bin/ cp src/gmic-gm $TERMUX_PREFIX/bin/ cp man/gmic.1.gz $TERMUX_PREFIX/share/man/man1/ cp man/gmic.1.gz $TERMUX_PREFIX/share/man/man1/gmic-gm.1.gz } ================================================ FILE: packages/gmic/gmic-gm.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="bin/gmic-gm share/man/man1/gmic-gm.1.gz" TERMUX_SUBPKG_DESCRIPTION="Full-featured framework for image processing (GraphicsMagick variant)" TERMUX_SUBPKG_DEPENDS="graphicsmagick" TERMUX_SUBPKG_DEPEND_ON_PARENT=deps ================================================ FILE: packages/gnuchess/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/chess/ TERMUX_PKG_DESCRIPTION="Chess-playing program" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=6.2.5 TERMUX_PKG_REVISION=3 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/chess/gnuchess-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=9a99e963355706cab32099d140b698eda9de164ebce40a5420b1b9772dd04802 TERMUX_PKG_DEPENDS="libc++, ncurses, readline" TERMUX_PKG_RM_AFTER_INSTALL="bin/gnuchessu bin/gnuchessx" ================================================ FILE: packages/gnuchess/components.cc.patch ================================================ diff -uNr gnuchess-6.2.5/src/components.cc gnuchess-6.2.5.mod/src/components.cc --- gnuchess-6.2.5/src/components.cc 2017-06-11 18:17:14.000000000 +0300 +++ gnuchess-6.2.5.mod/src/components.cc 2018-11-09 14:17:10.952608702 +0200 @@ -171,6 +171,6 @@ void TerminateInput() { - pthread_cancel( input_thread ); + pthread_kill( input_thread, 0 ); pthread_join( input_thread, NULL ); } ================================================ FILE: packages/gnuchess/main.cc.patch ================================================ diff -u -r ../gnuchess-6.2.1/src/main.cc ./src/main.cc --- ../gnuchess-6.2.1/src/main.cc 2015-01-04 05:10:41.000000000 -0500 +++ ./src/main.cc 2015-01-05 20:40:16.816570715 -0500 @@ -237,8 +237,8 @@ char opt_addbook[MAXSTR+1] = ""; char *endptr; - /*disable graphic output by default */ - graphicmodeoutput = 0; + /*enable graphic output by default */ + graphicmodeoutput = 1; progname = argv[0]; /* Save in global for cmd_usage */ ================================================ FILE: packages/gnuit/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gnuit/ TERMUX_PKG_DESCRIPTION="gnuit - GNU Interactive Tools" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=4.9.5 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gnuit/gnuit-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=6b6e96db13bafa5ad35c735b2277699d4244088c709a3e134fb1a3e8c8a8557c TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-transition" TERMUX_PKG_DEPENDS="libandroid-support, ncurses" termux_step_post_massage() { cd $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/share/gnuit ln -s gnuitrc.xterm-color gnuitrc.xterm-256color ln -s gnuitrc.screen gnuitrc.screen-color ln -s gnuitrc.screen gnuitrc.screen-256color } ================================================ FILE: packages/gnuit/system.c.patch ================================================ --- ../cache/gnuit-4.9.5/src/system.c 2009-02-18 02:31:26.000000000 +0000 +++ ./src/system.c 2017-05-31 02:32:44.499460109 +0000 @@ -162,7 +162,7 @@ close(0); } - execle("/bin/sh", "sh", "-c", command, (char *)NULL, environ); + execle("@TERMUX_PREFIX@/bin/sh", "sh", "-c", command, (char *)NULL, environ); /* Make sure we exit if exec() fails. Call _exit() instead of exit() to avoid flushing file descriptors twice (in the ================================================ FILE: packages/gnuit/tilde.c-history.c.patch.debug ================================================ --- ./src/tilde.c 2009-02-18 02:31:26.000000000 +0000 +++ ../tilde.c 2018-03-17 21:38:36.637958669 +0000 @@ -47,7 +47,7 @@ #if !defined (savestring) # ifndef strcpy -extern char *strcpy (); +extern char __attribute__((overloadable)) *strcpy (); # endif #define savestring(x) strcpy (xmalloc (1 + strlen (x)), (x)) #endif /* !savestring */ --- ./src/history.c 2009-02-18 02:31:26.000000000 +0000 +++ ../history.c 2018-03-17 21:38:21.789964199 +0000 @@ -61,7 +61,7 @@ #ifndef savestring # ifndef strcpy -extern char *strcpy (); +extern char __attribute__((overloadable)) *strcpy (); # endif #define savestring(x) strcpy (xmalloc (1 + strlen (x)), (x)) #endif @@ -80,7 +80,7 @@ #ifndef member # ifndef strchr -extern char *strchr (); +extern char __attribute__((overloadable)) *strchr (); # endif #define member(c, s) ((c) ? ((char *)strchr ((s), (c)) != (char *)NULL) : 0) #endif ================================================ FILE: packages/gnupg/agent-agent.h.patch ================================================ diff -u -r ../gnupg-2.1.6/agent/agent.h ./agent/agent.h --- ../gnupg-2.1.6/agent/agent.h 2015-06-30 16:26:08.000000000 -0400 +++ ./agent/agent.h 2015-07-06 08:39:31.806515184 -0400 @@ -310,7 +310,7 @@ agent_Lunderscore (ctrl_t ctrl, const char *string) \ { \ return ctrl? i18n_localegettext (ctrl->lc_messages, string) \ - /* */: gettext (string); \ + /* */: string; \ } ================================================ FILE: packages/gnupg/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnupg.org/ TERMUX_PKG_DESCRIPTION="Implementation of the OpenPGP standard for encrypting and signing data and communication" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.2.18 TERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SHA256=30d37ce2ca55b2b9b61480b2a175a3b22066ab41cd3f84688448919b566dec0a TERMUX_PKG_DEPENDS="libassuan, libbz2, libgcrypt, libgnutls, libgpg-error, libksba, libnpth, libsqlite, readline, pinentry, resolv-conf, zlib" TERMUX_PKG_CONFLICTS="gnupg2 (<< 2.2.9-1), dirmngr (<< 2.2.17-1)" TERMUX_PKG_REPLACES="gnupg2 (<< 2.2.9-1), dirmngr (<< 2.2.17-1)" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-ldap --enable-sqlite --enable-tofu " # Remove non-english help files and man pages shipped with the gnupg (1) package: TERMUX_PKG_RM_AFTER_INSTALL="share/gnupg/help.*.txt share/man/man1/gpg-zip.1 share/man/man7/gnupg.7" termux_step_pre_configure() { CPPFLAGS+=" -Ddn_skipname=__dn_skipname" } termux_step_post_make_install() { cd $TERMUX_PREFIX/bin ln -sf gpg gpg2 } ================================================ FILE: packages/gnupg/common-dotlock.c.patch ================================================ Android does not support hardlinks so no need to try or nag. diff -u -r ../gnupg-2.2.9/common/dotlock.c ./common/dotlock.c --- ../gnupg-2.2.9/common/dotlock.c 2017-08-28 10:22:54.000000000 +0000 +++ ./common/dotlock.c 2018-08-05 21:40:02.699642490 +0000 @@ -605,6 +605,9 @@ static int use_hardlinks_p (const char *tname) { +#ifdef __ANDROID__ + return 1; +#else char *lname; struct stat sb; unsigned int nlink; @@ -633,6 +636,7 @@ unlink (lname); xfree (lname); return res; +#endif } #endif /*HAVE_POSIX_SYSTEM */ @@ -758,8 +762,10 @@ } strcpy (stpcpy (h->lockname, file_to_lock), EXTSEP_S "lock"); UNLOCK_all_lockfiles (); +#ifndef __ANDROID__ if (h->use_o_excl) my_debug_1 ("locking for '%s' done via O_EXCL\n", h->lockname); +#endif return h; ================================================ FILE: packages/gnupg/configure.patch ================================================ diff -u -r ../gnupg-2.1.14/configure ./configure --- ../gnupg-2.1.14/configure 2016-07-14 10:03:06.000000000 -0400 +++ ./configure 2016-07-14 19:20:04.539115863 -0400 @@ -14729,13 +14729,6 @@ done -if test "$have_android_system" = yes; then - # On Android ttyname is a stub but prints an error message. - -$as_echo "#define HAVE_BROKEN_TTYNAME 1" >>confdefs.h - -fi - ac_fn_c_check_type "$LINENO" "struct sigaction" "ac_cv_type_struct_sigaction" "#include " if test "x$ac_cv_type_struct_sigaction" = xyes; then : ================================================ FILE: packages/gnupg/fix-paths.patch ================================================ diff -uNr gnupg-2.2.13/dirmngr/certcache.c gnupg-2.2.13.mod/dirmngr/certcache.c --- gnupg-2.2.13/dirmngr/certcache.c 2018-04-25 13:38:04.000000000 +0300 +++ gnupg-2.2.13.mod/dirmngr/certcache.c 2019-03-02 01:32:08.653821497 +0200 @@ -674,11 +674,8 @@ #ifdef DEFAULT_TRUST_STORE_FILE { DEFAULT_TRUST_STORE_FILE } #else - { "/etc/ssl/ca-bundle.pem" }, - { "/etc/ssl/certs/ca-certificates.crt" }, - { "/etc/pki/tls/cert.pem" }, - { "/usr/local/share/certs/ca-root-nss.crt" }, - { "/etc/ssl/cert.pem" } + { "@TERMUX_PREFIX@/etc/tls/cert.pem" }, + { "@TERMUX_PREFIX@/etc/ssl/cert.pem" } #endif /*!DEFAULT_TRUST_STORE_FILE*/ }; int idx; diff -uNr gnupg-2.2.13/dirmngr/dns.c gnupg-2.2.13.mod/dirmngr/dns.c --- gnupg-2.2.13/dirmngr/dns.c 2018-12-18 09:26:53.000000000 +0200 +++ gnupg-2.2.13.mod/dirmngr/dns.c 2019-03-02 01:33:24.937449148 +0200 @@ -5112,7 +5112,7 @@ if (!(hosts = dns_hosts_open(&error))) goto error; - if ((error = dns_hosts_loadpath(hosts, "/etc/hosts"))) + if ((error = dns_hosts_loadpath(hosts, "@TERMUX_PREFIX@/etc/hosts"))) goto error; return hosts; @@ -5428,7 +5428,7 @@ if (!(resconf = dns_resconf_open(&error))) goto error; - if ((error = dns_resconf_loadpath(resconf, "/etc/resolv.conf"))) { + if ((error = dns_resconf_loadpath(resconf, "@TERMUX_PREFIX@/etc/resolv.conf"))) { /* * NOTE: Both the glibc and BIND9 resolvers ignore a missing * /etc/resolv.conf, defaulting to a nameserver of @@ -5440,7 +5440,7 @@ goto error; } - if ((error = dns_nssconf_loadpath(resconf, "/etc/nsswitch.conf"))) { + if ((error = dns_nssconf_loadpath(resconf, "@TERMUX_PREFIX@/etc/nsswitch.conf"))) { if (error != ENOENT) goto error; } @@ -10436,7 +10436,7 @@ panic("dns_resconf_open: %s", dns_strerror(error)); if (!MAIN.resconf.count) - MAIN.resconf.path[MAIN.resconf.count++] = "/etc/resolv.conf"; + MAIN.resconf.path[MAIN.resconf.count++] = "@TERMUX_PREFIX@/etc/resolv.conf"; for (i = 0; i < MAIN.resconf.count; i++) { path = MAIN.resconf.path[i]; @@ -10485,11 +10485,11 @@ return *hosts; if (!MAIN.hosts.count) { - MAIN.hosts.path[MAIN.hosts.count++] = "/etc/hosts"; + MAIN.hosts.path[MAIN.hosts.count++] = "@TERMUX_PREFIX@/etc/hosts"; /* Explicitly test dns_hosts_local() */ if (!(*hosts = dns_hosts_local(&error))) - panic("%s: %s", "/etc/hosts", dns_strerror(error)); + panic("%s: %s", "@TERMUX_PREFIX@/etc/hosts", dns_strerror(error)); return *hosts; } diff -uNr gnupg-2.2.13/dirmngr/dns-stuff.c gnupg-2.2.13.mod/dirmngr/dns-stuff.c --- gnupg-2.2.13/dirmngr/dns-stuff.c 2018-07-03 12:54:26.000000000 +0300 +++ gnupg-2.2.13.mod/dirmngr/dns-stuff.c 2019-03-02 01:32:38.027267980 +0200 @@ -114,7 +114,7 @@ #define DEFAULT_TIMEOUT 30 -#define RESOLV_CONF_NAME "/etc/resolv.conf" +#define RESOLV_CONF_NAME "@TERMUX_PREFIX@/etc/resolv.conf" /* Two flags to enable verbose and debug mode. */ static int opt_verbose; @@ -602,7 +602,7 @@ derr = dns_hosts_loadpath (ld.hosts, hosts_path); xfree (hosts_path); #else - derr = dns_hosts_loadpath (ld.hosts, "/etc/hosts"); + derr = dns_hosts_loadpath (ld.hosts, "@TERMUX_PREFIX@/etc/hosts"); #endif if (derr) { diff -uNr gnupg-2.2.13/dirmngr/ks-engine-ldap.c gnupg-2.2.13.mod/dirmngr/ks-engine-ldap.c --- gnupg-2.2.13/dirmngr/ks-engine-ldap.c 2018-10-25 18:37:53.000000000 +0300 +++ gnupg-2.2.13.mod/dirmngr/ks-engine-ldap.c 2019-03-02 01:32:08.667154882 +0200 @@ -1947,9 +1947,9 @@ if (dump_modlist) { - dump = es_fopen("/tmp/modlist.txt", "w"); + dump = es_fopen("@TERMUX_PREFIX@/tmp/modlist.txt", "w"); if (! dump) - log_error ("Failed to open /tmp/modlist.txt: %s\n", + log_error ("Failed to open @TERMUX_PREFIX@/tmp/modlist.txt: %s\n", strerror (errno)); if (dump) diff -uNr gnupg-2.2.13/g10/exec.c gnupg-2.2.13.mod/g10/exec.c --- gnupg-2.2.13/g10/exec.c 2017-08-28 13:22:54.000000000 +0300 +++ gnupg-2.2.13.mod/g10/exec.c 2019-03-02 01:32:08.667154882 +0200 @@ -180,7 +180,7 @@ tmp=".GnuPG"; mkdir(tmp,0700); /* Error checks occur later on */ #else - tmp="/tmp"; + tmp="@TERMUX_PREFIX@/tmp"; #endif } } @@ -383,7 +383,7 @@ char *shell=getenv("SHELL"); if(shell==NULL) - shell="/bin/sh"; + shell="@TERMUX_PREFIX@/bin/sh"; /* I'm the child */ diff -uNr gnupg-2.2.13/g13/be-encfs.c gnupg-2.2.13.mod/g13/be-encfs.c --- gnupg-2.2.13/g13/be-encfs.c 2017-08-28 13:22:54.000000000 +0300 +++ gnupg-2.2.13.mod/g13/be-encfs.c 2019-03-02 01:32:08.670488228 +0200 @@ -410,7 +410,7 @@ if (err) goto leave; - mountpoint = xtrystrdup ("/tmp/.#g13_XXXXXX"); + mountpoint = xtrystrdup ("@TERMUX_PREFIX@/tmp/.#g13_XXXXXX"); if (!mountpoint) { err = gpg_error_from_syserror (); @@ -420,7 +420,7 @@ { err = gpg_error_from_syserror (); log_error (_("can't create directory '%s': %s\n"), - "/tmp/.#g13_XXXXXX", gpg_strerror (err)); + "@TERMUX_PREFIX@/tmp/.#g13_XXXXXX", gpg_strerror (err)); goto leave; } diff -uNr gnupg-2.2.13/g13/mount.c gnupg-2.2.13.mod/g13/mount.c --- gnupg-2.2.13/g13/mount.c 2017-08-28 13:22:54.000000000 +0300 +++ gnupg-2.2.13.mod/g13/mount.c 2019-03-02 01:32:08.670488228 +0200 @@ -82,14 +82,14 @@ if (!mountpoint) { - mountpoint_buffer = xtrystrdup ("/tmp/g13-XXXXXX"); + mountpoint_buffer = xtrystrdup ("@TERMUX_PREFIX@/tmp/g13-XXXXXX"); if (!mountpoint_buffer) return gpg_error_from_syserror (); if (!gnupg_mkdtemp (mountpoint_buffer)) { err = gpg_error_from_syserror (); log_error (_("can't create directory '%s': %s\n"), - "/tmp/g13-XXXXXX", gpg_strerror (err)); + "@TERMUX_PREFIX@/tmp/g13-XXXXXX", gpg_strerror (err)); xfree (mountpoint_buffer); return err; } diff -uNr gnupg-2.2.13/scd/scdaemon.c gnupg-2.2.13.mod/scd/scdaemon.c --- gnupg-2.2.13/scd/scdaemon.c 2018-03-21 20:43:33.000000000 +0200 +++ gnupg-2.2.13.mod/scd/scdaemon.c 2019-03-02 01:32:08.670488228 +0200 @@ -766,10 +766,10 @@ write. */ if (allow_coredump) { - if (chdir("/tmp")) - log_debug ("chdir to '/tmp' failed: %s\n", strerror (errno)); + if (chdir("@TERMUX_PREFIX@/tmp")) + log_debug ("chdir to '@TERMUX_PREFIX@/tmp' failed: %s\n", strerror (errno)); else - log_debug ("changed working directory to '/tmp'\n"); + log_debug ("changed working directory to '@TERMUX_PREFIX@/tmp'\n"); } /* In multi server mode we need to listen on an additional diff -uNr gnupg-2.2.13/tests/gpgscm/ffi.c gnupg-2.2.13.mod/tests/gpgscm/ffi.c --- gnupg-2.2.13/tests/gpgscm/ffi.c 2017-08-28 13:22:54.000000000 +0300 +++ gnupg-2.2.13.mod/tests/gpgscm/ffi.c 2019-03-02 01:32:08.673821575 +0200 @@ -355,7 +355,7 @@ FFI_RETURN_STRING (sc, "/temp"); FFI_RETURN_STRING (sc, buffer); #else - FFI_RETURN_STRING (sc, "/tmp"); + FFI_RETURN_STRING (sc, "@TERMUX_PREFIX@/tmp"); #endif } diff -uNr gnupg-2.2.13/tools/addgnupghome gnupg-2.2.13.mod/tools/addgnupghome --- gnupg-2.2.13/tools/addgnupghome 2018-12-11 09:44:33.000000000 +0200 +++ gnupg-2.2.13.mod/tools/addgnupghome 2019-03-02 01:32:08.673821575 +0200 @@ -70,10 +70,10 @@ return fi for f in $filelist; do - if [ -d /etc/skel/.gnupg/$f ]; then + if [ -d @TERMUX_PREFIX@/etc/skel/.gnupg/$f ]; then mkdir $f else - cp /etc/skel/.gnupg/$f $f + cp @TERMUX_PREFIX@/etc/skel/.gnupg/$f $f fi if ! chown $user $f ; then error "error changing ownership of \`$f'" @@ -102,11 +102,11 @@ info "please note that only users from /etc/passwd are checked" fi -if [ ! -d /etc/skel/.gnupg ]; then - error "skeleton directory \`/etc/skel/.gnupg' does not exist" +if [ ! -d @TERMUX_PREFIX@/etc/skel/.gnupg ]; then + error "skeleton directory \`@TERMUX_PREFIX@/etc/skel/.gnupg' does not exist" exit 1 fi -cd "/etc/skel/.gnupg" || (error "error cd-ing to \`/etc/skel/.gnupg'"; exit 1) +cd "@TERMUX_PREFIX@/etc/skel/.gnupg" || (error "error cd-ing to \`@TERMUX_PREFIX@/etc/skel/.gnupg'"; exit 1) filelist=$(find . \( -type f -o -type d \) '!' -name '*~' '!' -name . -print) diff -uNr gnupg-2.2.13/tools/symcryptrun.c gnupg-2.2.13.mod/tools/symcryptrun.c --- gnupg-2.2.13/tools/symcryptrun.c 2017-08-28 13:22:54.000000000 +0300 +++ gnupg-2.2.13.mod/tools/symcryptrun.c 2019-03-02 01:32:08.673821575 +0200 @@ -319,7 +319,7 @@ p = getenv ("TMPDIR"); if (!p || !*p) - p = "/tmp"; + p = "@TERMUX_PREFIX@/tmp"; if (p[strlen (p) - 1] == '/') name = xstrconcat (p, "gpg-XXXXXX", NULL); else ================================================ FILE: packages/gnupg/gpgv.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="bin/gpgv share/man/man1/gpgv.1.gz" TERMUX_SUBPKG_DESCRIPTION="GNU privacy guard - signature verification tool" TERMUX_SUBPKG_DEPENDS="libbz2, libgcrypt, libgpg-error, zlib" TERMUX_SUBPKG_DEPEND_ON_PARENT=no ================================================ FILE: packages/gnuplot/Makefile.patch ================================================ diff -u -r ../gnuplot-5.2.0/Makefile.in ./Makefile.in --- ../gnuplot-5.2.0/Makefile.in 2017-09-03 03:44:09.000000000 +0000 +++ ./Makefile.in 2017-10-14 20:54:05.459305245 +0000 @@ -344,7 +344,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign -SUBDIRS = config m4 term src docs man demo tutorial share +SUBDIRS = config m4 term src man tutorial share EXTRA_DIST = BUGS Copyright FAQ.pdf GNUmakefile INSTALL INSTALL.gnu \ Makefile.maint PATCHLEVEL PGPKEYS README RELEASE_NOTES \ VERSION configure.vms win ================================================ FILE: packages/gnuplot/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://gnuplot.info/ TERMUX_PKG_DESCRIPTION="Command-line driven graphing utility" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_VERSION=5.2.8 TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/gnuplot/gnuplot/${TERMUX_PKG_VERSION}/gnuplot-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=60a6764ccf404a1668c140f11cc1f699290ab70daa1151bb58fed6139a28ac37 TERMUX_PKG_DEPENDS="libandroid-support, libc++, libiconv, readline, pango, libgd, zlib" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--without-x --with-lua=no --with-bitmap-terminals" TERMUX_PKG_HOSTBUILD=true termux_step_host_build() { "$TERMUX_PKG_SRCDIR/configure" make -C docs/ gnuplot.gih } termux_step_post_make_install() { mkdir -p $TERMUX_PREFIX/share/gnuplot/5.2/ cp $TERMUX_PKG_HOSTBUILD_DIR/docs/gnuplot.gih \ $TERMUX_PREFIX/share/gnuplot/5.2/gnuplot.gih } ================================================ FILE: packages/gnuplot/plot.c.patch ================================================ --- ./src/plot.c.orig 2019-02-08 21:42:42.500914619 +0000 +++ ./src/plot.c 2019-02-08 21:43:56.702190583 +0000 @@ -281,7 +281,7 @@ #endif /* make sure that we really have revoked root access, this might happen if gnuplot is compiled without vga support but is installed suid by mistake */ -#ifdef __linux__ +#if defined(__linux__) && !defined(__ANDROID__) if (setuid(getuid()) != 0) { fprintf(stderr,"gnuplot: refusing to run at elevated privilege\n"); exit(EXIT_FAILURE); ================================================ FILE: packages/gnuplot/src-command.c.patch ================================================ For WEXITSTATUS macro. diff -u -r ../gnuplot-5.2.0/src/command.c ./src/command.c --- ../gnuplot-5.2.0/src/command.c 2017-08-30 18:48:26.000000000 +0000 +++ ./src/command.c 2017-10-14 20:56:13.905856980 +0000 @@ -138,6 +138,7 @@ int vms_ktid; /* key table id, for translating keystrokes */ #endif /* VMS */ +#include /* static prototypes */ static void command __PROTO((void)); ================================================ FILE: packages/go-findimagedupes/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://gitlab.com/opennota/findimagedupes TERMUX_PKG_DESCRIPTION="Find visually similar or duplicate images" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.20190114 TERMUX_PKG_REVISION=8 _COMMIT=237ed2ef4bbb91c79eee0f5ee84a1adad9c014ff TERMUX_PKG_SRCURL=https://gitlab.com/opennota/findimagedupes/-/archive/${_COMMIT}/findimagedupes-${_COMMIT}.tar.gz TERMUX_PKG_SHA256=7eb4fbab38c8c1965dafd1d0fddbfac58ba6e1a3d52cd1220df488a0a338abb0 TERMUX_PKG_DEPENDS="file, libjpeg-turbo, libpng, libtiff" TERMUX_PKG_CONFLICTS="findimagedupes" TERMUX_PKG_REPLACES="findimagedupes" termux_step_make() { termux_setup_golang export GOPATH=$TERMUX_PKG_BUILDDIR export CGO_CFLAGS="$CFLAGS $CPPFLAGS -I$TERMUX_PREFIX/include/libpng16 -D__GLIBC__" export CGO_CXXFLAGS="$CXXFLAGS $CPPFLAGS -I$TERMUX_PREFIX/include/libpng16 -D__GLIBC__" export CGO_LDFLAGS="$LDFLAGS" mkdir -p "$GOPATH"/src/gitlab.com/opennota ln -sf "$TERMUX_PKG_SRCDIR" "$GOPATH"/src/gitlab.com/opennota/findimagedupes cd "$GOPATH"/src/gitlab.com/opennota/findimagedupes go build . } termux_step_make_install() { install -Dm700 \ "$GOPATH"/src/gitlab.com/opennota/findimagedupes/findimagedupes \ "$TERMUX_PREFIX"/bin/findimagedupes } ================================================ FILE: packages/goaccess/Makefile.in.patch ================================================ diff -uNr goaccess-1.3/Makefile.in goaccess-1.3.mod/Makefile.in --- goaccess-1.3/Makefile.in 2018-11-23 07:35:59.000000000 +0200 +++ goaccess-1.3.mod/Makefile.in 2019-02-01 01:28:46.579671652 +0200 @@ -531,10 +531,9 @@ src/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/$(DEPDIR) @: > src/$(DEPDIR)/$(am__dirstamp) -src/bin2c.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -bin2c$(EXEEXT): $(bin2c_OBJECTS) $(bin2c_DEPENDENCIES) $(EXTRA_bin2c_DEPENDENCIES) +bin2c$(EXEEXT): $(bin2c_SOURCES) @rm -f bin2c$(EXEEXT) - $(LINK) $(bin2c_OBJECTS) $(bin2c_LDADD) $(LIBS) + gcc $(bin2c_SOURCES) $(bin2c_LDADD) $(LIBS) -o bin2c src/base64.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/browsers.$(OBJEXT): src/$(am__dirstamp) \ ================================================ FILE: packages/goaccess/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://goaccess.io TERMUX_PKG_DESCRIPTION="An open source real-time web log analyzer and interactive viewer" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.3 TERMUX_PKG_REVISION=6 TERMUX_PKG_SRCURL=https://tar.goaccess.io/goaccess-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=8c775c5c24bf85a933fd6f1249004847342d6542aa533e4ec02aaf7be41d7b9b TERMUX_PKG_DEPENDS="ncurses, openssl" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --enable-utf8 --with-openssl" ================================================ FILE: packages/goaccess/configure.patch ================================================ diff -uNr goaccess-1.3/configure goaccess-1.3.mod/configure --- goaccess-1.3/configure 2018-11-23 07:35:57.000000000 +0200 +++ goaccess-1.3.mod/configure 2019-02-01 01:24:41.379926604 +0200 @@ -6431,56 +6431,6 @@ fi -# pthread -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 -$as_echo_n "checking for pthread_create in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_create+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pthread_create (); -int -main () -{ -return pthread_create (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pthread_pthread_create=yes -else - ac_cv_lib_pthread_pthread_create=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPTHREAD 1 -_ACEOF - - LIBS="-lpthread $LIBS" - -else - as_fn_error $? "pthread is missing" "$LINENO" 5 -fi - -CFLAGS="$CFLAGS -pthread" - # DEBUG # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : ================================================ FILE: packages/goaccess/tcbtdb.h.patch ================================================ diff -uNr goaccess-1.3/src/tcbtdb.h goaccess-1.3.mod/src/tcbtdb.h --- goaccess-1.3/src/tcbtdb.h 2018-11-23 04:00:08.000000000 +0200 +++ goaccess-1.3.mod/src/tcbtdb.h 2019-02-01 01:30:19.191246767 +0200 @@ -46,7 +46,7 @@ #define TC_LMEMB 128 #define TC_NMEMB 256 #define TC_BNUM 32749 -#define TC_DBPATH "/tmp/goaccess" +#define TC_DBPATH "@TERMUX_PREFIX@/tmp/goaccess" #define TC_DBPMODE 0755 #define TC_ZLIB 1 #define TC_BZ2 2 ================================================ FILE: packages/goaccess/websocket.h.patch ================================================ diff -uNr goaccess-1.3/src/websocket.h goaccess-1.3.mod/src/websocket.h --- goaccess-1.3/src/websocket.h 2018-11-23 04:00:08.000000000 +0200 +++ goaccess-1.3.mod/src/websocket.h 2019-02-01 01:30:02.260971076 +0200 @@ -90,8 +90,8 @@ #define MAX(a,b) (((a)>(b))?(a):(b)) #include "gslist.h" -#define WS_PIPEIN "/tmp/wspipein.fifo" -#define WS_PIPEOUT "/tmp/wspipeout.fifo" +#define WS_PIPEIN "@TERMUX_PREFIX@/tmp/wspipein.fifo" +#define WS_PIPEOUT "@TERMUX_PREFIX@/tmp/wspipeout.fifo" #define WS_BAD_REQUEST_STR "HTTP/1.1 400 Invalid Request\r\n\r\n" #define WS_SWITCH_PROTO_STR "HTTP/1.1 101 Switching Protocols" ================================================ FILE: packages/golang/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://golang.org/ TERMUX_PKG_DESCRIPTION="Go programming language compiler" TERMUX_PKG_LICENSE="BSD 3-Clause" local _MAJOR_VERSION=1.13.5 # Use the ~ deb versioning construct in the future: TERMUX_PKG_VERSION=2:${_MAJOR_VERSION} TERMUX_PKG_SRCURL=https://storage.googleapis.com/golang/go${_MAJOR_VERSION}.src.tar.gz TERMUX_PKG_SHA256=27d356e2a0b30d9983b60a788cf225da5f914066b37a6b4f69d457ba55a626ff TERMUX_PKG_DEPENDS="clang" TERMUX_PKG_NO_STATICSPLIT=true termux_step_make_install() { termux_setup_golang TERMUX_GOLANG_DIRNAME=${GOOS}_$GOARCH TERMUX_GODIR=$TERMUX_PREFIX/lib/go cd $TERMUX_PKG_SRCDIR/src # Unset PKG_CONFIG to avoid the path being hardcoded into src/cmd/cgo/zdefaultcc.go, # see https://github.com/termux/termux-packages/issues/3505. env CC_FOR_TARGET=$CC \ CXX_FOR_TARGET=$CXX \ CC=gcc \ GO_LDFLAGS="-extldflags=-pie" \ GOROOT_BOOTSTRAP=$GOROOT \ GOROOT_FINAL=$TERMUX_GODIR \ PKG_CONFIG= \ ./make.bash cd .. rm -Rf $TERMUX_GODIR mkdir -p $TERMUX_GODIR/{bin,src,doc,lib,pkg/tool/$TERMUX_GOLANG_DIRNAME,pkg/include,pkg/${TERMUX_GOLANG_DIRNAME}} cp bin/$TERMUX_GOLANG_DIRNAME/{go,gofmt} $TERMUX_GODIR/bin/ ln -sfr $TERMUX_GODIR/bin/go $TERMUX_PREFIX/bin/go ln -sfr $TERMUX_GODIR/bin/gofmt $TERMUX_PREFIX/bin/gofmt cp VERSION $TERMUX_GODIR/ cp pkg/tool/$TERMUX_GOLANG_DIRNAME/* $TERMUX_GODIR/pkg/tool/$TERMUX_GOLANG_DIRNAME/ cp -Rf src/* $TERMUX_GODIR/src/ cp -Rf doc/* $TERMUX_GODIR/doc/ cp pkg/include/* $TERMUX_GODIR/pkg/include/ cp -Rf lib/* $TERMUX_GODIR/lib cp -Rf pkg/${TERMUX_GOLANG_DIRNAME}/* $TERMUX_GODIR/pkg/${TERMUX_GOLANG_DIRNAME}/ } termux_step_post_massage() { find . -path '*/testdata*' -delete } ================================================ FILE: packages/golang/golang-doc.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="lib/go/doc" TERMUX_SUBPKG_DESCRIPTION="Go programming language - documentation" ================================================ FILE: packages/golang/src-os-file_unix.go.patch ================================================ --- ../go/src/os/file_unix.go 2015-08-06 00:36:35.000000000 -0400 +++ ./src/os/file_unix.go 2015-08-14 03:28:11.634760646 -0400 @@ -329,11 +329,7 @@ func TempDir() string { dir := Getenv("TMPDIR") if dir == "" { - if runtime.GOOS == "android" { - dir = "/data/local/tmp" - } else { - dir = "/tmp" - } + dir = "@TERMUX_PREFIX@/tmp" } return dir } ================================================ FILE: packages/golang/src-runtime-cgo-cgo.go.patch ================================================ diff -u -r ../go/src/runtime/cgo/cgo.go ./src/runtime/cgo/cgo.go --- ../go/src/runtime/cgo/cgo.go 2015-08-06 00:36:35.000000000 -0400 +++ ./src/runtime/cgo/cgo.go 2015-08-16 16:03:29.614948543 -0400 @@ -16,7 +16,6 @@ #cgo darwin,arm64 LDFLAGS: -framework CoreFoundation #cgo dragonfly LDFLAGS: -lpthread #cgo freebsd LDFLAGS: -lpthread -#cgo android LDFLAGS: -llog #cgo !android,linux LDFLAGS: -lpthread #cgo netbsd LDFLAGS: -lpthread #cgo openbsd LDFLAGS: -lpthread ================================================ FILE: packages/golang/src-runtime-cgo-gcc_android.c.patch ================================================ diff -u -r ../go/src/runtime/cgo/gcc_android.c ./src/runtime/cgo/gcc_android.c --- ../go/src/runtime/cgo/gcc_android.c 2015-08-06 00:36:35.000000000 -0400 +++ ./src/runtime/cgo/gcc_android.c 2015-08-16 16:08:05.346940583 -0400 @@ -11,21 +11,11 @@ { va_list ap; - // Write to both stderr and logcat. - // - // When running from an .apk, /dev/stderr and /dev/stdout - // redirect to /dev/null. And when running a test binary - // via adb shell, it's easy to miss logcat. - fprintf(stderr, "runtime/cgo: "); va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); fprintf(stderr, "\n"); - va_start(ap, format); - __android_log_vprint(ANDROID_LOG_FATAL, "runtime/cgo", format, ap); - va_end(ap); - abort(); } ================================================ FILE: packages/google-glog/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/google/glog TERMUX_PKG_DESCRIPTION="Logging library for C++" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.4.0 TERMUX_PKG_REVISION=6 TERMUX_PKG_SRCURL=https://github.com/google/glog/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=f28359aeba12f30d73d9e4711ef356dc842886968112162bc73002645139c39c TERMUX_PKG_DEPENDS="libc++" TERMUX_PKG_BREAKS="google-glog-dev" TERMUX_PKG_REPLACES="google-glog-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DBUILD_SHARED_LIBS=ON" termux_step_pre_configure() { LDFLAGS+=" -llog" } termux_step_post_make_install() { install -Dm600 "$TERMUX_PKG_SRCDIR"/libglog.pc.in \ "$TERMUX_PREFIX"/lib/pkgconfig/libglog.pc sed -i "s|@prefix@|$TERMUX_PREFIX|g" "$TERMUX_PREFIX"/lib/pkgconfig/libglog.pc sed -i "s|@exec_prefix@|$TERMUX_PREFIX|g" "$TERMUX_PREFIX"/lib/pkgconfig/libglog.pc sed -i "s|@libdir@|$TERMUX_PREFIX/lib|g" "$TERMUX_PREFIX"/lib/pkgconfig/libglog.pc sed -i "s|@includedir@|$TERMUX_PREFIX/include|g" "$TERMUX_PREFIX"/lib/pkgconfig/libglog.pc sed -i "s|@VERSION@|$TERMUX_PKG_VERSION|g" "$TERMUX_PREFIX"/lib/pkgconfig/libglog.pc } ================================================ FILE: packages/googletest/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/google/googletest TERMUX_PKG_DESCRIPTION="Google C++ testing framework" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=1.10.0 TERMUX_PKG_SRCURL=https://github.com/google/googletest/archive/release-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb TERMUX_PKG_DEPENDS="libc++" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-DBUILD_SHARED_LIBS=ON" ================================================ FILE: packages/gotty/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/yudai/gotty TERMUX_PKG_DESCRIPTION="Share your terminal as a web application" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.0.1 TERMUX_PKG_REVISION=4 TERMUX_PKG_SRCURL=https://github.com/yudai/gotty/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=32695d70a79f55efdf4fba6f06f830515a2055abc58fc15e2124dff5be75695b termux_step_make() { termux_setup_golang export GOPATH=$TERMUX_PKG_BUILDDIR mkdir -p "$GOPATH"/src/github.com/yudai ln -sf "$TERMUX_PKG_SRCDIR" "$GOPATH"/src/github.com/yudai/gotty cd "$GOPATH"/src/github.com/yudai/gotty go build } termux_step_make_install() { install -Dm700 \ "$GOPATH"/src/github.com/yudai/gotty/gotty \ "$TERMUX_PREFIX"/bin/ } ================================================ FILE: packages/gperf/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gperf TERMUX_PKG_DESCRIPTION="A perfect hash function generator" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=3.1 TERMUX_PKG_REVISION=4 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gperf/gperf-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2 TERMUX_PKG_DEPENDS="libc++" TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/gperf/output.cc.patch ================================================ --- ./src/output.cc +++ ../src/output.cc @@ -2083,6 +2083,16 @@ } printf ("\n"); + // Include stdlib.h or cstdlib header to fix errors about size_t + if (option[KRC] || option[C] || option[ANSIC]) + { + printf("#include \n\n"); + } + else if (option[CPLUSPLUS]) + { + printf("#include \n\n"); + } + if (_charset_dependent && (_key_positions.get_size() > 0 || option[UPPERLOWER])) { ================================================ FILE: packages/gpgme/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnupg.org/related_software/gpgme/ TERMUX_PKG_DESCRIPTION="Library designed to make access to GnuPG easier" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=1.13.1 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=ftp://ftp.gnupg.org/gcrypt/gpgme/gpgme-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SHA256=c4e30b227682374c23cddc7fdb9324a99694d907e79242a25a4deeedb393be46 TERMUX_PKG_DEPENDS="gnupg (>= 2.2.9-1), libassuan, libgpg-error" TERMUX_PKG_BREAKS="gpgme-dev" TERMUX_PKG_REPLACES="gpgme-dev" # Use "--disable-gpg-test" to avoid "No rule to make target `../../src/libgpgme-pthread.la": # Use "--enable-languages=no" to only build the C library. TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-gpg-test --enable-languages=no --with-gpg=$TERMUX_PREFIX/bin/gpg2 --without-g13 --without-gpgconf --without-gpgsm " ================================================ FILE: packages/gpsbabel/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gpsbabel.org/ TERMUX_PKG_DESCRIPTION="GPS file conversion plus transfer to/from GPS units" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.4.4 TERMUX_PKG_SHA256=22860e913f093aa9124e295d52d1d4ae1afccaa67ed6bed6f1f8d8b0a45336d1 TERMUX_PKG_SRCURL=https://github.com/gpsbabel/gpsbabel/archive/gpsbabel_${TERMUX_PKG_VERSION//./_}.tar.gz TERMUX_PKG_DEPENDS="libexpat" termux_step_post_extract_package() { TERMUX_PKG_SRCDIR+=/gpsbabel } ================================================ FILE: packages/graphicsmagick/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.graphicsmagick.org/ TERMUX_PKG_DESCRIPTION="Collection of image processing tools" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=1.3.33 # Bandwith limited on main ftp site, so it's asked to use sourceforge instead: TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/graphicsmagick/graphicsmagick/${TERMUX_PKG_VERSION}/GraphicsMagick-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=130cb330a633580b5124eba5c125bbcbc484298423a97b9bed37ccd50d6dc778 TERMUX_PKG_DEPENDS="littlecms, libc++, libtiff, freetype, libjasper, libjpeg-turbo, libpng, libbz2, libxml2, liblzma, zstd, zlib" TERMUX_PKG_BREAKS="graphicsmagick-dev" TERMUX_PKG_REPLACES="graphicsmagick++, graphicsmagick-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" ac_cv_func_ftime=no --with-fontpath=/system/fonts --without-webp --without-x " ================================================ FILE: packages/graphviz/add-libcommon-to-gc.patch ================================================ diff -r -u graphviz-2.38.0/cmd/tools/Makefile.am src/cmd/tools/Makefile.am --- graphviz-2.38.0/cmd/tools/Makefile.am 2014-04-13 13:40:25.000000000 -0700 +++ src/cmd/tools/Makefile.am 2016-04-09 09:34:27.178979677 -0700 @@ -135,6 +135,7 @@ gc_SOURCES = gc.c gc_LDADD = \ + $(top_builddir)/lib/common/libcommon_C.la \ $(top_builddir)/lib/ingraphs/libingraphs_C.la \ $(top_builddir)/lib/cgraph/libcgraph.la Only in src/cmd/tools: Makefile.am~ diff -r -u graphviz-2.38.0/cmd/tools/Makefile.in src/cmd/tools/Makefile.in --- graphviz-2.38.0/cmd/tools/Makefile.in 2014-04-13 13:41:53.000000000 -0700 +++ src/cmd/tools/Makefile.in 2016-04-09 09:35:23.858509449 -0700 @@ -722,6 +722,7 @@ gc_SOURCES = gc.c gc_LDADD = \ + $(top_builddir)/lib/common/libcommon_C.la \ $(top_builddir)/lib/ingraphs/libingraphs_C.la \ $(top_builddir)/lib/cgraph/libcgraph.la Only in src/cmd/tools: Makefile.in~ ================================================ FILE: packages/graphviz/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.graphviz.org/ TERMUX_PKG_DESCRIPTION="Rich set of graph drawing tools" TERMUX_PKG_LICENSE="EPL-2.0" TERMUX_PKG_MAINTAINER="Dustin DeWeese @HackerFoo" TERMUX_PKG_VERSION=2.40.1 TERMUX_PKG_REVISION=9 TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/graphviz-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=ca5218fade0204d59947126c38439f432853543b0818d9d728c589dfe7f3a421 TERMUX_PKG_DEPENDS="libandroid-glob, libc++, libcairo, pango, libexpat, libltdl, librsvg, libgd, zlib" TERMUX_PKG_BREAKS="graphviz-dev" TERMUX_PKG_REPLACES="graphviz-dev" TERMUX_PKG_BUILD_DEPENDS="libtool" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --enable-guile=no --enable-java=no --enable-lua=no --enable-ocaml=no --enable-perl=no --enable-php=no --enable-python=no --enable-r=no --enable-ruby=no --enable-sharp=no --enable-swig=no --enable-tcl=no --with-ltdl-include=$TERMUX_PREFIX/include --with-ltdl-lib=$TERMUX_PREFIX/lib --with-pangocairo=yes --with-pic --with-poppler=no --with-x=no " TERMUX_PKG_RM_AFTER_INSTALL="bin/*-config share/man/man1/*-config.1" termux_step_pre_configure() { LDFLAGS+=" -landroid-glob" CPPFLAGS+=" -D_typ_ssize_t=1" } termux_step_post_make_install() { # Some binaries (dot_builtins, gvpack) links against these: cd $TERMUX_PREFIX/lib for lib in graphviz/*.so.*; do ln -s -f $lib $(basename $lib) done } termux_step_create_debscripts() { echo "#!$TERMUX_PREFIX/bin/sh" > postinst echo "dot -c" >> postinst echo "exit 0" >> postinst chmod 0755 postinst } ================================================ FILE: packages/graphviz/cmd-edgepaint-Makefile.in.patch ================================================ diff -u -r ../graphviz-2.40.1/cmd/edgepaint/Makefile.in ./cmd/edgepaint/Makefile.in --- ../graphviz-2.40.1/cmd/edgepaint/Makefile.in 2016-12-25 03:04:55.000000000 +0000 +++ ./cmd/edgepaint/Makefile.in 2019-04-26 20:26:13.197184745 +0000 @@ -585,7 +585,7 @@ $(top_builddir)/lib/edgepaint/liblab_gamut.la \ $(top_builddir)/lib/cgraph/libcgraph.la \ $(top_builddir)/lib/cdt/libcdt.la \ - $(ANN_LIBS) -lstdc++ -lm + $(ANN_LIBS) -lc++_shared -lm EXTRA_DIST = $(man_MANS) $(pdf_DATA) edgepaint.vcxproj* DISTCLEANFILES = $(pdf_DATA) ================================================ FILE: packages/graphviz/configure.patch ================================================ Do not require libltdl.la for building. diff -u -r ../graphviz-2.40.1/configure ./configure --- ../graphviz-2.40.1/configure 2016-12-25 04:04:52.000000000 +0100 +++ ./configure 2017-08-11 14:35:43.459379008 +0200 @@ -19556,15 +19556,6 @@ fi -if test -n "$with_ltdl_lib"; then - if test -f "$with_ltdl_lib/libltdl.la"; then : - else - as_fn_error $? "invalid ltdl library directory: \`$with_ltdl_lib'" "$LINENO" 5 - fi -else - with_ltdl_lib=no -fi - case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in ,yes,no,no,) case $enable_ltdl_convenience in ================================================ FILE: packages/graphviz/no-configure-dot-plugins.patch ================================================ diff -r -u graphviz-2.38.0/cmd/dot/Makefile.am src/cmd/dot/Makefile.am --- graphviz-2.38.0/cmd/dot/Makefile.am 2014-04-13 13:40:25.000000000 -0700 +++ src/cmd/dot/Makefile.am 2016-04-04 15:38:30.797597592 -0700 @@ -58,7 +58,6 @@ # run "dot -c", if possible, to create plugin config install-exec-hook: (cd $(DESTDIR)$(bindir); if test -x dot$(EXEEXT); then for i in $(linkedprogram); do rm -f $$i; $(LN_S) dot$(EXEEXT) $$i; done; fi;) - if test "x$(DESTDIR)" = "x"; then if test -x $(bindir)/dot$(EXEEXT); then if test -x /sbin/ldconfig; then /sbin/ldconfig 2>/dev/null; fi; $(bindir)/dot$(EXEEXT) -c; else $(bindir)/dot_static$(EXEEXT) -c; fi; fi uninstall-hook: (cd $(DESTDIR)$(man1dir); for i in $(linkedman); do rm -f $$i; done;) Only in src/cmd/dot: Makefile.am~ diff -r -u graphviz-2.38.0/cmd/dot/Makefile.in src/cmd/dot/Makefile.in --- graphviz-2.38.0/cmd/dot/Makefile.in 2014-04-13 13:41:50.000000000 -0700 +++ src/cmd/dot/Makefile.in 2016-04-04 15:38:02.213908307 -0700 @@ -1177,7 +1177,6 @@ # run "dot -c", if possible, to create plugin config install-exec-hook: (cd $(DESTDIR)$(bindir); if test -x dot$(EXEEXT); then for i in $(linkedprogram); do rm -f $$i; $(LN_S) dot$(EXEEXT) $$i; done; fi;) - if test "x$(DESTDIR)" = "x"; then if test -x $(bindir)/dot$(EXEEXT); then if test -x /sbin/ldconfig; then /sbin/ldconfig 2>/dev/null; fi; $(bindir)/dot$(EXEEXT) -c; else $(bindir)/dot_static$(EXEEXT) -c; fi; fi uninstall-hook: (cd $(DESTDIR)$(man1dir); for i in $(linkedman); do rm -f $$i; done;) Only in src/cmd/dot: Makefile.in~ ================================================ FILE: packages/graphviz/no-mkdefs.patch ================================================ http://www.graphviz.org/content/cant-cross-compile-graphviz diff -u -r ../graphviz-2.40.1/lib/gvpr/Makefile.am ./lib/gvpr/Makefile.am --- ../graphviz-2.40.1/lib/gvpr/Makefile.am 2016-08-09 23:02:10.000000000 +0200 +++ ./lib/gvpr/Makefile.am 2017-01-19 20:01:22.745725697 +0100 @@ -57,7 +57,7 @@ mkdefs_SOURCES = mkdefs.c gdefs.h: $(top_srcdir)/lib/gvpr/gprdata mkdefs$(EXEEXT) - ./mkdefs$(EXEEXT) gdefs.h < $(top_srcdir)/lib/gvpr/gprdata + touch gdefs.h EXTRA_DIST = $(man_MANS) $(pdf_DATA) gprdata mkdefs.c gdefs.h trie.c gvprlib.vcxproj* diff -u -r ../graphviz-2.40.1/lib/gvpr/Makefile.in ./lib/gvpr/Makefile.in --- ../graphviz-2.40.1/lib/gvpr/Makefile.in 2016-12-25 04:04:59.000000000 +0100 +++ ./lib/gvpr/Makefile.in 2017-01-19 20:02:07.293214993 +0100 @@ -1084,7 +1084,7 @@ - @GROFF@ -Tps -man $(srcdir)/gvpr.3 | @PS2PDF@ - - >gvpr.3.pdf gdefs.h: $(top_srcdir)/lib/gvpr/gprdata mkdefs$(EXEEXT) - ./mkdefs$(EXEEXT) gdefs.h < $(top_srcdir)/lib/gvpr/gprdata + touch gdefs.h # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. ================================================ FILE: packages/graphviz/sfdpgen-free.patch ================================================ --- src/lib/sfdpgen/PriorityQueue.c.orig 2016-04-01 08:29:58.788223689 -0700 +++ src/lib/sfdpgen/PriorityQueue.c 2016-04-01 08:30:44.507731384 -0700 @@ -11,6 +11,8 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ +void free(void *ptr); + #include "LinkedList.h" #include "PriorityQueue.h" #include "memory.h" ================================================ FILE: packages/grep/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/grep/ TERMUX_PKG_DESCRIPTION="Command which searches one or more input files for lines containing a match to a specified pattern" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=3.3 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/grep/grep-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=b960541c499619efd6afe1fa795402e4733c8e11ebf9fafccc0bb4bccdc5b514 TERMUX_PKG_DEPENDS="libandroid-support, pcre" TERMUX_PKG_ESSENTIAL=true termux_step_pre_configure() { if $TERMUX_DEBUG; then # When doing debug build, -D_FORTIFY_SOURCE=2 gives this error: # /home/builder/.termux-build/_cache/19b-aarch64-24-v5/bin/../sysroot/usr/include/bits/fortify/stdio.h:51:53: error: use of undeclared identifier '__USE_FORTIFY_LEVEL' # return __builtin___vsnprintf_chk(dest, size, 0, __bos(dest), format, ap); # ^ # lib/cdefs.h:123:48: note: expanded from macro '__bos' # #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) # ^ export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/} fi } ================================================ FILE: packages/gsl/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gsl/ TERMUX_PKG_DESCRIPTION="GNU Scientific Library (GSL) providing a wide range of mathematical routines" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.6 TERMUX_PKG_SHA256=b782339fc7a38fe17689cb39966c4d821236c28018b6593ddb6fd59ee40786a8 TERMUX_PKG_BREAKS="gsl-dev" TERMUX_PKG_REPLACES="gsl-dev" TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gsl/gsl-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_RM_AFTER_INSTALL="bin/ share/man/man1" # Workaround for linker on Android 5 (fixed in Android 6) not supporting RTLD_GLOBAL. # See https://github.com/termux/termux-packages/issues/507 export GSL_LDFLAGS="-Lcblas/.libs/ -lgslcblas" ================================================ FILE: packages/gst-plugins-bad/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://gstreamer.freedesktop.org/ TERMUX_PKG_DESCRIPTION="GStreamer Bad Plug-ins" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=1.16.1 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=56481c95339b8985af13bac19b18bc8da7118c2a7d9440ed70e7dcd799c2adb5 TERMUX_PKG_DEPENDS="gst-plugins-base, libbz2, libcurl, libiconv, libpng, librsvg, libssh2, libsndfile, libx264, libx265, littlecms, openal-soft, openjpeg" TERMUX_PKG_BREAKS="gst-plugins-bad-dev" TERMUX_PKG_REPLACES="gst-plugins-bad-dev" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-android_media --disable-examples --disable-rtmp --disable-tests --disable-zbar --disable-webp --with-hls-crypto=openssl " TERMUX_PKG_RM_AFTER_INSTALL="share/gtk-doc/" termux_step_pre_configure() { export GNUSTL_LIBS="-lc" export GNUSTL_CFLAGS="-Oz" export GLIB_MKENUMS="/usr/bin/glib-mkenums" } ================================================ FILE: packages/gst-plugins-base/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://gstreamer.freedesktop.org/ TERMUX_PKG_DESCRIPTION="GStreamer base plug-ins" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=1.16.1 TERMUX_PKG_SRCURL=https://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=5c3cc489933d0597087c9bc6ba251c93693d64554bcc563539a084fa2d5fcb2b TERMUX_PKG_DEPENDS="gstreamer, libjpeg-turbo, libopus, libpng, libvorbis, zlib" TERMUX_PKG_BREAKS="gst-plugins-base-dev" TERMUX_PKG_REPLACES="gst-plugins-base-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" GLIB_GENMARSHAL=/usr/bin/glib-genmarshal GLIB_MKENUMS=/usr/bin/glib-mkenums --disable-tests --disable-examples --disable-pango " ================================================ FILE: packages/gst-plugins-good/autoplug_libcaca.patch ================================================ --- src/ext/libcaca/gstcacasink.c.orig 2017-10-05 05:57:01.990156123 +0000 +++ src/ext/libcaca/gstcacasink.c 2017-10-05 06:17:58.320938634 +0000 @@ -407,7 +407,7 @@ static gboolean plugin_init (GstPlugin * plugin) { - if (!gst_element_register (plugin, "cacasink", GST_RANK_NONE, + if (!gst_element_register (plugin, "cacasink", GST_RANK_PRIMARY, GST_TYPE_CACASINK)) return FALSE; ================================================ FILE: packages/gst-plugins-good/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://gstreamer.freedesktop.org/ TERMUX_PKG_DESCRIPTION="GStreamer Good Plug-ins" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=1.16.1 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=9fbabe69018fcec707df0b71150168776040cde6c1a26bb5a82a136755fa8f1f TERMUX_PKG_DEPENDS="gst-plugins-base, libcaca, libsoup, libjpeg-turbo, libpng, libflac, libbz2, libvpx, pulseaudio, libmp3lame, gstreamer, libogg, zlib" TERMUX_PKG_BUILD_IN_SRC=true # pcre needed by glib. libxml2 needed by libsoup TERMUX_PKG_BUILD_DEPENDS="glib, pcre, libxml2" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-android_media --disable-cairo --disable-examples --disable-gdk_pixbuf --disable-oss --disable-oss4 --disable-tests --disable-gst_v4l2 --disable-aalib " TERMUX_PKG_RM_AFTER_INSTALL="share/gtk-doc/" ================================================ FILE: packages/gst-plugins-ugly/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://gstreamer.freedesktop.org/ TERMUX_PKG_DESCRIPTION="GStreamer Ugly Plug-ins" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=1.16.1 TERMUX_PKG_SRCURL=https://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=4bf913b2ca5195ac3b53b5e3ade2dc7c45d2258507552ddc850c5fa425968a1d TERMUX_PKG_DEPENDS="gst-plugins-base, libx264" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-tests --disable-examples --disable-android_media " TERMUX_PKG_RM_AFTER_INSTALL="share/gtk-doc/" ================================================ FILE: packages/gstreamer/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://gstreamer.freedesktop.org/ TERMUX_PKG_DESCRIPTION="Open source multimedia framework" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=1.16.1 TERMUX_PKG_SRCURL=https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=02211c3447c4daa55919c5c0f43a82a6fbb51740d57fc3af0639d46f1cf4377d TERMUX_PKG_DEPENDS="glib" TERMUX_PKG_BREAKS="gstreamer-dev" TERMUX_PKG_REPLACES="gstreamer-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-check --disable-tests --disable-examples --disable-benchmarks --with-unwind=no --with-dw=no GLIB_GENMARSHAL=/usr/bin/glib-genmarshal GLIB_MKENUMS=/usr/bin/glib-mkenums " ================================================ FILE: packages/gtypist/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gtypist/ TERMUX_PKG_DESCRIPTION="Universal typing tutor" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.9.5 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gtypist/gtypist-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=c13af40b12479f8219ffa6c66020618c0ce305ad305590fde02d2c20eb9cf977 TERMUX_PKG_DEPENDS="libandroid-support, libiconv, ncurses" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_header_ncursesw_ncurses_h=yes --enable-nls=no ac_cv_header_libintl_h=no" TERMUX_PKG_RM_AFTER_INSTALL="share/emacs/site-lisp bin/typefortune share/man/man1/typefortune.1" ================================================ FILE: packages/gtypist/dont_build_manpage.patch ================================================ diff -u -r ../gtypist-2.9.4/src/Makefile.in ./src/Makefile.in --- ../gtypist-2.9.4/src/Makefile.in 2014-02-02 14:06:58.000000000 +0100 +++ ./src/Makefile.in 2014-03-01 01:38:51.000000000 +0100 @@ -324,7 +324,6 @@ # GEN_MAN is a shell command that generates the man page -man_MANS = gtypist.1 MAINTAINERCLEANFILES = gtypist.1 all: all-am ================================================ FILE: packages/gtypist/src-cursmenu.c.patch ================================================ diff -u -r ../gtypist-2.9.5/src/cursmenu.c ./src/cursmenu.c --- ../gtypist-2.9.5/src/cursmenu.c 2013-08-18 14:36:14.000000000 +0000 +++ ./src/cursmenu.c 2017-07-07 08:35:39.553927999 +0000 @@ -20,6 +20,7 @@ #include "config.h" #include "cursmenu.h" #include "script.h" +#include "utf8.h" #ifdef HAVE_PDCURSES #include ================================================ FILE: packages/gtypist/src-gtypist.c.patch ================================================ diff -u -r ../gtypist-2.9.5/src/gtypist.c ./src/gtypist.c --- ../gtypist-2.9.5/src/gtypist.c 2014-08-12 06:29:13.000000000 +0000 +++ ./src/gtypist.c 2017-07-07 08:34:41.950574988 +0000 @@ -21,6 +21,7 @@ */ #include "config.h" +#include "utf8.h" #include #include #include @@ -42,7 +43,7 @@ #include #include #include -#ifndef MINGW +#if !defined(MINGW) && !defined(__ANDROID__) #include #endif @@ -62,6 +63,8 @@ char* locale_encoding; /* current locale's encoding */ int isUTF8Locale; /* does the current locale have a UTF-8 encoding? */ +void check_script_file_with_current_encoding( FILE *script ); + /* character to be display to represent "enter key" */ /* TODO: this requires beginner mode! #define RETURN_CHARACTER 0x000023CE */ @@ -139,7 +142,7 @@ #define ADDCH_REV(X) wideaddch_rev(X) -#ifdef MINGW +#if defined(MINGW) || defined(__ANDROID__) #define MIN( a, b ) ( ( a ) < ( b )? ( a ) : ( b ) ) #define MAX( a, b ) ( ( a ) > ( b )? ( a ) : ( b ) ) #endif @@ -2010,7 +2013,7 @@ textdomain (PACKAGE); #endif -#ifdef MINGW +#if defined(MINGW) || defined(__ANDROID__) locale_encoding = "UTF-8"; #else locale_encoding = nl_langinfo(CODESET); ================================================ FILE: packages/gtypist/src-utf8.c.patch ================================================ diff -u -r ../gtypist-2.9.5/src/utf8.c ./src/utf8.c --- ../gtypist-2.9.5/src/utf8.c 2013-08-18 14:36:14.000000000 +0000 +++ ./src/utf8.c 2017-07-07 08:32:20.764160765 +0000 @@ -19,6 +19,7 @@ #include "config.h" #include "utf8.h" +#include "error.h" #ifdef HAVE_PDCURSES #include ================================================ FILE: packages/gumbo-parser/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/google/gumbo-parser TERMUX_PKG_DESCRIPTION="An HTML5 parsing library" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_VERSION=0.10.1 TERMUX_PKG_SRCURL=https://github.com/google/gumbo-parser/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=28463053d44a5dfbc4b77bcf49c8cee119338ffa636cc17fc3378421d714efad termux_step_pre_configure() { ./autogen.sh } ================================================ FILE: packages/gzip/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gzip/ TERMUX_PKG_DESCRIPTION="Standard GNU file compression utilities" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=1.10 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gzip/gzip-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=8425ccac99872d544d4310305f915f5ea81e04d0f437ef1a230dc9d1c819d7c0 TERMUX_PKG_ESSENTIAL=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_path_GREP=grep" termux_step_pre_configure() { if [ $TERMUX_ARCH = i686 ]; then # Avoid text relocations export DEFS="NO_ASM" fi } ================================================ FILE: packages/gzip/fix-gzexe.patch ================================================ diff -uNr gzip-1.9/gzexe.in gzip-1.9.mod/gzexe.in --- gzip-1.9/gzexe.in 2018-01-07 07:05:21.000000000 +0200 +++ gzip-1.9.mod/gzexe.in 2018-03-05 21:35:50.589287700 +0200 @@ -113,7 +113,7 @@ esac dir=`dirname "$file"` || dir=$TMPDIR - test -d "$dir" && test -w "$dir" && test -x "$dir" || dir=/tmp + test -d "$dir" && test -w "$dir" && test -x "$dir" || dir=@TERMUX_PREFIX@/tmp test -n "$tmp" && rm -f "$tmp" if test -z "$mktemp_status"; then type mktemp >/dev/null 2>&1 @@ -144,8 +144,9 @@ fi if test $decomp -eq 0; then (cat <<'EOF' && -#!/bin/sh -skip=44 +#!@TERMUX_PREFIX@/bin/sh +skip=50 +set -e tab=' ' nl=' @@ -164,7 +165,7 @@ case $TMPDIR in / | /*/) ;; /*) TMPDIR=$TMPDIR/;; - *) TMPDIR=/tmp/;; + *) TMPDIR=@TERMUX_PREFIX@/tmp/;; esac if type mktemp >/dev/null 2>&1; then gztmpdir=`mktemp -d "${TMPDIR}gztmpXXXXXXXXX"` @@ -201,7 +202,7 @@ else # decompression - skip=44 + skip=50 skip_line=`sed -e 1d -e 2q "$file"` case $skip_line in skip=[0-9] | skip=[0-9][0-9] | skip=[0-9][0-9][0-9]) ================================================ FILE: packages/gzip/lib-stdio-impl.h.patch ================================================ diff -u -r ../gzip-1.10/lib/stdio-impl.h ./lib/stdio-impl.h --- ../gzip-1.10/lib/stdio-impl.h 2018-06-25 04:09:24.000000000 +0000 +++ ./lib/stdio-impl.h 2019-01-03 00:28:58.881820632 +0000 @@ -60,7 +60,7 @@ # define _flags pub._flags # define _r pub._r # define _w pub._w -# elif defined __ANDROID__ /* Android */ +# elif defined __ANDROID_BUT_THIS_IS_BROKEN__ /* Android */ /* Up to this commit from 2015-10-12 the innards of FILE were public, and fp_ub could be defined like for OpenBSD, ================================================ FILE: packages/gzip/zdiff.in.patch ================================================ diff -uNr gzip-1.10/zdiff.in gzip-1.10.mod/zdiff.in --- gzip-1.10/zdiff.in 2018-03-31 06:55:32.000000000 +0300 +++ gzip-1.10.mod/zdiff.in 2019-03-01 18:41:43.685032331 +0200 @@ -119,7 +119,7 @@ case $TMPDIR in / | /*/) ;; /*) TMPDIR=$TMPDIR/;; - *) TMPDIR=/tmp/;; + *) TMPDIR=@TERMUX_PREFIX@/tmp/;; esac if type mktemp >/dev/null 2>&1; then tmp=`mktemp "${TMPDIR}zdiffXXXXXXXXX"` || ================================================ FILE: packages/gzip/zgrep.in.patch ================================================ diff -uNr gzip-1.10/zgrep.in gzip-1.10.mod/zgrep.in --- gzip-1.10/zgrep.in 2018-03-31 06:55:32.000000000 +0300 +++ gzip-1.10.mod/zgrep.in 2019-03-01 18:41:31.001645453 +0200 @@ -136,7 +136,7 @@ case $TMPDIR in / | /*/) ;; /*) TMPDIR=$TMPDIR/;; - *) TMPDIR=/tmp/;; + *) TMPDIR=@TERMUX_PREFIX@/tmp/;; esac if type mktemp >/dev/null 2>&1; then pattmp=$(mktemp "${TMPDIR}zgrepXXXXXXXXX") || exit 2 ================================================ FILE: packages/harfbuzz/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.freedesktop.org/wiki/Software/HarfBuzz/ TERMUX_PKG_DESCRIPTION="OpenType text shaping engine" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=2.6.4 TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/harfbuzz-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=9413b8d96132d699687ef914ebb8c50440efc87b3f775d25856d7ec347c03c12 TERMUX_PKG_DEPENDS="freetype, glib, libbz2, libc++, libpng, libgraphite" TERMUX_PKG_BREAKS="harfbuzz-dev" TERMUX_PKG_REPLACES="harfbuzz-dev" TERMUX_PKG_BUILD_DEPENDS="libicu" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-icu=yes --with-graphite2=yes --disable-gtk-doc-html" ================================================ FILE: packages/harfbuzz/harfbuzz-icu.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="lib/libharfbuzz-icu*" TERMUX_SUBPKG_DESCRIPTION="OpenType text shaping engine ICU backend" TERMUX_SUBPKG_DEPENDS="libicu" ================================================ FILE: packages/harfbuzz/harfbuzz-utils.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="bin/" TERMUX_SUBPKG_DESCRIPTION="Tools using the harfbuzz library" TERMUX_SUBPKG_DEPENDS="libcairo, fontconfig, liblzma, libpixman, libxml2" ================================================ FILE: packages/hashdeep/PRIu_PRId.patch ================================================ --- ../display.cpp.orig 2018-09-14 05:18:09.639671232 +0000 +++ ./src/display.cpp 2018-09-14 05:31:01.173668070 +0000 @@ -311,7 +311,13 @@ ss << mb_read << "MB of " << fdht->stat_megs() << "MB done, "; char msg[64]; - snprintf(msg,sizeof(msg),"%02"PRIu64":%02"PRIu64":%02"PRIu64" left", hour, min, seconds); + snprintf(msg,sizeof(msg),"%02" + PRIu64 + ":%02" + PRIu64 + ":%02" + PRIu64 + " left", hour, min, seconds); ss << msg; } ss << "\r"; @@ -424,14 +430,23 @@ if (opt_verbose) { if(opt_verbose >= MORE_VERBOSE){ - status(" Input files examined: %"PRIu64, this->match.total); - status(" Known files expecting: %"PRIu64, this->match.expect); + status(" Input files examined: %" + PRIu64 + , this->match.total); + status(" Known files expecting: %" + PRIu64 + , this->match.expect); } - status(" Files matched: %"PRIu64, this->match.exact); - status("Files partially matched: %"PRIu64, this->match.partial); - status(" Files moved: %"PRIu64, this->match.moved); - status(" New files found: %"PRIu64, this->match.unknown); - status(" Known files not found: %"PRIu64, this->match.unused); + status(" Files matched: %" + PRIu64, this->match.exact); + status("Files partially matched: %" + PRIu64, this->match.partial); + status(" Files moved: %" + PRIu64, this->match.moved); + status(" New files found: %" + PRIu64, this->match.unknown); + status(" Known files not found: %" + PRIu64, this->match.unused); } } --- ../files.cpp.orig 2018-09-14 05:40:44.400251202 +0000 +++ ./src/files.cpp 2018-09-14 05:53:37.048950212 +0000 @@ -509,7 +509,8 @@ // Users expect the line numbers to start at one, not zero. if ((!ocb.opt_silent) || (mode_warn_only)) { - ocb.error("%s: No hash found in line %"PRIu32, fn, count + 1); + ocb.error("%s: No hash found in line %" + PRIu32, fn, count + 1); ocb.error("%s: %s", fn, strerror(errno)); return status_t::STATUS_USER_ERROR; } @@ -542,7 +543,9 @@ } if (expected_hashes != count){ - ocb.error("%s: Expecting %"PRIu32" hashes, found %"PRIu32"\n", + ocb.error("%s: Expecting %" + PRIu32" hashes, found %" + PRIu32"\n", fn, expected_hashes, count); } return status_t::status_ok; --- ../hash.cpp.orig 2018-09-14 05:18:30.955822289 +0000 +++ ./src/hash.cpp 2018-09-14 05:31:24.777749460 +0000 @@ -124,7 +124,9 @@ // If an error occured, display a message and see if we need to quit. if ((current_read_bytes<0) || (this->handle && ferror(this->handle))){ - ocb->error_filename(this->file_name,"error at offset %"PRIu64": %s", + ocb->error_filename(this->file_name,"error at offset %" + PRIu64 + ": %s", request_start, strerror(errno)); if (file_fatal_error()){ --- ../hashlist.cpp.orig 2018-09-14 05:32:48.130337357 +0000 +++ ./src/hashlist.cpp 2018-09-14 05:33:08.194462187 +0000 @@ -342,7 +342,8 @@ file_data_t *t = new (std::nothrow) file_data_t(); if (NULL == t) { - ocb->fatal_error("%s: Out of memory in line %"PRIu64, + ocb->fatal_error("%s: Out of memory in line %" + PRIu64, fn.c_str(), line_number); } @@ -390,7 +391,8 @@ if ( !algorithm_t::valid_hash(hash_column[column_number],word)) { if (ocb) - ocb->error("%s: Invalid %s hash in line %"PRIu64, + ocb->error("%s: Invalid %s hash in line %" + PRIu64, fn.c_str(), hashes[hash_column[column_number]].name.c_str(), line_number); --- ../xml.h.orig 2018-09-14 05:12:00.783661170 +0000 +++ ./src/xml.h 2018-09-14 05:29:23.697673797 +0000 @@ -100,7 +100,8 @@ void xmlout(const std::string &tag,const std::string &value){ xmlout(tag,value,"",true); } void xmlout(const std::string &tag,const int value){ xmlprintf(tag,"","%d",value); } void xmloutl(const std::string &tag,const long value){ xmlprintf(tag,"","%ld",value); } - void xmlout(const std::string &tag,const int64_t value){ xmlprintf(tag,"","%"PRId64,value); } + void xmlout(const std::string &tag,const int64_t value){ xmlprintf(tag,"","%" + PRId64,value); } void xmlout(const std::string &tag,const double value){ xmlprintf(tag,"","%f",value); } void xmlout(const std::string &tag,const struct timeval &ts){ xmlprintf(tag,"","%d.%06d",(int)ts.tv_sec, (int)ts.tv_usec); ================================================ FILE: packages/hashdeep/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://md5deep.sourceforge.net/ TERMUX_PKG_DESCRIPTION="Programs to compute hashsums of arbitrary number of files recursively" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=4.4 TERMUX_PKG_REVISION=5 TERMUX_PKG_SRCURL=https://github.com/jessek/hashdeep/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=ad78d42142f9a74fe8ec0c61bc78d6588a528cbb9aede9440f50b6ff477f3a7f TERMUX_PKG_DEPENDS="libc++" termux_step_pre_configure() { sh bootstrap.sh CPPFLAGS+=" -DTERMUX_EXPOSE_FILE_OFFSET64=1" } ================================================ FILE: packages/hashdeep/configure.ac.patch ================================================ Remove -MD option as that avoids pie wrapper script functionality. diff -u -r ../hashdeep-4.4/configure.ac ./configure.ac --- ../hashdeep-4.4/configure.ac 2015-04-01 02:12:52.000000000 +0200 +++ ./configure.ac 2017-09-23 02:18:08.770776322 +0200 @@ -64,7 +64,7 @@ ################################################################ ### I am a glutten for punishment and this is security-critical software # Check GCC -WARNINGS_TO_TEST="-MD -D_FORTIFY_SOURCE=2 -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes \ +WARNINGS_TO_TEST="-D_FORTIFY_SOURCE=2 -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes \ -Wshadow -Wwrite-strings -Wcast-align -Waggregate-return \ -Wbad-function-cast -Wcast-qual -Wundef -Wredundant-decls -Wdisabled-optimization \ -Wfloat-equal -Wmissing-format-attribute -Wmultichar -Wc++-compat -Wmissing-noreturn -funit-at-a-time" @@ -97,7 +97,7 @@ # -Wcast-qual # -Wmissing-format-attribute - can't get this one right AC_LANG_PUSH(C++) -WARNINGS_TO_TEST="-Wall -MD -D_FORTIFY_SOURCE=2 -Wpointer-arith \ +WARNINGS_TO_TEST="-Wall -D_FORTIFY_SOURCE=2 -Wpointer-arith \ -Wshadow -Wwrite-strings -Wcast-align \ -Wredundant-decls -Wdisabled-optimization \ -Wfloat-equal -Wmultichar -Wmissing-noreturn \ ================================================ FILE: packages/hashdeep/hash.patch ================================================ diff --git a/src/hash.cpp b/src/hash.cpp index 4216157..4c83454 100644 --- a/src/hash.cpp +++ b/src/hash.cpp @@ -279,7 +279,7 @@ void file_data_hasher_t::hash() MAP_FILE| #endif MAP_SHARED,fd,0); - if(fdht->base>0){ + if(fdht->base>(void *)0){ /* mmap is successful, so set the bounds. * if it is not successful, we default to reading the fd */ ================================================ FILE: packages/help2man/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/help2man/ TERMUX_PKG_DESCRIPTION="Conversion tool to create man files." TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.47.11 TERMUX_PKG_SRCURL=http://mirrors.kernel.org/gnu/help2man/help2man-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=5985b257f86304c8791842c0c807a37541d0d6807ee973000cf8a3fe6ad47b88 TERMUX_PKG_DEPENDS="perl" TERMUX_PKG_PLATFORM_INDEPENDENT=true TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/hexcurse/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/LonnyGomes/hexcurse TERMUX_PKG_DESCRIPTION="Console hexeditor" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.60.0 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/LonnyGomes/hexcurse/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=f6919e4a824ee354f003f0c42e4c4cef98a93aa7e3aa449caedd13f9a2db5530 TERMUX_PKG_DEPENDS="ncurses" ================================================ FILE: packages/hexcurse/hexcurse.c.patch ================================================ From 37f94f2c1d0a3cc5110b2771e02ed894522d65d3 Mon Sep 17 00:00:00 2001 From: Lonny Gomes Date: Wed, 18 Nov 2015 23:57:31 -0500 Subject: [PATCH] Fixes #23, shows help if no filename argument is supplied --- src/hexcurse.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hexcurse.c b/src/hexcurse.c index 9a275ee..9342eb5 100644 --- a/src/hexcurse.c +++ b/src/hexcurse.c @@ -217,9 +217,13 @@ off_t parseArgs(int argc, char *argv[]) fpINfilename = strdup(argv[0]); } - if (fpINfilename && strcmp(fpINfilename, "")) + if (fpINfilename == NULL) { + print_usage(); + exit(-1); + } else if (fpINfilename && strcmp(fpINfilename, "")) { if ((fpIN = fopen(fpINfilename, "r")) == NULL) exit_err("Could not open file"); + } return ((fpIN != NULL) ? maxLoc(fpIN):0); /* return file length */ } ================================================ FILE: packages/hexedit/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://rigaux.org/hexedit.html TERMUX_PKG_DESCRIPTION="view and edit files in hexadecimal or in ASCII" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.4.2 TERMUX_PKG_SHA256=c81ffb36af9243aefc0887e33dd8e41c4b22d091f1f27d413cbda443b0440d66 TERMUX_PKG_SRCURL=https://github.com/pixel/hexedit/archive/$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_DEPENDS="ncurses" TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { ./autogen.sh } ================================================ FILE: packages/hexyl/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/sharkdp/hexyl TERMUX_PKG_DESCRIPTION="A command-line hex viewer" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.6.0 TERMUX_PKG_SRCURL=https://github.com/sharkdp/hexyl/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=5031b20c13b3ccb27abbf119b54609cef16c4152aca2823ee5c53cd5f434b97e TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/heyu/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.heyu.org/ TERMUX_PKG_DESCRIPTION="Program for remotely controlling lights and appliances" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=2.11-rc3 TERMUX_PKG_SHA256=6285f134e03688b5ec03986ef53cce463abc007281996156cac52b61cbeb58b2 TERMUX_PKG_SRCURL=https://github.com/HeyuX10Automation/heyu/archive/v$TERMUX_PKG_VERSION.tar.gz termux_step_pre_configure() { # rindex is an obsolete version of strrchr which is not available in Android: CFLAGS+=" -Drindex=strrchr" export LIBS="-llog" } ================================================ FILE: packages/hfsutils/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.mars.org/home/rob/proj/hfs/ TERMUX_PKG_DESCRIPTION="Tool for manipulating HFS images." TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=3.2.6 TERMUX_PKG_SRCURL=ftp://ftp.mars.org/pub/hfs/hfsutils-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=bc9d22d6d252b920ec9cdf18e00b7655a6189b3f34f42e58d5bb152957289840 TERMUX_PKG_DEPENDS="libandroid-support" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--mandir=$TERMUX_PREFIX/share/man" TERMUX_PKG_BUILD_IN_SRC=true termux_step_post_configure() { mkdir -p ${TERMUX_PREFIX}/share/man/man1 } ================================================ FILE: packages/hfsutils/lfs.patch ================================================ Support >4GiB images. Based on Debian patch --- hfsutils-3.2.6.orig/libhfs/os/unix.c +++ hfsutils-3.2.6/libhfs/os/unix.c @@ -19,6 +19,9 @@ * $Id: unix.c,v 1.8 1998/11/02 22:09:13 rob Exp $ */ +#define _FILE_OFFSET_BITS 64 +#define _LARGE_FILES + # ifdef HAVE_CONFIG_H # include "config.h" # endif ================================================ FILE: packages/hfsutils/replace_hardlink_with_symlink.patch ================================================ diff -ur hfsutils-3.2.6-orig/Makefile.in hfsutils-3.2.6/Makefile.in --- hfsutils-3.2.6-orig/Makefile.in 2017-08-03 04:55:38.195906965 +0200 +++ hfsutils-3.2.6/Makefile.in 2017-08-03 04:57:31.204993434 +0200 @@ -114,11 +114,9 @@ $(BININSTALL) $(HFSUTIL) "$(BINDEST)/." for file in $(CLITARGETS); do \ - $(HARDLINK) "$(BINDEST)/$(HFSUTIL)" "$(BINDEST)/$$file"; \ + ln -sf "$(HFSUTIL)" "$(BINDEST)/$$file"; \ done - rm -f "$(BINDEST)/$(HFSUTIL)" - for file in $(GENERALDOCS) $(CLIDOCS); do \ $(LIBINSTALL) doc/man/$$file \ "$(MANDEST)/man$(MANEXT)/`basename $$file .1`.$(MANEXT)"; \ @@ -232,7 +230,7 @@ -lhfs $(LIBS) $(LIBOBJS) -o $@ $(CLITARGETS): $(HFSUTIL) - -$(HARDLINK) $(HFSUTIL) $@ + -ln -sf $(HFSUTIL) $@ hfssh: $(LIBHFS) hfssh.o tclhfs.o $(UTILOBJS) $(LIBOBJS) $(CC) $(LDFLAGS) hfssh.o tclhfs.o $(UTILOBJS) \ Only in hfsutils-3.2.6: Makefile.in~ ================================================ FILE: packages/hiptext/artiste.cc.patch ================================================ --- hiptext-2.0/src/artiste.cc 2019-03-01 19:40:54.553801723 +0800 +++ hiptext-2.0_mod/src/artiste.cc 2019-03-01 17:33:22.031073100 +0800 @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include ================================================ FILE: packages/hiptext/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/jart/hiptext TERMUX_PKG_DESCRIPTION="Turn images into text better than caca/aalib" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.2 TERMUX_PKG_REVISION=8 TERMUX_PKG_SRCURL=https://github.com/jart/hiptext/releases/download/$TERMUX_PKG_VERSION/hiptext-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=7f2217dec8775b445be6745f7bd439c24ce99c4316a9faf657bee7b42bc72e8f TERMUX_PKG_DEPENDS="ffmpeg, freetype, gflags, google-glog, libjpeg-turbo, libpng, ncurses" TERMUX_PKG_BUILD_DEPENDS="ragel" TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { #Font reference on file font.cc --> Patch by font.cc.patch #Because of ttf-dejavu is x11 package, the hiptext is not a x11 package. install -Dm600 -t "$TERMUX_PREFIX"/share/hiptext/ \ "$TERMUX_PKG_SRCDIR"/DejaVuSansMono.ttf } ================================================ FILE: packages/hiptext/font.cc.patch ================================================ --- hiptext-0.2/src/font.cc 2019-03-03 13:47:56.235315625 +0800 +++ hiptext-0.2_mod/src/font.cc 2019-03-03 13:56:39.610971934 +0800 @@ -11,7 +11,7 @@ #include "hiptext/graphic.h" #include "hiptext/pixel.h" -DEFINE_string(font, "DejaVuSansMono.ttf", +DEFINE_string(font, "@TERMUX_PREFIX@/share/hiptext/DejaVuSansMono.ttf", "The path to the font .ttf file to use."); DEFINE_int32(font_index, 0, "Index of face to use inside font .ttf file."); DEFINE_int32(font_size, 11, "The size of the font in points."); ================================================ FILE: packages/hiptext/movie.cc.patch ================================================ --- hiptext-2.0/src/movie.cc 2019-03-01 19:40:54.553801723 +0800 +++ hiptext-2.0_mod/src/movie.cc 2019-03-01 17:41:38.290586786 +0800 @@ -53,7 +53,7 @@ // Prepare context for scaling and converting to RGB. sws_ = sws_getContext(context_->width, context_->height, context_->pix_fmt, - width_, height_, PIX_FMT_RGB24, SWS_FAST_BILINEAR, + width_, height_, AV_PIX_FMT_RGB24, SWS_FAST_BILINEAR, nullptr, nullptr, nullptr); CHECK(codec_ = avcodec_find_decoder(context_->codec_id)) << "Unsupported codec.\n"; @@ -61,13 +61,13 @@ << "Could not open codec.\n"; // Allocate Raw + RGB frame buffers. - CHECK(frame_ = avcodec_alloc_frame()); - CHECK(frame_rgb_ = avcodec_alloc_frame()); - int rgb_bytes = avpicture_get_size(PIX_FMT_RGB24, width_, height_); + CHECK(frame_ = av_frame_alloc()); + CHECK(frame_rgb_ = av_frame_alloc()); + int rgb_bytes = avpicture_get_size(AV_PIX_FMT_RGB24, width_, height_); buffer_ = static_cast(av_malloc(rgb_bytes)); LOG(INFO) << "RGB Buffer: " << rgb_bytes << " bytes."; int prep = avpicture_fill(reinterpret_cast(frame_rgb_), - buffer_, PIX_FMT_RGB24, width_, height_); + buffer_, AV_PIX_FMT_RGB24, width_, height_); CHECK_GE(prep, 0) << "Failed to prepare RGB buffer."; LOG(INFO) << "RGB dimensions: " << width_ << "x" << height_; } ================================================ FILE: packages/hoedown/Makefile.patch ================================================ diff --git a/Makefile b/Makefile index ebfab0b..1b60b1e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CFLAGS = -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -PREFIX = /usr/local +PREFIX = @TERMUX_PREFIX@ BINDIR = $(PREFIX)/bin LIBDIR = $(PREFIX)/lib INCLUDEDIR = $(PREFIX)/include ================================================ FILE: packages/hoedown/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/hoedown/hoedown TERMUX_PKG_DESCRIPTION="Hoedown is a revived fork of Sundown, the Markdown parser based on the original code of the Upskirt library" TERMUX_PKG_LICENSE="ISC" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=3.0.7 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/hoedown/hoedown/archive/$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=01b6021b1ec329b70687c0d240b12edcaf09c4aa28423ddf344d2bd9056ba920 TERMUX_PKG_BREAKS="hoedown-dev" TERMUX_PKG_REPLACES="hoedown-dev" TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/htop/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://hisham.hm/htop/ TERMUX_PKG_DESCRIPTION="Interactive process viewer for Linux" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.2.0 TERMUX_PKG_REVISION=2 TERMUX_PKG_SHA256=d9d6826f10ce3887950d709b53ee1d8c1849a70fa38e91d5896ad8cbc6ba3c57 TERMUX_PKG_SRCURL=http://hisham.hm/htop/releases/${TERMUX_PKG_VERSION}/htop-${TERMUX_PKG_VERSION}.tar.gz # htop checks setlocale() return value for UTF-8 support, so use libandroid-support. TERMUX_PKG_DEPENDS="ncurses, libandroid-support" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_RM_AFTER_INSTALL="share/applications share/pixmaps" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" ac_cv_lib_ncursesw6_addnwstr=yes LIBS=-landroid-support " ================================================ FILE: packages/htop/fix-missing-macros.patch ================================================ diff -uNr htop-2.1.0/linux/LinuxProcessList.c htop-2.1.0.mod/linux/LinuxProcessList.c --- htop-2.1.0/linux/LinuxProcessList.c 2018-02-04 20:57:13.000000000 +0200 +++ htop-2.1.0.mod/linux/LinuxProcessList.c 2018-03-05 17:57:46.901891199 +0200 @@ -37,6 +37,14 @@ #include #endif +#ifndef major +#define major(rdev) ((rdev)>>8) +#endif + +#ifndef minor +#define minor(rdev) ((rdev) & 0xff) +#endif + /*{ #include "ProcessList.h" @@ -241,7 +249,7 @@ // Update CPU count: FILE* file = fopen(PROCSTATFILE, "r"); if (file == NULL) { - CRT_fatalError("Cannot open " PROCSTATFILE); + return pl; } char buffer[PROC_LINE_LENGTH + 1]; int cpus = -1; @@ -966,7 +974,7 @@ FILE* file = fopen(PROCSTATFILE, "r"); if (file == NULL) { - CRT_fatalError("Cannot open " PROCSTATFILE); + return 0; } int cpus = this->super.cpuCount; assert(cpus > 0); diff -uNr htop-2.1.0/Process.c htop-2.1.0.mod/Process.c --- htop-2.1.0/Process.c 2018-02-04 20:57:13.000000000 +0200 +++ htop-2.1.0.mod/Process.c 2018-03-05 17:59:16.522983619 +0200 @@ -29,6 +29,14 @@ #include #include +#ifndef major +#define major(rdev) ((rdev)>>8) +#endif + +#ifndef minor +#define minor(rdev) ((rdev) & 0xff) +#endif + #ifdef __ANDROID__ #define SYS_ioprio_get __NR_ioprio_get #define SYS_ioprio_set __NR_ioprio_set ================================================ FILE: packages/httping/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.vanheusden.com/httping/ TERMUX_PKG_DESCRIPTION="ping-like program for http-requests" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.5 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://fossies.org/linux/www/httping-${TERMUX_PKG_VERSION}.tgz TERMUX_PKG_SHA256=3e895a0a6d7bd79de25a255a1376d4da88eb09c34efdd0476ab5a907e75bfaf8 TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_DEPENDS="fftw, libandroid-support, ncurses, openssl" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-fftw3 --with-ncurses --with-openssl" TERMUX_PKG_MAINTAINER="Pierre Rudloff @Rudloff" ================================================ FILE: packages/httping/fix-spam_file-path.patch ================================================ diff -uNr httping-2.5/gen.h httping-2.5.mod/gen.h --- httping-2.5/gen.h 2016-09-12 10:45:50.000000000 +0300 +++ httping-2.5.mod/gen.h 2017-09-14 13:30:46.432863081 +0300 @@ -12,7 +12,7 @@ #define RECV_BUFFER_SIZE (128 * 1024) -#define SPAM_FILE "/tmp/httping.dat" +#define SPAM_FILE "@TERMUX_PREFIX@/tmp/httping.dat" #define MAX_SHOW_SUPPRESSION 3 ================================================ FILE: packages/httping/mssl.c.patch ================================================ diff -u -r ../httping-2.5/mssl.c ./mssl.c --- ../httping-2.5/mssl.c 2016-09-12 07:45:50.000000000 +0000 +++ ./mssl.c 2018-08-23 19:38:43.467717597 +0000 @@ -35,7 +35,9 @@ ERR_free_strings(); ERR_remove_state(0); +#ifndef OPENSSL_NO_ENGINE ENGINE_cleanup(); +#endif CONF_modules_free(); EVP_cleanup(); CRYPTO_cleanup_all_ex_data(); ================================================ FILE: packages/httrack/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.httrack.com TERMUX_PKG_DESCRIPTION="It allows you to download a World Wide Web site from the Internet" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=3.49.2 TERMUX_PKG_REVISION=8 TERMUX_PKG_SRCURL=http://mirror.httrack.com/historical/httrack-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=3477a0e5568e241c63c9899accbfcdb6aadef2812fcce0173688567b4c7d4025 TERMUX_PKG_DEPENDS="libiconv, openssl, zlib" TERMUX_PKG_BREAKS="httrack-dev" TERMUX_PKG_REPLACES="httrack-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-zlib=$TERMUX_PREFIX LIBS=-liconv" TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/httrack/htsglobal.h.patch ================================================ --- httrack-3.49.2/src/htsglobal.h 2017-05-20 14:03:03.000000000 +0530 +++ htsglobal.h 2018-04-10 11:16:00.468000020 +0530 @@ -178,16 +178,16 @@ #else #ifndef HTS_ETCPATH -#define HTS_ETCPATH "/etc" +#define HTS_ETCPATH "@TERMUX_PREFIX@/etc" #endif #ifndef HTS_BINPATH -#define HTS_BINPATH "/usr/bin" +#define HTS_BINPATH "@TERMUX_PREFIX@/bin" #endif #ifndef HTS_LIBPATH -#define HTS_LIBPATH "/usr/lib" +#define HTS_LIBPATH "@TERMUX_PREFIX@/lib" #endif #ifndef HTS_PREFIX -#define HTS_PREFIX "/usr" +#define HTS_PREFIX "@TERMUX_PREFIX@" #endif #define HTS_HTTRACKRC ".httrackrc" @@ -196,7 +196,7 @@ #ifdef DATADIR #define HTS_HTTRACKDIR DATADIR"/httrack/" #else -#define HTS_HTTRACKDIR HTS_PREFIX"/share/httrack/" +#define HTS_HTTRACKDIR HTS_PREFIX"@TERMUX_PREFIX@/share/httrack/" #endif #endif ================================================ FILE: packages/httrack/store.c.patch ================================================ --- httrack-3.49.2/src/proxy/store.c 2017-04-02 01:08:17.000000000 +0530 +++ store.c 2018-04-10 12:10:59.385000003 +0530 @@ -30,9 +30,9 @@ #include #include #include -#ifdef __ANDROID__ +/* #ifdef __ANDROID__ static long int timezone = 0; -#endif +#endif */ /* Locking */ #ifdef _WIN32 @@ -1941,7 +1941,7 @@ if (t != (time_t) - 1 && t != (time_t) 0) { /* BSD does not have static "timezone" declared */ -#if (defined(BSD) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD_kernel__)) +#if (defined(BSD) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD_kernel__)) || defined(__ANDROID__) time_t now = time(NULL); time_t timezone = -localtime(&now)->tm_gmtoff; #endif ================================================ FILE: packages/hub/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://hub.github.com/ TERMUX_PKG_DESCRIPTION="Command-line wrapper for git that makes you better at GitHub" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=2.13.0 TERMUX_PKG_SRCURL=https://github.com/github/hub/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=0b5147a25aa8dff37d6c88b2a30ed38c05d35e03c64d79039925dcb49de80940 TERMUX_PKG_DEPENDS="git" termux_step_make_install() { termux_setup_golang cd $TERMUX_PKG_SRCDIR export GOPATH="${TERMUX_PKG_BUILDDIR}" mkdir -p "${GOPATH}/src/github.com/github" cp -a "${TERMUX_PKG_SRCDIR}" "${GOPATH}/src/github.com/github/hub" cd "${GOPATH}/src/github.com/github/hub" make bin/hub prefix=$TERMUX_PREFIX cp ./bin/hub $TERMUX_PREFIX/bin/hub } ================================================ FILE: packages/hub/utils-utils.go.patch ================================================ diff -uNr hub-2.12.1/utils/utils.go hub-2.12.1.mod/utils/utils.go --- hub-2.12.1/utils/utils.go 2019-06-28 23:19:41.000000000 +0300 +++ hub-2.12.1.mod/utils/utils.go 2019-06-29 17:11:57.853729989 +0300 @@ -30,7 +30,7 @@ func BrowserLauncher() ([]string, error) { browser := os.Getenv("BROWSER") if browser == "" { - browser = searchBrowserLauncher(runtime.GOOS) + browser = "termux-open" } else { browser = os.ExpandEnv(browser) } ================================================ FILE: packages/hugo/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://gohugo.io/ TERMUX_PKG_DESCRIPTION="A fast and flexible static site generator" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_VERSION=0.60.1 TERMUX_PKG_SRCURL=https://github.com/gohugoio/hugo/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=5c857cb27a4e1b43477f6775f2b2e870b937e9ebf32f52347ba7fdbde1ee50f7 TERMUX_PKG_DEPENDS="libc++" termux_step_make() { termux_setup_golang export GOPATH=$TERMUX_PKG_BUILDDIR cd $TERMUX_PKG_SRCDIR go build \ -o "$TERMUX_PREFIX/bin/hugo" \ -tags "linux extended" \ main.go # "linux" tag should not be necessary # try removing when golang version is upgraded # Building for host to generate manpages and completion. chmod 700 -R $GOPATH/pkg && rm -rf $GOPATH/pkg unset GOOS GOARCH CGO_LDFLAGS unset CC CXX CFLAGS CXXFLAGS LDFLAGS go build \ -o "$TERMUX_PKG_BUILDDIR/hugo" \ -tags "linux extended" \ main.go # "linux" tag should not be necessary # try removing when golang version is upgraded } termux_step_make_install() { mkdir -p $TERMUX_PREFIX/share/{bash-completion/completions,man/man1} $TERMUX_PKG_BUILDDIR/hugo gen autocomplete \ --completionfile=$TERMUX_PREFIX/share/bash-completion/completions/hugo $TERMUX_PKG_BUILDDIR/hugo gen man \ --dir=$TERMUX_PREFIX/share/man/man1/ } ================================================ FILE: packages/hunspell/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://hunspell.github.io TERMUX_PKG_DESCRIPTION="Spell checker" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.7.0 TERMUX_PKG_REVISION=5 TERMUX_PKG_SRCURL=https://github.com/hunspell/hunspell/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=bb27b86eb910a8285407cf3ca33b62643a02798cf2eef468c0a74f6c3ee6bc8a TERMUX_PKG_DEPENDS="libc++, libiconv, ncurses, readline, hunspell-en-us" TERMUX_PKG_BREAKS="hunspell-dev" TERMUX_PKG_REPLACES="hunspell-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-ui --with-readline" TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { autoreconf -vfi } ================================================ FILE: packages/hunspell/fix-hardcoded-paths.patch ================================================ diff -uNr hunspell-1.6.1/src/tools/hunspell.cxx hunspell-1.6.1.mod/src/tools/hunspell.cxx --- hunspell-1.6.1/src/tools/hunspell.cxx 2017-09-14 13:34:22.032862927 +0300 +++ hunspell-1.6.1.mod/src/tools/hunspell.cxx 2017-09-14 13:35:48.482862865 +0300 @@ -660,7 +660,7 @@ const char* extension = (filename) ? basename(filename, '.') : NULL; TextParser* parser = get_parser(format, extension, pMS[0]); - char tmpdirtemplate[] = "/tmp/hunspellXXXXXX"; + char tmpdirtemplate[] = "@TERMUX_PREFIX@/tmp/hunspellXXXXXX"; bool bZippedOdf = is_zipped_odf(parser, extension); // access content.xml of ODF @@ -1567,7 +1567,7 @@ const char* extension = basename(filename, '.'); TextParser* parser = get_parser(format, extension, pMS[0]); - char tmpdirtemplate[] = "/tmp/hunspellXXXXXX"; + char tmpdirtemplate[] = "@TERMUX_PREFIX@/tmp/hunspellXXXXXX"; bool bZippedOdf = is_zipped_odf(parser, extension); // access content.xml of ODF diff -uNr hunspell-1.6.1/src/tools/hzip.cxx hunspell-1.6.1.mod/src/tools/hzip.cxx --- hunspell-1.6.1/src/tools/hzip.cxx 2017-03-25 23:20:45.000000000 +0200 +++ hunspell-1.6.1.mod/src/tools/hzip.cxx 2017-09-14 13:36:09.462862850 +0300 @@ -343,7 +343,7 @@ if (!f) return fail("hzip: %s: Permission denied\n", filename); - char tmpfiletemplate[] = "/tmp/hunspellXXXXXX"; + char tmpfiletemplate[] = "@TERMUX_PREFIX@/tmp/hunspellXXXXXX"; mode_t mask = umask(S_IXUSR | S_IRWXG | S_IRWXO); int tempfileno = mkstemp(tmpfiletemplate); umask(mask); ================================================ FILE: packages/hunspell/src-tools-hunspell.cxx.patch ================================================ diff -u -r ../hunspell-1.4.1/src/tools/hunspell.cxx ./src/tools/hunspell.cxx --- ../hunspell-1.4.1/src/tools/hunspell.cxx 2016-05-03 03:55:52.000000000 -0400 +++ ./src/tools/hunspell.cxx 2016-05-03 06:49:59.025455094 -0400 @@ -113,7 +113,7 @@ #include "odfparser.hxx" #define LIBDIR \ - "/usr/share/hunspell:" \ + "@TERMUX_PREFIX@/share/hunspell:" \ "/usr/share/myspell:" \ "/usr/share/myspell/dicts:" \ "/Library/Spelling" @@ -137,7 +137,7 @@ "/usr/lib/openoffice.org2.0/share/dict/ooo" #define HOME getenv("HOME") #define DICBASENAME ".hunspell_" -#define LOGFILE "/tmp/hunspell.log" +#define LOGFILE "@TERMUX_PREFIX@/tmp/hunspell.log" #define DIRSEPCH '/' #define DIRSEP "/" #define PATHSEP ":" ================================================ FILE: packages/hunspell-en-us/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://hunspell.github.io TERMUX_PKG_DESCRIPTION="American english dictionary for hunspell" TERMUX_PKG_LICENSE="LGPL-3.0" TERMUX_PKG_VERSION=20181025 TERMUX_PKG_REVISION=1 TERMUX_PKG_SKIP_SRC_EXTRACT=true TERMUX_PKG_PLATFORM_INDEPENDENT=true termux_step_make_install() { mkdir -p $TERMUX_PREFIX/share/hunspell/ # On checksum mismatch the files may have been updated: # https://cgit.freedesktop.org/libreoffice/dictionaries/log/en/en_US.aff # https://cgit.freedesktop.org/libreoffice/dictionaries/log/en/en_US.dic # In which case we need to bump version and checksum used. termux_download https://cgit.freedesktop.org/libreoffice/dictionaries/plain/en/en_US.aff \ $TERMUX_PREFIX/share/hunspell/en_US.aff \ c7a8c4d08c29d237880844b1623099f59092602f189be38ce3912e457ff38bc1 termux_download https://cgit.freedesktop.org/libreoffice/dictionaries/plain/en/en_US.dic \ $TERMUX_PREFIX/share/hunspell/en_US.dic \ e2aec1aff3e2b840c59e2a4f49f7eb9388b6078c681d960153fc72ce183086cc touch $TERMUX_PREFIX/share/hunspell/en_US.{aff,dic} } ================================================ FILE: packages/hunspell-ru/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://hunspell.github.io TERMUX_PKG_DESCRIPTION="Russian dictionary for hunspell" TERMUX_PKG_LICENSE="LGPL-3.0" TERMUX_PKG_VERSION=20170303 TERMUX_PKG_SKIP_SRC_EXTRACT=true TERMUX_PKG_PLATFORM_INDEPENDENT=true termux_step_make_install() { mkdir -p $TERMUX_PREFIX/share/hunspell/ # On checksum mismatch the files may have been updated: # https://cgit.freedesktop.org/libreoffice/dictionaries/log/ru_RU/ru_RU.aff # https://cgit.freedesktop.org/libreoffice/dictionaries/log/ru_RU/ru_RU.dic # In which case we need to bump version and checksum used. termux_download https://cgit.freedesktop.org/libreoffice/dictionaries/plain/ru_RU/ru_RU.aff \ $TERMUX_PREFIX/share/hunspell/ru_RU.aff \ 709cf9b41208961226e995a3ab75a2da834aaf4f9707cb87cbb37d4943b6a50d termux_download https://cgit.freedesktop.org/libreoffice/dictionaries/plain/ru_RU/ru_RU.dic \ $TERMUX_PREFIX/share/hunspell/ru_RU.dic \ c0d81126b0a905ccc6fd891c923b43d39b4ce449da5a333859229354c510168f touch $TERMUX_PREFIX/share/hunspell/ru_RU.{aff,dic} } ================================================ FILE: packages/hydra/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/vanhauser-thc/thc-hydra TERMUX_PKG_DESCRIPTION="Network logon cracker supporting different services" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=9.0 TERMUX_PKG_SHA256=56672e253c128abaa6fb19e77f6f59ba6a93762a9ba435505a009ef6d58e8d0e TERMUX_PKG_SRCURL=https://github.com/vanhauser-thc/thc-hydra/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_DEPENDS="openssl, pcre, libssh" termux_step_configure() { # Skip the ./configure file (which does not support cross compilation) # and configure the build manually. CFLAGS+=" -Dindex=strchr -DLIBOPENSSL -DNO_RINDEX -DHAVE_MATH_H -DHAVE_PCRE -DLIBSSH" export MANDIR=/share/man/man1 export XLIBS="-lcrypto -lssl -lpcre -lssh" cat Makefile.am | sed 's/^install:.*/install: all/' >> Makefile } ================================================ FILE: packages/hydra/hydra.c.patch ================================================ It's probably safe to assume color support in terminals without linking against and checking with ncurses. diff -u -r ../thc-hydra-8.4/hydra.c ./hydra.c --- ../thc-hydra-8.4/hydra.c 2017-01-27 17:19:18.000000000 +0100 +++ ./hydra.c 2017-01-31 13:37:34.496298083 +0100 @@ -2622,10 +2622,6 @@ colored_output = 0; } } -#else - //don't want border line effect so disabling color output - //if we are not sure about the term - colored_output = 0; #endif if (debug) ================================================ FILE: packages/hyperfine/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/sharkdp/hyperfine TERMUX_PKG_DESCRIPTION="A command-line benchmarking tool" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.9.0 TERMUX_PKG_SRCURL=https://github.com/sharkdp/hyperfine/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=c2b1c6b6364b849acad43dc740c693f5b75a1a4649f24f43967a98c59ad9e9f7 TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/icecast/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://icecast.org TERMUX_PKG_DESCRIPTION="Icecast is a streaming media (audio/video) server" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.4.4 TERMUX_PKG_SRCURL=https://downloads.xiph.org/releases/icecast/icecast-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=49b5979f9f614140b6a38046154203ee28218d8fc549888596a683ad604e4d44 TERMUX_PKG_DEPENDS="libcurl, libgnutls, libogg, libvorbis, libxml2, libxslt, mime-support, openssl" TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { perl -p -i -e "s#/etc/mime.types#$TERMUX_PREFIX/etc/mime.types#" $TERMUX_PKG_SRCDIR/src/cfgfile.c } ================================================ FILE: packages/icecast/thread.c.patch ================================================ --- ../../build/icecast/cache/icecast-2.4.3/src/thread/thread.c 2015-12-27 17:46:32.000000000 +0100 +++ ./src/thread/thread.c 2017-01-01 22:52:28.256272825 +0100 @@ -294,10 +294,10 @@ start->thread = thread; pthread_attr_setstacksize (&attr, 512*1024); - pthread_attr_setinheritsched (&attr, PTHREAD_INHERIT_SCHED); + //pthread_attr_setinheritsched (&attr, PTHREAD_INHERIT_SCHED); if (detached) { - pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); + //pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); thread->detached = 1; } @@ -651,7 +651,7 @@ LOG_INFO4("Added thread %d [%s] started at [%s:%d]", thread->thread_id, thread->name, thread->file, thread->line); #endif - pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL); + //pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL); free (start); (start_routine)(real_arg); ================================================ FILE: packages/imagemagick/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.imagemagick.org/ TERMUX_PKG_DESCRIPTION="Suite to create, edit, compose, or convert images in a variety of formats" TERMUX_PKG_LICENSE="ImageMagick" TERMUX_PKG_VERSION=7.0.9.5 TERMUX_PKG_SRCURL=https://github.com/ImageMagick/ImageMagick/archive/$(echo $TERMUX_PKG_VERSION | sed 's/\(.*\)\./\1-/').tar.gz TERMUX_PKG_SHA256=d15abd31e7e18f7edec47df156773a23e5100386e55c6ce50f5353e9572d3413 TERMUX_PKG_DEPENDS="fftw, pango, glib, libbz2, libjpeg-turbo, liblzma, libpng, libtiff, libxml2, openjpeg, littlecms, libwebp, librsvg" TERMUX_PKG_BREAKS="imagemagick-dev" TERMUX_PKG_REPLACES="imagemagick-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-largefile --without-x --without-gvc --with-magick-plus-plus=no --with-bzlib=yes --with-xml=yes --with-rsvg=yes --with-lzma --disable-openmp ac_cv_func_ftime=no " TERMUX_PKG_RM_AFTER_INSTALL=" bin/Magick-config bin/MagickCore-config bin/MagickWand-config bin/Wand-config share/ImageMagick-7/francais.xml share/man/man1/Magick-config.1 share/man/man1/MagickCore-config.1 share/man/man1/MagickWand-config.1 share/man/man1/Wand-config.1 " termux_step_pre_configure() { if [ $TERMUX_ARCH = "i686" ]; then # Avoid "libMagickCore-7.Q16HDRI.so: error: undefined reference to '__atomic_load'": LDFLAGS+=" -latomic" fi } ================================================ FILE: packages/imgflo/Makefile.patch ================================================ diff -u -r ../imgflo-0.4.2/Makefile ./Makefile --- ../imgflo-0.4.2/Makefile 2016-08-21 08:46:27.000000000 +0000 +++ ./Makefile 2018-05-17 17:48:06.151296541 +0000 @@ -1,7 +1,5 @@ VERSION=$(shell echo `git describe --tags`) -#PREFIX=/opt/imgflo -PREFIX=$(shell echo `pwd`/install) FLAGS=-Wall -Werror -std=c99 -g DEBUGPROG= PORT=3569 @@ -21,10 +19,10 @@ PKGCONFIG_ARGS:= endif -LIBS=gegl-0.3 libsoup-2.4 +LIBS=gegl-0.4 libsoup-2.4 SYSTEM_LIBS=gio-unix-2.0 json-glib-1.0 libpng -DEPS=$(shell $(PREFIX)/env.sh pkg-config $(PKGCONFIG_ARGS) --libs --cflags $(LIBS)) -DEPS+=$(shell $(PREFIX)/env.sh pkg-config --libs --cflags $(SYSTEM_LIBS)) +DEPS=$(shell pkg-config $(PKGCONFIG_ARGS) --libs --cflags $(LIBS)) +DEPS+=$(shell pkg-config --libs --cflags $(SYSTEM_LIBS)) TRAVIS_DEPENDENCIES=$(shell echo `cat .vendor_urls | sed -e "s/heroku/travis-${TRAVIS_OS_NAME}/" | tr -d '\n'`) RUN_ARGUMENTS:=--port $(PORT) --external-port=$(EXTPORT) @@ -53,31 +51,31 @@ all: install run-noinstall: - $(PREFIX)/env.sh $(DEBUGPROG) ./bin/imgflo-runtime $(RUN_ARGUMENTS) + $(DEBUGPROG) ./bin/imgflo-runtime $(RUN_ARGUMENTS) run: install run-noinstall process: install - $(PREFIX)/env.sh $(DEBUGPROG) ./bin/imgflo $(PROCESS_ARGUMENTS) + $(DEBUGPROG) ./bin/imgflo $(PROCESS_ARGUMENTS) -install: env imgflo imgflo-runtime imgflo-graphinfo +install: imgflo imgflo-runtime imgflo-graphinfo cp ./bin/imgflo $(PREFIX)/bin/ cp ./bin/imgflo-runtime $(PREFIX)/bin/ cp ./bin/imgflo-graphinfo $(PREFIX)/bin/ imgflo: - $(PREFIX)/env.sh $(CC) -o ./bin/imgflo bin/imgflo.c -I. $(FLAGS) $(DEPS) + $(CC) -o ./bin/imgflo bin/imgflo.c -I. $(FLAGS) $(CFLAGS) $(LDFLAGS) $(DEPS) imgflo-graphinfo: - $(PREFIX)/env.sh $(CC) -o ./bin/imgflo-graphinfo bin/imgflo-graphinfo.c -I. $(FLAGS) $(DEPS) + $(CC) -o ./bin/imgflo-graphinfo bin/imgflo-graphinfo.c -I. $(FLAGS) $(CFLAGS) $(LDFLAGS) $(DEPS) imgflo-runtime: - $(PREFIX)/env.sh $(CC) -o ./bin/imgflo-runtime bin/imgflo-runtime.c -I. $(FLAGS) $(DEPS) + $(CC) -o ./bin/imgflo-runtime bin/imgflo-runtime.c -I. $(FLAGS) $(CFLAGS) $(LDFLAGS) $(DEPS) env: - mkdir -p $(PREFIX) || true - sed -e 's|@PREFIX@|$(PREFIX)|' env.sh.in > $(PREFIX)/env.sh - chmod +x $(PREFIX)/env.sh +# mkdir -p $(PREFIX) || true +# sed -e 's|@PREFIX@|$(PREFIX)|' env.sh.in > $(PREFIX)/env.sh +# chmod +x $(PREFIX)/env.sh travis-deps: wget -O imgflo-dependencies.tgz $(TRAVIS_DEPENDENCIES) @@ -93,14 +91,14 @@ COMPONENT_FLAGS += -DIMGFLO_OP_NAME\(orig\)=\"$(COMPONENT_NAME_PREFIX)\"orig\"$(COMPONENT_NAME_SUFFIX)\" endif -component-install-dir: env +component-install-dir: rm -rf $(COMPONENTINSTALLDIR) mkdir -p $(COMPONENTINSTALLDIR) || true components: component-install-dir $(COMPONENT_PLUGINS) component: component-install-dir $(COMPONENT_OUT) $(COMPONENTINSTALLDIR)/%.$(SHAREDLIB_SUFFIX): $(COMPONENTDIR)/%.c - $(PREFIX)/env.sh $(CC) -o $@ $< -DGEGL_OP_C_FILE=\"`basename $<`\" $(COMPONENT_FLAGS) $(DEPS) + $(CC) -o $@ $< -DGEGL_OP_C_FILE=\"`basename $<`\" $(COMPONENT_FLAGS) $(DEPS) dependencies: cd dependencies && make PREFIX=$(PREFIX) dependencies @@ -115,7 +113,7 @@ cd dependencies && make PREFIX=$(PREFIX) glib check: install - $(PREFIX)/env.sh ./node_modules/.bin/mocha --reporter spec --compilers .coffee:coffee-script/register ./spec/*.coffee $(TEST_ARGUMENTS) + ./node_modules/.bin/mocha --reporter spec --compilers .coffee:coffee-script/register ./spec/*.coffee $(TEST_ARGUMENTS) clean: git clean -dfx --exclude node_modules --exclude install ================================================ FILE: packages/imgflo/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.imgflo.org/ TERMUX_PKG_DESCRIPTION="HTTP image processing server & Flowhub.io compatible runtime" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=0.4.2 TERMUX_PKG_REVISION=4 TERMUX_PKG_SRCURL=https://github.com/imgflo/imgflo/archive/$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=4dd5fc9d34f3cfc294fd69a14d50ed5401abeb829132f1b1ac316e28223fc393 TERMUX_PKG_DEPENDS="gegl, libsoup, zlib" TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/imgflo/env.sh.in.patch ================================================ --- ../cache/imgflo-0.4.2/env.sh.in 2016-08-21 08:46:27.000000000 +0000 +++ ./env.sh.in 2017-05-11 02:54:53.849611941 +0000 @@ -1,17 +1,3 @@ #!/bin/bash - -PREFIX="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig:$PKG_CONFIG_PATH -export LD_LIBRARY_PATH=${PREFIX}/lib:$LD_LIBRARY_PATH -export DYLD_LIBRARY_PATH=${PREFIX}/lib:$DYLD_LIBRARY_PATH -export ACLOCAL_PATH=${PREFIX}/share/aclocal:$ACLOCAL_PATH -export PATH=${PREFIX}/bin:$PATH -export GEGL_PATH=${PREFIX}/lib/imgflo/operations:${PREFIX}/lib/gegl-0.3:${GEGL_PATH} -export BABL_PATH=${PREFIX}/lib/babl-0.1 - # If not sourcing the script, execute the command that follows -if [[ "${BASH_SOURCE[0]}" = "${0}" ]]; -then exec "$@" -fi ================================================ FILE: packages/imgflo/library.c.patch ================================================ --- ../cache/imgflo-0.4.2/lib/library.c 2016-08-21 08:46:27.000000000 +0000 +++ ./lib/library.c 2017-05-11 02:57:06.259072817 +0000 @@ -342,12 +342,12 @@ GFile* dir = g_file_get_parent(file); gchar* dir_name = g_file_get_path(dir); - gchar *stdout = NULL; - gchar *stderr = NULL; + //gchar *stdout = NULL; + //gchar *stderr = NULL; gint exitcode = 1; GError *err = NULL; gchar **argv = g_new0(gchar *, 10); - argv[0] = g_strdup("/usr/bin/env"); + argv[0] = g_strdup("@TERMUX_PREFIX@/bin/env"); argv[1] = g_strdup("make"); argv[2] = g_strdup("component"); argv[3] = g_strdup_printf("COMPONENT=%s", component); @@ -358,7 +358,7 @@ const gboolean success = g_spawn_sync(NULL, argv, NULL, G_SPAWN_DEFAULT, NULL, NULL, - &stdout, &stderr, &exitcode, &err); + NULL, NULL, &exitcode, &err); try_print_error(err); if (!success || stderr) { imgflo_message("%s", stderr); ================================================ FILE: packages/imlib2/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://sourceforge.net/projects/enlightenment/ TERMUX_PKG_DESCRIPTION="Library that does image file loading and saving as well as rendering, manipulation, arbitrary polygon support" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.5.1 TERMUX_PKG_REVISION=10 TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/enlightenment/imlib2-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=b25df9347648cf3dfb784c099139ab24157b1dbd1baa9428f103b683b8a78c61 TERMUX_PKG_DEPENDS="freetype, giflib, libandroid-shmem, libbz2, libid3tag, libjpeg-turbo, libpng, libtiff, libxext, zlib" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="LIBS=-landroid-shmem" ================================================ FILE: packages/imlib2/imlib2-1.5.1_src_bin_imlib2_show.c.patch ================================================ diff -uNr imlib2-1.5.1/src/bin/imlib2_show.c imlib2-1.5.1.mod/src/bin/imlib2_show.c --- imlib2-1.5.1/src/bin/imlib2_show.c 2018-03-16 17:29:59.000000000 +0200 +++ imlib2-1.5.1.mod/src/bin/imlib2_show.c 2018-11-14 19:08:41.689118629 +0200 @@ -23,6 +23,11 @@ */ #include "Imlib2.h" +static int android_mblen(const char *s, size_t n) +{ + return mbtowc(0, s, n); +} + Display *disp; Window win; Visual *vis; @@ -1276,7 +1281,7 @@ char tmp[16]; int len; - len = mblen(str + cp, MB_CUR_MAX); + len = android_mblen(str + cp, MB_CUR_MAX); if (len < 0) len = 1; strncpy(tmp, str + cp, len); ================================================ FILE: packages/imlib2/imlib2-1.5.1_src_lib_ximage.c.patch ================================================ diff -uNr imlib2-1.5.1/src/lib/ximage.c imlib2-1.5.1.mod/src/lib/ximage.c --- imlib2-1.5.1/src/lib/ximage.c 2018-03-10 21:31:39.000000000 +0200 +++ imlib2-1.5.1.mod/src/lib/ximage.c 2019-09-10 22:24:51.561058349 +0300 @@ -9,7 +9,8 @@ #include #endif #include -#include +#include +#include #include "ximage.h" @@ -36,6 +37,79 @@ /* temporary X error catcher we use later */ static char _x_err = 0; +#ifndef shmid_ds +# define shmid_ds shmid64_ds +#endif + +static void * (*android_shmat)(int shmid, const void *shmaddr, int shmflg) = NULL; +static int (*android_shmdt)(const void *shmaddr) = NULL; +static int (*android_shmget)(key_t key, size_t size, int shmflg) = NULL; +static int (*android_shmctl)(int shmid, int cmd, struct shmid_ds *buf) = NULL; + +static void * shmat(int shmid, const void *shmaddr, int shmflg) { + if (!android_shmat) { + void *handle = dlopen("@TERMUX_PREFIX@/lib/libandroid-shmem.so", RTLD_LOCAL | RTLD_LAZY); + + if (!handle) { + abort(); + } + + android_shmat = dlsym(handle, "shmat"); + + dlclose(handle); + } + + return android_shmat(shmid, shmaddr, shmflg); +} + +static int shmdt(const void *shmaddr) { + if (!android_shmdt) { + void *handle = dlopen("@TERMUX_PREFIX@/lib/libandroid-shmem.so", RTLD_LOCAL | RTLD_LAZY); + + if (!handle) { + abort(); + } + + android_shmdt = dlsym(handle, "shmdt"); + + dlclose(handle); + } + + return android_shmdt(shmaddr); +} + +static int shmget(key_t key, size_t size, int shmflg) { + if (!android_shmget) { + void *handle = dlopen("@TERMUX_PREFIX@/lib/libandroid-shmem.so", RTLD_LOCAL | RTLD_LAZY); + + if (!handle) { + abort(); + } + + android_shmget = dlsym(handle, "shmget"); + + dlclose(handle); + } + + return android_shmget(key, size, shmflg); +} + +static int shmctl(int shmid, int cmd, struct shmid_ds *buf) { + if (!android_shmctl) { + void *handle = dlopen("@TERMUX_PREFIX@/lib/libandroid-shmem.so", RTLD_LOCAL | RTLD_LAZY); + + if (!handle) { + abort(); + } + + android_shmctl = dlsym(handle, "shmctl"); + + dlclose(handle); + } + + return android_shmctl(shmid, cmd, buf); +} + /* the function we use for catching the error */ static int TmpXError(Display * d, XErrorEvent * ev) ================================================ FILE: packages/imlib2/imlib2-1.5.1_src_modules_loaders_loader_bz2.c.patch ================================================ diff -uNr imlib2-1.5.1/src/modules/loaders/loader_bz2.c imlib2-1.5.1.mod/src/modules/loaders/loader_bz2.c --- imlib2-1.5.1/src/modules/loaders/loader_bz2.c 2017-12-16 15:03:10.000000000 +0200 +++ imlib2-1.5.1.mod/src/modules/loaders/loader_bz2.c 2018-11-14 19:06:26.991364123 +0200 @@ -52,7 +52,7 @@ ImlibLoader *loader; FILE *fp; int dest, res; - char *file, *p, *q, tmp[] = "/tmp/imlib2_loader_bz2-XXXXXX"; + char *file, *p, *q, tmp[] = "@TERMUX_PREFIX@/tmp/imlib2_loader_bz2-XXXXXX"; char *real_ext; assert(im); ================================================ FILE: packages/imlib2/imlib2-1.5.1_src_modules_loaders_loader_id3.c.patch ================================================ diff -uNr imlib2-1.5.1/src/modules/loaders/loader_id3.c imlib2-1.5.1.mod/src/modules/loaders/loader_id3.c --- imlib2-1.5.1/src/modules/loaders/loader_id3.c 2018-03-10 21:31:39.000000000 +0200 +++ imlib2-1.5.1.mod/src/modules/loaders/loader_id3.c 2018-11-14 19:06:26.994697483 +0200 @@ -507,7 +507,7 @@ if (loader) { - char *ofile, tmp[] = "/tmp/imlib2_loader_id3-XXXXXX"; + char *ofile, tmp[] = "@TERMUX_PREFIX@/tmp/imlib2_loader_id3-XXXXXX"; int dest; if ((dest = mkstemp(tmp)) < 0) ================================================ FILE: packages/imlib2/imlib2-1.5.1_src_modules_loaders_loader_xpm.c.patch ================================================ diff -uNr imlib2-1.5.1/src/modules/loaders/loader_xpm.c imlib2-1.5.1.mod/src/modules/loaders/loader_xpm.c --- imlib2-1.5.1/src/modules/loaders/loader_xpm.c 2018-03-11 09:54:36.000000000 +0200 +++ imlib2-1.5.1.mod/src/modules/loaders/loader_xpm.c 2018-11-14 19:06:27.004697564 +0200 @@ -51,11 +51,11 @@ } /* look in rgb txt database */ if (!rgb_txt) - rgb_txt = fopen("/usr/share/X11/rgb.txt", "r"); + rgb_txt = fopen("@TERMUX_PREFIX@/share/X11/rgb.txt", "r"); if (!rgb_txt) - rgb_txt = fopen("/usr/X11R6/lib/X11/rgb.txt", "r"); + rgb_txt = fopen("@TERMUX_PREFIX@/X11R6/lib/X11/rgb.txt", "r"); if (!rgb_txt) - rgb_txt = fopen("/usr/openwin/lib/X11/rgb.txt", "r"); + rgb_txt = fopen("@TERMUX_PREFIX@/openwin/lib/X11/rgb.txt", "r"); if (!rgb_txt) return; fseek(rgb_txt, 0, SEEK_SET); ================================================ FILE: packages/imlib2/imlib2-1.5.1_src_modules_loaders_loader_zlib.c.patch ================================================ diff -uNr imlib2-1.5.1/src/modules/loaders/loader_zlib.c imlib2-1.5.1.mod/src/modules/loaders/loader_zlib.c --- imlib2-1.5.1/src/modules/loaders/loader_zlib.c 2017-12-16 15:03:10.000000000 +0200 +++ imlib2-1.5.1.mod/src/modules/loaders/loader_zlib.c 2018-11-14 19:06:27.008030924 +0200 @@ -44,7 +44,7 @@ { ImlibLoader *loader; int src, dest, res; - char *file, *p, *q, tmp[] = "/tmp/imlib2_loader_zlib-XXXXXX"; + char *file, *p, *q, tmp[] = "@TERMUX_PREFIX@/tmp/imlib2_loader_zlib-XXXXXX"; char *real_ext; struct stat st; ================================================ FILE: packages/indent/Makefile.in.patch ================================================ diff -u -r ../indent-2.2.12/Makefile.in ./Makefile.in --- ../indent-2.2.12/Makefile.in 2018-09-05 21:00:27.000000000 +0000 +++ ./Makefile.in 2018-09-08 00:11:20.094710325 +0000 @@ -378,7 +378,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = no-texinfo.tex -SUBDIRS = intl src doc po man regression +SUBDIRS = intl src po man BUILT_SOURCES = DISTFILES = $(DIST_COMMON:README=README.md) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) EXTRA_DIST = README.md \ ================================================ FILE: packages/indent/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/indent/ TERMUX_PKG_DESCRIPTION="C language source code formatting program" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=2.2.12 TERMUX_PKG_SHA256=b745a5dfc68f86a483d7f96dc1cda7aafd1e78ecba3c7d8ad304709e91e1defb TERMUX_PKG_SRCURL=http://mirrors.kernel.org/gnu/indent/indent-$TERMUX_PKG_VERSION.tar.xz TERMUX_PKG_DEPENDS="libandroid-support" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_func_setlocale=no" TERMUX_PKG_RM_AFTER_INSTALL="bin/texinfo2man" ================================================ FILE: packages/indent/code_io.c.patch ================================================ --- ../code_io.c.orig 2019-05-30 20:55:54.216630725 +0200 +++ ./src/code_io.c 2019-05-30 20:55:57.723297366 +0200 @@ -210,7 +210,7 @@ #endif unsigned int namelen = strlen(filename); - int fd = open(filename, O_RDONLY, 0777); + int fd = open(filename, O_RDONLY); if (fd < 0) { ================================================ FILE: packages/inetutils/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/inetutils/ TERMUX_PKG_DESCRIPTION="Collection of common network programs" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=1.9.4 TERMUX_PKG_REVISION=7 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/inetutils/inetutils-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=849d96f136effdef69548a940e3e0ec0624fc0c81265296987986a0dd36ded37 TERMUX_PKG_DEPENDS="readline" # These are old cruft / not suited for android # (we --disable-traceroute as it requires root # in favour of tracepath, which sets up traceroute # as a symlink to tracepath): TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-hostname --disable-ifconfig --disable-ping --disable-ping6 --disable-rcp --disable-rexec --disable-rexecd --disable-rlogin --disable-rsh --disable-traceroute --disable-uucpd ac_cv_lib_crypt_crypt=no " TERMUX_PKG_EXTRA_MAKE_ARGS="LIBS=-llog" termux_step_pre_configure() { CPPFLAGS+=" -DLOGIN_PROCESS=6 -DDEAD_PROCESS=8 -DLOG_NFACILITIES=24" } ================================================ FILE: packages/inetutils/configure-pthreads-no-weak.patch ================================================ diff -uNr inetutils-1.9.4/configure inetutils-1.9.4.mod/configure --- inetutils-1.9.4/configure 2015-06-09 10:53:47.000000000 +0300 +++ inetutils-1.9.4.mod/configure 2019-08-16 17:07:41.868736971 +0300 @@ -15894,7 +15894,7 @@ if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then -$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h +#$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h LIBTHREAD= LTLIBTHREAD= ================================================ FILE: packages/inetutils/ftp-getpass.patch ================================================ Submitted upstream at: http://lists.gnu.org/archive/html/bug-inetutils/2016-10/msg00000.html diff -u -r ../inetutils-1.9.4/ftp/cmds.c ./ftp/cmds.c --- ../inetutils-1.9.4/ftp/cmds.c 2015-06-09 03:41:47.000000000 -0400 +++ ./ftp/cmds.c 2016-10-22 08:13:16.282265064 -0400 @@ -1721,6 +1721,9 @@ void user (int argc, char **argv) { +# if !HAVE_DECL_GETPASS + extern char *getpass (); +# endif char acct[80]; int n, aflag = 0; @@ -2070,6 +2073,9 @@ void account (int argc, char **argv) { +# if !HAVE_DECL_GETPASS + extern char *getpass (); +# endif char acct[50], *ap; if (argc > 1) diff -u -r ../inetutils-1.9.4/ftp/ftp.c ./ftp/ftp.c --- ../inetutils-1.9.4/ftp/ftp.c 2015-03-31 11:40:47.000000000 -0400 +++ ./ftp/ftp.c 2016-10-22 08:13:37.005945253 -0400 @@ -292,6 +292,9 @@ int login (char *host) { +# if !HAVE_DECL_GETPASS + extern char *getpass (); +# endif char tmp[80]; char *user, *pass, *acct; int n, aflag = 0; ================================================ FILE: packages/inetutils/ftpd.c.patch ================================================ diff -u -r ../inetutils-1.9.3/ftpd/auth.c ./ftpd/auth.c --- ../inetutils-1.9.3/ftpd/auth.c 2015-03-31 11:40:47.000000000 -0400 +++ ./ftpd/auth.c 2015-05-12 16:33:16.860147663 -0400 @@ -184,6 +184,9 @@ case AUTH_TYPE_PASSWD: default: { +#ifdef __ANDROID__ + return -1; +#else char *xpasswd; char *salt = pcred->passwd; /* Try to authenticate the user. */ @@ -191,6 +194,7 @@ return 1; /* Failed. */ xpasswd = crypt (passwd, salt); return (!xpasswd || strcmp (xpasswd, pcred->passwd) != 0); +#endif } } /* switch (auth_type) */ return -1; ================================================ FILE: packages/inetutils/if_index.c.patch ================================================ diff -u -r ../inetutils-1.9.3/libinetutils/if_index.c ./libinetutils/if_index.c --- ../inetutils-1.9.3/libinetutils/if_index.c 2015-03-31 11:40:48.000000000 -0400 +++ ./libinetutils/if_index.c 2015-05-12 15:32:45.660145151 -0400 @@ -37,10 +37,22 @@ #include #ifndef HAVE_STRUCT_IF_NAMEINDEX + +#ifdef __ANDROID__ +struct if_nameindex { + unsigned int if_index; + char *if_name; +}; +# define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */ +#endif + unsigned int if_nametoindex (const char *ifname) { int result = 0; +#ifdef __ANDROID__ + return result; +#else #ifdef SIOCGIFINDEX { int fd = socket (AF_INET, SOCK_DGRAM, 0); @@ -75,11 +87,13 @@ } return result; } +#endif } void if_freenameindex (struct if_nameindex *ifn) { +#ifndef __ANDROID__ struct if_nameindex *ptr = ifn; if (!ifn) return; @@ -88,6 +102,7 @@ free (ptr->if_name); ++ptr; } +#endif free (ifn); } @@ -162,7 +177,7 @@ return NULL; } -# if defined SIOCGIFINDEX +# if defined SIOCGIFINDEX && !defined(__ANDROID__) if (ioctl (fd, SIOCGIFINDEX, cur) >= 0) idx[i].if_index = cur->ifr_index; else ================================================ FILE: packages/inetutils/utmp_logout.c.patch ================================================ diff -u -r ../inetutils-1.9.3/libinetutils/utmp_logout.c ./libinetutils/utmp_logout.c --- ../inetutils-1.9.3/libinetutils/utmp_logout.c 2015-03-31 11:40:48.000000000 -0400 +++ ./libinetutils/utmp_logout.c 2015-05-12 16:29:06.884147490 -0400 @@ -68,6 +68,7 @@ void utmp_logout (char *line) { +#ifndef __ANDROID__ #ifdef HAVE_UTMPX_H struct utmpx utx; struct utmpx *ut; @@ -166,4 +167,5 @@ logwtmp (line, "", ""); # endif /* HAVE_LOGOUT */ #endif +#endif } ================================================ FILE: packages/inotify-tools/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/rvoicilas/inotify-tools/wiki TERMUX_PKG_DESCRIPTION="Programs providing a simple interface to inotify" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=3.20.1 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=a433cc1dedba851078276db69b0e97f9fe41e4ba3336d2971adfca4b3a6242ac TERMUX_PKG_BREAKS="inotify-tools-dev" TERMUX_PKG_REPLACES="inotify-tools-dev" TERMUX_PKG_SRCURL=https://github.com/rvoicilas/inotify-tools/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { ./autogen.sh LDFLAGS+=" -llog" } termux_step_make() { : } termux_step_make_install() { # the command-line tools needs the libinotifytools installed before building make -C libinotifytools install make install } ================================================ FILE: packages/inotify-tools/src-Makefile.am.patch ================================================ diff -u -r ../inotify-tools-3.20.1/src/Makefile.am ./src/Makefile.am --- ../inotify-tools-3.20.1/src/Makefile.am 2018-01-06 12:10:51.000000000 +0100 +++ ./src/Makefile.am 2018-05-19 00:38:08.962826874 +0200 @@ -2,7 +2,7 @@ inotifywait_SOURCES = inotifywait.c common.c common.h inotifywatch_SOURCES = inotifywatch.c common.c common.h -AM_CFLAGS = -Wall -Werror -Wpointer-arith -std=c99 -I../libinotifytools/src -L../libinotifytools/src +AM_CFLAGS = -Wall -Wpointer-arith -std=c99 -I../libinotifytools/src -L../libinotifytools/src AM_CPPFLAGS = -I$(top_srcdir)/libinotifytools/src LDADD = ../libinotifytools/src/libinotifytools.la ================================================ FILE: packages/ipcalc/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://jodies.de/ipcalc TERMUX_PKG_DESCRIPTION="Calculates IP broadcast, network, Cisco wildcard mask, and host ranges" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_DEPENDS="perl" TERMUX_PKG_VERSION=0.41 TERMUX_PKG_SRCURL=http://jodies.de/ipcalc-archive/ipcalc-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=dda9c571ce3369e5b6b06e92790434b54bec1f2b03f1c9df054c0988aa4e2e8a termux_step_make_install() { cp $TERMUX_PKG_SRCDIR/ipcalc $TERMUX_PREFIX/bin/ } ================================================ FILE: packages/iperf3/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/esnet/iperf TERMUX_PKG_DESCRIPTION="TCP, UDP, and SCTP network bandwidth measurement tool" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=3.7 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=d846040224317caf2f75c843d309a950a7db23f9b44b94688ccbe557d6d1710c TERMUX_PKG_SRCURL=https://fossies.org/linux/privat/iperf-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_DEPENDS="openssl" TERMUX_PKG_BREAKS="iperf3-dev" TERMUX_PKG_REPLACES="iperf3-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-profiling" ================================================ FILE: packages/iperf3/main_Makefile.in.patch ================================================ diff -u -r ../iperf-3.0.3/Makefile.in ./Makefile.in --- ../iperf-3.0.3/Makefile.in 2014-03-26 19:06:38.000000000 +0100 +++ ./Makefile.in 2014-06-16 08:41:13.908269513 +0200 @@ -212,7 +212,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = src examples +SUBDIRS = src all: all-recursive .SUFFIXES: ================================================ FILE: packages/iperf3/src-iperf_api.c.patch ================================================ diff -u -r ../iperf-3.2/src/iperf_api.c ./src/iperf_api.c --- ../iperf-3.2/src/iperf_api.c 2017-06-26 19:42:56.000000000 +0200 +++ ./src/iperf_api.c 2017-07-26 14:00:54.136126122 +0200 @@ -3168,7 +3168,7 @@ tempdir = getenv("TMP"); } if (tempdir == 0){ - tempdir = "/tmp"; + tempdir = "@TERMUX_PREFIX@/tmp"; } snprintf(template, sizeof(template) / sizeof(char), "%s/iperf3.XXXXXX", tempdir); } ================================================ FILE: packages/ipfs/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://ipfs.io/ TERMUX_PKG_DESCRIPTION="A peer-to-peer hypermedia distribution protocol" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.4.22 TERMUX_PKG_REVISION=1 # Use a snapshot to fix building with go 1.13: #TERMUX_PKG_SRCURL=https://github.com/ipfs/go-ipfs/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SRCURL=https://github.com/ipfs/go-ipfs/archive/d5977fc4759137f13c8980323d577759dad3d923.zip TERMUX_PKG_SHA256=7d8c791489b5de14aa72a78485d5ef87ada205b185b63d25467f42692e5d6d8d termux_step_make() { termux_setup_golang export GOPATH=${TERMUX_PKG_BUILDDIR} export GOARCH=${TERMUX_ARCH} if [ "${TERMUX_ARCH}" = "aarch64" ]; then GOARCH="arm64" elif [ "${TERMUX_ARCH}" = "i686" ]; then GOARCH="386" elif [ "${TERMUX_ARCH}" = "x86_64" ]; then GOARCH="amd64" fi mkdir -p "${GOPATH}/src/github.com/ipfs" cp -a "${TERMUX_PKG_SRCDIR}" "${GOPATH}/src/github.com/ipfs/go-ipfs" cd "${GOPATH}/src/github.com/ipfs/go-ipfs" make build # Fix folders without write permissions preventing which fails repeating builds: cd $TERMUX_PKG_BUILDDIR find . -type d -exec chmod u+w {} \; } termux_step_make_install() { mkdir -p "${TERMUX_PREFIX}/bin" cp -f "${TERMUX_PKG_BUILDDIR}/src/github.com/ipfs/go-ipfs/cmd/ipfs/ipfs" "${TERMUX_PREFIX}/bin/" } ================================================ FILE: packages/ipfs/go-ipfs-0.4.15_bin_dist_get.patch ================================================ diff -uNr go-ipfs-0.4.15/bin/dist_get go-ipfs-0.4.15.mod/bin/dist_get --- go-ipfs-0.4.15/bin/dist_get 2018-05-10 12:22:02.000000000 +0300 +++ go-ipfs-0.4.15.mod/bin/dist_get 2018-06-24 17:57:59.457862326 +0300 @@ -112,7 +112,7 @@ m_archive="$4" m_govars=$(get_go_vars) || die "could not get go env vars" - echo "https://ipfs.io$m_root/$m_name/$m_vers/${m_name}_${m_vers}_$m_govars.$m_archive" + echo "https://ipfs.io$m_root/$m_name/$m_vers/${m_name}_${m_vers}_linux-amd64.$m_archive" } distroot="$1" @@ -138,6 +138,9 @@ goenv=$(get_go_vars) || die "could not get go env vars" case $goenv in + android-*) + archive="tar.gz" + ;; linux-*) archive="tar.gz" ;; ================================================ FILE: packages/ipmitool/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://ipmitool.sourceforge.net TERMUX_PKG_DESCRIPTION="Command-line interface to IPMI-enabled devices" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.8.18 TERMUX_PKG_REVISION=5 TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/ipmitool/ipmitool/$TERMUX_PKG_VERSION/ipmitool-$TERMUX_PKG_VERSION.tar.bz2 TERMUX_PKG_SHA256=0c1ba3b1555edefb7c32ae8cd6a3e04322056bc087918f07189eeedfc8b81e01 TERMUX_PKG_DEPENDS="ncurses, openssl, readline" termux_step_pre_configure() { export LIBS="-llog" } ================================================ FILE: packages/ipmitool/index-strchr.patch ================================================ diff -uNr ipmitool-1.8.18/lib/ipmi_sel.c ipmitool-1.8.18.mod/lib/ipmi_sel.c --- ipmitool-1.8.18/lib/ipmi_sel.c 2016-10-06 07:14:42.000000000 +0300 +++ ipmitool-1.8.18.mod/lib/ipmi_sel.c 2019-02-01 02:14:57.521358035 +0200 @@ -2457,18 +2457,18 @@ /* evt.sel_type.standard_type.timestamp; */ /* skip timestamp */ - cursor = index((const char *)cursor, ';'); + cursor = strchr((const char *)cursor, ';'); cursor++; /* FIXME: parse originator */ evt.sel_type.standard_type.gen_id = 0x0020; /* skip originator info */ - cursor = index((const char *)cursor, ';'); + cursor = strchr((const char *)cursor, ';'); cursor++; /* Get sensor type */ - cursor = index((const char *)cursor, '('); + cursor = strchr((const char *)cursor, '('); cursor++; errno = 0; @@ -2479,7 +2479,7 @@ status = (-1); break; } - cursor = index((const char *)cursor, ','); + cursor = strchr((const char *)cursor, ','); cursor++; errno = 0; @@ -2492,7 +2492,7 @@ } /* skip to event type info */ - cursor = index((const char *)cursor, ':'); + cursor = strchr((const char *)cursor, ':'); cursor++; errno = 0; @@ -2505,7 +2505,7 @@ } /* skip to event dir info */ - cursor = index((const char *)cursor, '('); + cursor = strchr((const char *)cursor, '('); cursor++; if (*cursor == 'a') { evt.sel_type.standard_type.event_dir = 0; @@ -2513,7 +2513,7 @@ evt.sel_type.standard_type.event_dir = 1; } /* skip to data info */ - cursor = index((const char *)cursor, ' '); + cursor = strchr((const char *)cursor, ' '); cursor++; if (evt.sel_type.standard_type.sensor_type == 0xF0) { @@ -2532,7 +2532,7 @@ } /* Get to previous state */ - cursor = index((const char *)cursor, 'M'); + cursor = strchr((const char *)cursor, 'M'); cursor++; /* Set previous state */ @@ -2546,7 +2546,7 @@ } /* Get to current state */ - cursor = index((const char *)cursor, 'M'); + cursor = strchr((const char *)cursor, 'M'); cursor++; /* Set current state */ @@ -2560,7 +2560,7 @@ } /* skip to cause */ - cursor = index((const char *)cursor, '='); + cursor = strchr((const char *)cursor, '='); cursor++; errno = 0; evt.sel_type.standard_type.event_data[1] |= @@ -2579,7 +2579,7 @@ status = (-1); break; } - cursor = index((const char *)cursor, ' '); + cursor = strchr((const char *)cursor, ' '); cursor++; errno = 0; @@ -2591,7 +2591,7 @@ break; } - cursor = index((const char *)cursor, ' '); + cursor = strchr((const char *)cursor, ' '); cursor++; errno = 0; ================================================ FILE: packages/ipmitool/openssl-1.1.patch ================================================ diff -urNp old/src/plugins/lanplus/lanplus_crypt_impl.c new/src/plugins/lanplus/lanplus_crypt_impl.c --- old/src/plugins/lanplus/lanplus_crypt_impl.c 2016-05-28 10:20:20.000000000 +0200 +++ new/src/plugins/lanplus/lanplus_crypt_impl.c 2017-02-21 10:50:21.634873466 +0100 @@ -164,10 +164,10 @@ lanplus_encrypt_aes_cbc_128(const uint8_ uint8_t * output, uint32_t * bytes_written) { - EVP_CIPHER_CTX ctx; - EVP_CIPHER_CTX_init(&ctx); - EVP_EncryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv); - EVP_CIPHER_CTX_set_padding(&ctx, 0); + EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); + EVP_CIPHER_CTX_init(ctx); + EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv); + EVP_CIPHER_CTX_set_padding(ctx, 0); *bytes_written = 0; @@ -191,7 +191,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_ assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0); - if(!EVP_EncryptUpdate(&ctx, output, (int *)bytes_written, input, input_length)) + if(!EVP_EncryptUpdate(ctx, output, (int *)bytes_written, input, input_length)) { /* Error */ *bytes_written = 0; @@ -201,7 +201,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_ { uint32_t tmplen; - if(!EVP_EncryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen)) + if(!EVP_EncryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen)) { *bytes_written = 0; return; /* Error */ @@ -210,7 +210,8 @@ lanplus_encrypt_aes_cbc_128(const uint8_ { /* Success */ *bytes_written += tmplen; - EVP_CIPHER_CTX_cleanup(&ctx); + EVP_CIPHER_CTX_cleanup(ctx); + EVP_CIPHER_CTX_free(ctx); } } } @@ -239,10 +240,10 @@ lanplus_decrypt_aes_cbc_128(const uint8_ uint8_t * output, uint32_t * bytes_written) { - EVP_CIPHER_CTX ctx; - EVP_CIPHER_CTX_init(&ctx); - EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv); - EVP_CIPHER_CTX_set_padding(&ctx, 0); + EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); + EVP_CIPHER_CTX_init(ctx); + EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv); + EVP_CIPHER_CTX_set_padding(ctx, 0); if (verbose >= 5) @@ -266,7 +267,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_ assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0); - if (!EVP_DecryptUpdate(&ctx, output, (int *)bytes_written, input, input_length)) + if (!EVP_DecryptUpdate(ctx, output, (int *)bytes_written, input, input_length)) { /* Error */ lprintf(LOG_DEBUG, "ERROR: decrypt update failed"); @@ -277,7 +278,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_ { uint32_t tmplen; - if (!EVP_DecryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen)) + if (!EVP_DecryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen)) { char buffer[1000]; ERR_error_string(ERR_get_error(), buffer); @@ -290,7 +291,8 @@ lanplus_decrypt_aes_cbc_128(const uint8_ { /* Success */ *bytes_written += tmplen; - EVP_CIPHER_CTX_cleanup(&ctx); + EVP_CIPHER_CTX_cleanup(ctx); + EVP_CIPHER_CTX_free(ctx); } } ================================================ FILE: packages/ired/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/radare/ired TERMUX_PKG_DESCRIPTION="Minimalist hexadecimal editor" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=0.6 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/radare/ired/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=c15d37b96b1a25c44435d824bd7ef1f9aea9dc191be14c78b689d3156312d58a TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { CFLAGS+=" $LDFLAGS" } ================================================ FILE: packages/irssi/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://irssi.org/ TERMUX_PKG_DESCRIPTION="Terminal based IRC client" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.2.2 TERMUX_PKG_SRCURL=https://github.com/irssi/irssi/releases/download/$TERMUX_PKG_VERSION/irssi-$TERMUX_PKG_VERSION.tar.xz TERMUX_PKG_SHA256=6727060c918568ba2ff4295ad736128dba0b995d7b20491bca11f593bd857578 TERMUX_PKG_DEPENDS="libiconv, ncurses, openssl, glib, libandroid-glob, utf8proc" TERMUX_PKG_BREAKS="irssi-dev" TERMUX_PKG_REPLACES="irssi-dev" TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { LDFLAGS+=" -landroid-glob" } ================================================ FILE: packages/irssi/fix-paths.patch ================================================ diff -uNr irssi-1.2.0/src/fe-common/core/fe-exec.c irssi-1.2.0.mod/src/fe-common/core/fe-exec.c --- irssi-1.2.0/src/fe-common/core/fe-exec.c 2019-02-11 19:27:58.000000000 +0200 +++ irssi-1.2.0.mod/src/fe-common/core/fe-exec.c 2019-03-01 20:46:39.912473788 +0200 @@ -281,7 +281,7 @@ static void process_exec(PROCESS_REC *rec, const char *cmd) { - const char *shell_args[4] = { "/bin/sh", "-c", NULL, NULL }; + const char *shell_args[4] = { "@TERMUX_PREFIX@/bin/sh", "-c", NULL, NULL }; char **args; int in[2], out[2]; int n; @@ -339,7 +339,7 @@ if (rec->shell) { execvp(shell_args[0], (char **) shell_args); - fprintf(stderr, "Exec: /bin/sh: %s\n", g_strerror(errno)); + fprintf(stderr, "Exec: @TERMUX_PREFIX@/bin/sh: %s\n", g_strerror(errno)); } else { args = g_strsplit(cmd, " ", -1); execvp(args[0], args); diff -uNr irssi-1.2.0/src/fe-fuzz/fe-common/core/theme-load.c irssi-1.2.0.mod/src/fe-fuzz/fe-common/core/theme-load.c --- irssi-1.2.0/src/fe-fuzz/fe-common/core/theme-load.c 2019-02-11 19:27:58.000000000 +0200 +++ irssi-1.2.0.mod/src/fe-fuzz/fe-common/core/theme-load.c 2019-03-01 20:47:09.179339329 +0200 @@ -38,7 +38,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv) { core_register_options(); fe_common_core_register_options(); - char *irssi_argv[] = {*argv[0], "--home", "/tmp/irssi", NULL}; + char *irssi_argv[] = {*argv[0], "--home", "@TERMUX_PREFIX@/tmp/irssi", NULL}; int irssi_argc = sizeof(irssi_argv) / sizeof(char *) - 1; args_execute(irssi_argc, irssi_argv); core_preinit((*argv)[0]); @@ -52,7 +52,7 @@ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { gchar *copy = g_strndup((const gchar *)data, size); - FILE *fp = fopen("/tmp/irssi/fuzz.theme", "wb"); + FILE *fp = fopen("@TERMUX_PREFIX@/tmp/irssi/fuzz.theme", "wb"); if (fp) { fwrite(copy, strlen(copy), 1, fp); fclose(fp); ================================================ FILE: packages/isync/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://isync.sourceforge.net TERMUX_PKG_DESCRIPTION="IMAP and MailDir mailbox synchronizer" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.3.1 TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/isync/isync/${TERMUX_PKG_VERSION}/isync-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=68cb4643d58152097f01c9b3abead7d7d4c9563183d72f3c2a31d22bc168f0ea TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--without-sasl ac_cv_header_db=no ac_cv_berkdb4=no" TERMUX_PKG_DEPENDS="openssl, zlib" ================================================ FILE: packages/isync/isync.patch ================================================ diff -u -r ../isync-1.3.0.orig/src/compat/config.c ./src/compat/config.c --- ../isync-1.3.0.orig/src/compat/config.c 2017-10-01 17:42:35.000000000 +0900 +++ ./src/compat/config.c 2018-02-06 08:41:15.750006264 +0900 @@ -451,7 +451,7 @@ goto gotstor; box->local_store_path = my_strndup( path, pl ); /* derive a suitable name */ - if (!strcmp( box->local_store_path, "/var/mail/" ) || !strcmp( box->local_store_path, "/var/spool/mail/" )) { + if (!strcmp( box->local_store_path, "@TERMUX_PREFIX@/var/mail/" ) || !strcmp( box->local_store_path, "@TERMUX_PREFIX@/var/spool/mail/" )) { local_store = nfstrdup( "spool" ); } else if (!strcmp( box->local_store_path, "~/" )) { local_store = nfstrdup( "home" ); diff -u -r ../isync-1.3.0.orig/src/compat/main.c ./src/compat/main.c --- ../isync-1.3.0.orig/src/compat/main.c 2017-10-01 17:42:35.000000000 +0900 +++ ./src/compat/main.c 2018-02-06 08:41:15.750006264 +0900 @@ -384,7 +384,7 @@ return 1; } } else { - strcpy( path2, "/tmp/mbsyncrcXXXXXX" ); + strcpy( path2, "@TERMUX_PREFIX@/tmp/mbsyncrcXXXXXX" ); if ((fd = mkstemp( path2 )) < 0) { sys_error( "Error: cannot create temporary config file" ); return 1; diff -u -r ../isync-1.3.0.orig/src/socket.c ./src/socket.c --- ../isync-1.3.0.orig/src/socket.c 2017-10-01 17:42:35.000000000 +0900 +++ ./src/socket.c 2018-02-06 08:41:15.750006264 +0900 @@ -398,7 +398,7 @@ _exit( 127 ); close( a[0] ); close( a[1] ); - execl( "/bin/sh", "sh", "-c", conf->tunnel, (char *)0 ); + execl( "@TERMUX_PREFIX@/bin/sh", "sh", "-c", conf->tunnel, (char *)0 ); _exit( 127 ); } ================================================ FILE: packages/iverilog/Makefile.in.patch ================================================ diff -uNr iverilog-10_2/Makefile.in iverilog-10_2.mod/Makefile.in --- iverilog-10_2/Makefile.in 2017-08-24 18:22:49.000000000 +0300 +++ iverilog-10_2.mod/Makefile.in 2019-02-25 20:18:55.327140615 +0200 @@ -67,8 +67,8 @@ dllib=@DLLIB@ # For a cross compile these defines will need to be set accordingly. -HOSTCC = @CC@ -HOSTCFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CC@ @CFLAGS@ +HOSTCC = gcc +HOSTCFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CC@ CC = @CC@ CXX = @CXX@ ================================================ FILE: packages/iverilog/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://iverilog.icarus.com/ TERMUX_PKG_DESCRIPTION="Icarus Verilog compiler and simulation tool" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=10.3 TERMUX_PKG_SRCURL=https://github.com/steveicarus/iverilog/archive/v${TERMUX_PKG_VERSION/./_}.tar.gz TERMUX_PKG_SHA256=4b884261645a73b37467242d6ae69264fdde2e7c4c15b245d902531efaaeb234 TERMUX_PKG_DEPENDS="libbz2, libc++, readline, zlib" TERMUX_PKG_BREAKS="iverilog-dev" TERMUX_PKG_REPLACES="iverilog-dev" termux_step_pre_configure() { LDFLAGS+=" -lm" aclocal autoconf } ================================================ FILE: packages/iverilog/driver-main.c.patch ================================================ diff -uNr iverilog-10_2/driver/main.c iverilog-10_2.mod/driver/main.c --- iverilog-10_2/driver/main.c 2017-08-24 18:22:49.000000000 +0300 +++ iverilog-10_2.mod/driver/main.c 2019-02-25 20:10:43.322593058 +0200 @@ -282,7 +282,7 @@ tmpdir = "C:\\TEMP"; #else if (tmpdir == 0) - tmpdir = "/tmp"; + tmpdir = "@TERMUX_PREFIX@/tmp"; #endif assert(tmpdir); ================================================ FILE: packages/iverilog/vvp-Makefile.in.patch ================================================ diff -uNr iverilog-10_2/vvp/Makefile.in iverilog-10_2.mod/vvp/Makefile.in --- iverilog-10_2/vvp/Makefile.in 2017-08-24 18:22:49.000000000 +0300 +++ iverilog-10_2.mod/vvp/Makefile.in 2019-02-25 20:18:31.607079821 +0200 @@ -32,8 +32,8 @@ includedir = @includedir@ # For a cross compile these defines will need to be set accordingly. -HOSTCC = @CC@ -HOSTCFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CC@ @CFLAGS@ +HOSTCC = gcc +HOSTCFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CC@ CC = @CC@ CXX = @CXX@ ================================================ FILE: packages/jbig2dec/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://jbig2dec.com/ TERMUX_PKG_DESCRIPTION="Decoder implementation of the JBIG2 image compression format" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.17 TERMUX_PKG_SRCURL=https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs950/jbig2dec-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=f72bad7102638b31fa96be7492fb3d447a83d71c644cffd01f2a7ec52bd5fb72 TERMUX_PKG_DEPENDS="libpng" TERMUX_PKG_BREAKS="jbig2dec-dev" TERMUX_PKG_REPLACES="jbig2dec-dev" ================================================ FILE: packages/jhead/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.sentex.net/~mwandel/jhead/ TERMUX_PKG_DESCRIPTION="Exif Jpeg header manipulation tool" TERMUX_PKG_LICENSE="Public Domain" TERMUX_PKG_VERSION=3.04 TERMUX_PKG_SHA256=ef89bbcf4f6c25ed88088cf242a47a6aedfff4f08cc7dc205bf3e2c0f10a03c9 TERMUX_PKG_SRCURL=http://www.sentex.net/~mwandel/jhead/jhead-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_BUILD_IN_SRC=true termux_step_make_install() { install -Dm700 jhead $TERMUX_PREFIX/bin/jhead install -Dm600 jhead.1 $TERMUX_PREFIX/share/man/man1/jhead.1 } ================================================ FILE: packages/joe/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://joe-editor.sourceforge.net TERMUX_PKG_DESCRIPTION="Wordstar like text editor" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_DEPENDS="ncurses" TERMUX_PKG_CONFLICTS="jupp" TERMUX_PKG_VERSION=4.6 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://sourceforge.net/projects/joe-editor/files/JOE%20sources/joe-${TERMUX_PKG_VERSION}/joe-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=495a0a61f26404070fe8a719d80406dc7f337623788e445b92a9f6de512ab9de TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-termcap" termux_step_create_debscripts() { cat <<- EOF > ./postinst #!$TERMUX_PREFIX/bin/sh if [ "\$1" = "configure" ] || [ "\$1" = "abort-upgrade" ]; then if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then update-alternatives --install \ $TERMUX_PREFIX/bin/editor editor $TERMUX_PREFIX/bin/joe 10 fi fi EOF cat <<- EOF > ./prerm #!$TERMUX_PREFIX/bin/sh if [ "\$1" != "upgrade" ]; then if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then update-alternatives --remove editor $TERMUX_PREFIX/bin/joe fi fi EOF } ================================================ FILE: packages/joe/do_not_build_utils.patch ================================================ --- src/joe/Makefile.in~ 2016-08-31 16:47:12.000000000 +0200 +++ src/joe/Makefile.in 2016-12-26 18:03:33.523645366 +0100 @@ -316,7 +316,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign -SUBDIRS = util +SUBDIR = EXTRA_DIST = TODO sysconf_joedir = $(sysconfdir)/joe data_joedir = $(datadir)/joe ================================================ FILE: packages/joe/fix_errno.patch ================================================ --- src/joe/b.c~ 2016-08-22 15:52:28.000000000 +0200 +++ src/joe/b.c 2016-12-26 18:17:44.449852459 +0100 @@ -5,6 +5,8 @@ * * This file is part of JOE (Joe's Own Editor) */ + + #include "types.h" #ifdef HAVE_PWD_H @@ -19,7 +21,7 @@ #endif #endif -extern int errno; + #ifdef WITH_SELINUX #include ================================================ FILE: packages/joe/no_getpwent.patch ================================================ --- src/joe/path.c~ 2016-07-18 17:11:09.000000000 +0200 +++ src/joe/path.c 2016-12-26 18:48:04.010421451 +0100 @@ -401,14 +401,14 @@ { char **lst = NULL; struct passwd *pw; - +#ifndef __ANDROID__ while((pw=getpwent())) if (rmatch(word+1, pw->pw_name)) { char *t = vsncpy(NULL,0,sc("~")); lst = vaadd(lst, vsncpy(sv(t),sz(pw->pw_name))); } endpwent(); - +#endif return lst; } /********************************************************************/ ================================================ FILE: packages/jp2a/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/cslarsen/jp2a TERMUX_PKG_DESCRIPTION="A simple JPEG to ASCII converter" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.0.8 TERMUX_PKG_REVISION=5 _COMMIT=61d205f6959d88e0cc8d8879fe7d66eb0932ecca TERMUX_PKG_SRCURL=https://github.com/cslarsen/jp2a/archive/${_COMMIT}.zip TERMUX_PKG_SHA256=26f655e4b977bf24b8193150f34c015195c07c1116d064375223dd46ea5b8b4e TERMUX_PKG_DEPENDS="libcurl, libjpeg-turbo, ncurses" TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { autoreconf -vi } ================================================ FILE: packages/jq/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://stedolan.github.io/jq/ TERMUX_PKG_DESCRIPTION="Command-line JSON processor" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=1.6 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=5de8c8e29aaa3fb9cc6b47bb27299f271354ebb72514e3accadc7d38b5bbaa72 TERMUX_PKG_BREAKS="jq-dev" TERMUX_PKG_REPLACES="jq-dev" TERMUX_PKG_SRCURL=https://github.com/stedolan/jq/releases/download/jq-$TERMUX_PKG_VERSION/jq-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-oniguruma=no" TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/json-c/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/json-c/json-c/wiki TERMUX_PKG_DESCRIPTION="A JSON implementation in C" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Balazs Kutil @balazs_kutil" TERMUX_PKG_VERSION=0.13.1 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=b87e608d4d3f7bfdd36ef78d56d53c74e66ab278d318b71e6002a369d36f4873 TERMUX_PKG_BREAKS="json-c-dev" TERMUX_PKG_REPLACES="json-c-dev" TERMUX_PKG_SRCURL=https://s3.amazonaws.com/json-c_releases/releases/json-c-${TERMUX_PKG_VERSION}.tar.gz termux_step_make() { make \ LDFLAGS="$LDFLAGS -llog" } ================================================ FILE: packages/json-glib/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://wiki.gnome.org/Projects/JsonGlib TERMUX_PKG_DESCRIPTION="GLib JSON manipulation library" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.4.4 TERMUX_PKG_REVISION=2 TERMUX_PKG_SHA256=720c5f4379513dc11fd97dc75336eb0c0d3338c53128044d9fabec4374f4bc47 TERMUX_PKG_SRCURL=https://download.gnome.org/sources/json-glib/${TERMUX_PKG_VERSION:0:3}/json-glib-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_DEPENDS="glib" TERMUX_PKG_BREAKS="json-glib-dev" TERMUX_PKG_REPLACES="json-glib-dev" TERMUX_PKG_RM_AFTER_INSTALL=" share/installed-tests libexec/installed-tests bin/ " termux_step_pre_configure() { # Remove configure wrapper around meson build which prevents # meson setup in termux_step_configure. rm configure } ================================================ FILE: packages/jsoncpp/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/open-source-parsers/jsoncpp TERMUX_PKG_DESCRIPTION="C++ library for interacting with JSON" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=1.9.2 TERMUX_PKG_SHA256=77a402fb577b2e0e5d0bdc1cf9c65278915cdb25171e3452c68b6da8a561f8f0 TERMUX_PKG_SRCURL=https://github.com/open-source-parsers/jsoncpp/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="libc++" TERMUX_PKG_BREAKS="jsoncpp-dev" TERMUX_PKG_REPLACES="jsoncpp-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DBUILD_SHARED_LIBS=ON -DJSONCPP_WITH_TESTS=OFF -DCCACHE_FOUND=OFF " termux_step_pre_configure() { # Certain packages are not safe to build on device because their # build.sh script deletes specific files in $TERMUX_PREFIX. if $TERMUX_ON_DEVICE_BUILD; then termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds." fi # The installation does not overwrite symlinks such as libjsoncpp.so.1, # so if rebuilding these are not detected as modified. Fix that: rm -f $TERMUX_PREFIX/lib/libjsoncpp.so* } ================================================ FILE: packages/jupp/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.mirbsd.org/jupp.htm TERMUX_PKG_DESCRIPTION="User friendly full screen text editor" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Dominik George @Natureshadow" TERMUX_PKG_DEPENDS="ncurses" TERMUX_PKG_CONFLICTS="joe" TERMUX_PKG_VERSION=3.1jupp38 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=http://www.mirbsd.org/MirOS/dist/jupp/joe-${TERMUX_PKG_VERSION}.tgz TERMUX_PKG_SHA256=c5cbe3f97683f6e513f611a60531feefb9b877f8cea4c6e9087b48631f69ed40 TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-dependency-tracking --disable-getpwnam --disable-termcap --disable-termidx --enable-sysconfjoesubdir=/jupp " termux_step_post_extract_package() { chmod +x $TERMUX_PKG_SRCDIR/configure } termux_step_create_debscripts() { cat <<- EOF > ./postinst #!$TERMUX_PREFIX/bin/sh if [ "\$1" = "configure" ] || [ "\$1" = "abort-upgrade" ]; then if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then update-alternatives --install \ $TERMUX_PREFIX/bin/editor editor $TERMUX_PREFIX/bin/jupp 10 fi fi EOF cat <<- EOF > ./prerm #!$TERMUX_PREFIX/bin/sh if [ "\$1" != "upgrade" ]; then if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then update-alternatives --remove editor $TERMUX_PREFIX/bin/jupp fi fi EOF } ================================================ FILE: packages/kakoune/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/mawww/kakoune TERMUX_PKG_DESCRIPTION="Code editor heavily inspired by Vim" TERMUX_PKG_LICENSE="Unlicense" TERMUX_PKG_VERSION=2019.07.01 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/mawww/kakoune/releases/download/v$TERMUX_PKG_VERSION/kakoune-$TERMUX_PKG_VERSION.tar.bz2 TERMUX_PKG_SHA256=8cf978499000bd71a78736eaee5663bd996f53c4e610c62a9bd97502a3ed6fd3 TERMUX_PKG_DEPENDS="libc++, ncurses" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_MAKE_ARGS=" -C src debug=no" termux_step_pre_configure() { if [ $TERMUX_ARCH = "arm" ]; then CXXFLAGS+=" -no-integrated-as" fi } termux_step_create_debscripts() { cat <<- EOF > ./postinst #!$TERMUX_PREFIX/bin/sh if [ "\$1" = "configure" ] || [ "\$1" = "abort-upgrade" ]; then if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then update-alternatives --install \ $TERMUX_PREFIX/bin/editor editor $TERMUX_PREFIX/bin/kak 45 fi fi EOF cat <<- EOF > ./prerm #!$TERMUX_PREFIX/bin/sh if [ "\$1" != "upgrade" ]; then if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then update-alternatives --remove editor $TERMUX_PREFIX/bin/kak fi fi EOF } ================================================ FILE: packages/kakoune/src-cs-path-compat.patch ================================================ diff --git a/src/shell_manager.cc b/src/shell_manager.cc index b92edb4c..df025943 100644 --- a/src/shell_manager.cc +++ b/src/shell_manager.cc @@ -30,9 +30,7 @@ ShellManager::ShellManager(ConstArrayView builtin_env_vars) { // Get a guaranteed to be POSIX shell binary { - auto size = confstr(_CS_PATH, nullptr, 0); - String path; path.resize(size-1, 0); - confstr(_CS_PATH, path.data(), size); + String path = "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets:."; for (auto dir : StringView{path} | split(':')) { String candidate = format("{}/sh", dir); ================================================ FILE: packages/keybase/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://keybase.io TERMUX_PKG_DESCRIPTION="Key directory that maps social media identities to encryption keys" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=4.7.2 TERMUX_PKG_SRCURL=https://github.com/keybase/client/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=d6cf2ac1f13bd95c713a534ec504fe20556bd8da93bb5cfe1cdcb6287ed1fc4d TERMUX_PKG_REPLACES="kbfs" TERMUX_PKG_CONFLICTS="kbfs" termux_step_make_install() { cd $TERMUX_PKG_SRCDIR termux_setup_golang mkdir -p .gopath/src/github.com/keybase ln -sf "$PWD" .gopath/src/github.com/keybase/client export GOPATH="$PWD/.gopath" go build -v -tags 'production' -o keybase github.com/keybase/client/go/keybase go build -v -tags 'production' -o git-remote-keybase github.com/keybase/client/go/kbfs/kbfsgit/git-remote-keybase go build -v -tags 'production' -o kbfsfusebin github.com/keybase/client/go/kbfs/kbfsfuse cp keybase $TERMUX_PREFIX/bin/keybase cp git-remote-keybase $TERMUX_PREFIX/bin/git-remote-keybase cp kbfsfusebin $TERMUX_PREFIX/bin/kbfsfuse } ================================================ FILE: packages/keybase/go-libkb-env.go.patch ================================================ diff -u -r ../client-4.0.0/go/libkb/env.go ./go/libkb/env.go --- ../client-4.0.0/go/libkb/env.go 2019-05-07 19:35:07.000000000 +0000 +++ ./go/libkb/env.go 2019-05-11 22:36:35.015703478 +0000 @@ -1784,7 +1784,7 @@ func (e *Env) ForceSecretStoreFile() bool { // By default use system-provided secret store (like MacOS Keychain), but // allow users to fall back to file-based store for testing and debugging. - return e.GetBool(false, + return e.GetBool(true, func() (bool, bool) { return e.getEnvBool("KEYBASE_SECRET_STORE_FILE") }, func() (bool, bool) { return e.GetConfig().GetForceSecretStoreFile() }, ) ================================================ FILE: packages/keystone/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.keystone-engine.org/ TERMUX_PKG_DESCRIPTION="Keystone is a lightweight multi-platform, multi-architecture assembler framework" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.9.1 TERMUX_PKG_REVISION=6 TERMUX_PKG_SRCURL=https://github.com/keystone-engine/keystone/archive/$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=e9d706cd0c19c49a6524b77db8158449b9c434b415fbf94a073968b68cf8a9f0 TERMUX_PKG_DEPENDS="libc++" TERMUX_PKG_BREAKS="keystone-dev" TERMUX_PKG_REPLACES="keystone-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DPYTHON_EXECUTABLE=$(which python2.7) -DBUILD_SHARED_LIBS=ON" ================================================ FILE: packages/kona/Makefile.patch ================================================ diff -uNr kona-Win64-20190226/Makefile kona-Win64-20190226.mod/Makefile --- kona-Win64-20190226/Makefile 2019-02-26 22:13:07.000000000 +0200 +++ kona-Win64-20190226.mod/Makefile 2019-05-21 14:37:07.394973847 +0300 @@ -1,10 +1,8 @@ -PREFIX = /usr/local -CFLAGS=-g -PRODFLAGS = -O3 #-pg -g3 +PRODFLAGS = LIB=libkona.a DEVFLAGS = -O0 -g3 -DDEBUG -Wall -OS := $(shell uname -s | tr "[:upper:]" "[:lower:]") +OS := android # Win-64 ifeq (msys_nt-10.0,$(OS)) @@ -30,16 +28,12 @@ endif ifeq (android,$(OS)) -CC=arm-linux-androideabi-gcc -OBJS= src/0.o src/bswap.o src/c.o src/getline.o src/getline_android.o src/mt.o src/p.o \ +OBJS= src/0.o src/bswap.o src/c.o src/getline.o src/mt.o src/p.o \ src/r.o src/k.o src/kc.o src/kx.o src/kg.o src/km.o src/kn.o src/ko.o \ src/ks.o src/v.o src/va.o src/vc.o src/vd.o src/vf.o src/vg.o src/vq.o -LDFLAGS = -Wl,--gc-sections -Wl,-z,nocopyreloc -lgcc -no-canonical-prefixes \ - -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -mthumb \ - -lc -lm -ldl -CFLAGS += -fPIE -fpic -ffunction-sections -funwind-tables -fstack-protector \ - -no-canonical-prefixes -mtune=xscale -msoft-float -mthumb \ - -fomit-frame-pointer -fno-strict-aliasing +LDFLAGS += -Wl,--gc-sections -Wl,-z,nocopyreloc -lgcc -no-canonical-prefixes \ + -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now \ + -lm endif ifeq (linux,$(OS)) ================================================ FILE: packages/kona/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/kevinlawler/kona TERMUX_PKG_DESCRIPTION="Open-source implementation of the APL-like K programming language" TERMUX_PKG_LICENSE="ISC" TERMUX_PKG_MAINTAINER="Jonathan Badger @jhbadger" TERMUX_PKG_VERSION=20190226 TERMUX_PKG_SRCURL=https://github.com/kevinlawler/kona/archive/Win64-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=26cfebd47a3ae60753fc8a910132f45cad58381155255fbac2129e4507fef403 TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/kona/getline_android.c.patch ================================================ --- ../kona-Win.3.36-64/src/getline_android.c 2015-07-30 11:18:02.000000000 -0400 +++ ./src/getline_android.c 2015-12-06 03:22:55.000000000 -0500 @@ -9,7 +9,7 @@ #include #include -I getline(S *s,size_t*n, FILE *f){ R getdelim(s,n,'\n',f);} +I new_getline(S *s,size_t*n, FILE *f){ R getdelim(s,n,'\n',f);} /* getdelim.c --- Implementation of replacement getdelim function. Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2012 Free Software @@ -44,7 +44,7 @@ necessary. Returns the number of characters read (not including the null terminator), or -1 on error or EOF. */ -I getdelim (S *lineptr, size_t * __restrict__ n, I delimiter, FILE *fp) +I new_getdelim (S *lineptr, size_t * __restrict__ n, I delimiter, FILE *fp) { ssize_t result; size_t cur_len = 0; ================================================ FILE: packages/kona/src-0.c.patch ================================================ diff -u -r ../kona-Win.3.39-69/src/0.c ./src/0.c --- ../kona-Win.3.39-69/src/0.c 2016-04-17 18:10:22.000000000 +0000 +++ ./src/0.c 2017-07-06 22:48:04.933685208 +0000 @@ -13,6 +13,7 @@ #if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__ANDROID__) #include #include +#include /* For wait(2). */ #endif #include "0.h" ================================================ FILE: packages/kona/src-bswap.c.patch ================================================ diff -u -r ../kona-Win.3.39-69/src/bswap.c ./src/bswap.c --- ../kona-Win.3.39-69/src/bswap.c 2016-04-17 14:10:22.000000000 -0400 +++ ./src/bswap.c 2016-05-03 14:17:03.393640037 -0400 @@ -11,8 +11,6 @@ #if defined(__linux__) && defined(__GNUC__) #include -#define bswap32 __bswap_32 -#define bswap64 __bswap_64 #endif #ifdef _MSC_VER ================================================ FILE: packages/kona/src-getline.h.patch ================================================ diff -uNr kona-Win64-20190226/src/getline.h kona-Win64-20190226.mod/src/getline.h --- kona-Win64-20190226/src/getline.h 2019-02-26 22:13:07.000000000 +0200 +++ kona-Win64-20190226.mod/src/getline.h 2019-05-21 14:38:35.428447096 +0300 @@ -6,8 +6,7 @@ I appender(S *s,I *n,S t,I k); I expander(S *s,I n); -#if defined(__MACH__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070 || \ - defined(__ANDROID__) +#if defined(__MACH__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070 I getline(S *s,size_t * __restrict__ n,FILE *f); I getdelim(S *s,size_t * __restrict__ n,I d,FILE *f); #endif ================================================ FILE: packages/kona/src-kn.c.patch ================================================ diff -u -r ../kona-Win.3.39-69/src/kn.c ./src/kn.c --- ../kona-Win.3.39-69/src/kn.c 2016-04-17 18:10:22.000000000 +0000 +++ ./src/kn.c 2017-07-06 22:56:28.547903872 +0000 @@ -4,6 +4,7 @@ #include "k.h" #include "km.h" #include "kn.h" +#include "c.h" #if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__ANDROID__) #include ================================================ FILE: packages/kona/src-p.c.patch ================================================ diff -u -r ../kona-Win.3.39-69/src/p.c ./src/p.c --- ../kona-Win.3.39-69/src/p.c 2016-04-17 18:10:22.000000000 +0000 +++ ./src/p.c 2017-07-06 22:52:49.750416845 +0000 @@ -1,4 +1,5 @@ #include "incs.h" +#include "c.h" #include "k.h" #include "km.h" #include "p.h" ================================================ FILE: packages/kona/src-v.h.patch ================================================ diff -uNr kona-Win64-20190226/src/v.h kona-Win64-20190226.mod/src/v.h --- kona-Win64-20190226/src/v.h 2019-02-26 22:13:07.000000000 +0200 +++ kona-Win64-20190226.mod/src/v.h 2019-05-21 14:40:16.130994527 +0300 @@ -6,3 +6,6 @@ extern V offsetSSR,offsetWhat,offsetAt,offsetDot,offsetColon; //k.c extern K KTREE; //k.c K wd_(S s,int n,K*dict,K func); //p.c + +K lookupEntryOrCreate(K *p, S k); +K* EAP(K e); ================================================ FILE: packages/krb5/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://web.mit.edu/kerberos TERMUX_PKG_DESCRIPTION="The Kerberos network authentication system" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=1.17 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/krb5-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=5a6e2284a53de5702d3dc2be3b9339c963f9b5397d3fbbc53beb249380a781f5 TERMUX_PKG_DEPENDS="libandroid-support, libandroid-glob, readline, openssl, libdb" TERMUX_PKG_BREAKS="krb5-dev" TERMUX_PKG_REPLACES="krb5-dev" TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas" TERMUX_PKG_CONFFILES="etc/krb5.conf var/krb5kdc/kdc.conf" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-static --with-readline --without-system-verto --with-netlib=-lc --enable-dns-for-realm --sbindir=$TERMUX_PREFIX/bin --with-size-optimizations --with-system-db DEFCCNAME=$TERMUX_PREFIX/tmp/krb5cc_%{uid} DEFKTNAME=$TERMUX_PREFIX/etc/krb5.keytab DEFCKTNAME=$TERMUX_PREFIX/var/krb5/user/%{euid}/client.keytab " termux_step_post_extract_package() { TERMUX_PKG_SRCDIR+="/src" } termux_step_pre_configure() { # cannot test these when cross compiling export krb5_cv_attr_constructor_destructor='yes,yes' export ac_cv_func_regcomp='yes' export ac_cv_printf_positional='yes' # bionic doesn't have getpass cp "$TERMUX_PKG_BUILDER_DIR/netbsd_getpass.c" "$TERMUX_PKG_SRCDIR/clients/kpasswd/" CFLAGS="$CFLAGS -D_PASSWORD_LEN=PASS_MAX" export LIBS="-landroid-glob -llog" } termux_step_post_make_install() { # Enable logging to STDERR by default echo -e "\tdefault = STDERR" >> $TERMUX_PKG_SRCDIR/config-files/krb5.conf # Sample KDC config file install -dm 700 $TERMUX_PREFIX/var/krb5kdc install -pm 600 $TERMUX_PKG_SRCDIR/config-files/kdc.conf $TERMUX_PREFIX/var/krb5kdc/kdc.conf # Default configuration file install -pm 600 $TERMUX_PKG_SRCDIR/config-files/krb5.conf $TERMUX_PREFIX/etc/krb5.conf install -dm 700 $TERMUX_PREFIX/share/aclocal install -m 600 $TERMUX_PKG_SRCDIR/util/ac_check_krb5.m4 $TERMUX_PREFIX/share/aclocal } ================================================ FILE: packages/krb5/config-files-kdc.conf.patch ================================================ --- ./config-files/kdc.conf 2017-03-03 03:36:02.000000000 +0530 +++ ../kdc.conf 2017-04-02 20:29:55.296108766 +0530 @@ -1,14 +1,14 @@ [kdcdefaults] - kdc_listen = 88 - kdc_tcp_listen = 88 + kdc_listen = 1088 + kdc_tcp_listen = 1088 [realms] ATHENA.MIT.EDU = { - database_name = /usr/local/var/krb5kdc/principal - acl_file = /usr/local/var/krb5kdc/kadm5.acl - key_stash_file = /usr/local/var/krb5kdc/.k5.ATHENA.MIT.EDU - kdc_listen = 88 - kdc_tcp_listen = 88 + database_name = @TERMUX_PREFIX@/var/krb5kdc/principal + acl_file = @TERMUX_PREFIX@/var/krb5kdc/kadm5.acl + key_stash_file = @TERMUX_PREFIX@/var/krb5kdc/.k5.ATHENA.MIT.EDU + kdc_listen = 1088 + kdc_tcp_listen = 1088 max_life = 10h 0m 0s max_renewable_life = 7d 0h 0m 0s } ================================================ FILE: packages/krb5/include-osconf.hin.patch ================================================ --- ./include/osconf.hin 2017-03-03 03:36:02.000000000 +0530 +++ ../osconf.hin 2017-04-03 10:45:03.475924421 +0530 @@ -81,12 +81,12 @@ #define KDC_PORTNAME "kerberos" /* for /etc/services or equiv. */ -#define KRB5_DEFAULT_PORT 88 +#define KRB5_DEFAULT_PORT 1088 -#define DEFAULT_KPASSWD_PORT 464 +#define DEFAULT_KPASSWD_PORT 1464 -#define DEFAULT_KDC_UDP_PORTLIST "88" -#define DEFAULT_KDC_TCP_PORTLIST "88" +#define DEFAULT_KDC_UDP_PORTLIST "1088" +#define DEFAULT_KDC_TCP_PORTLIST "1088" #define DEFAULT_TCP_LISTEN_BACKLOG 5 /* @@ -94,7 +94,7 @@ */ #define DEFAULT_KADM5_KEYTAB KDC_DIR "/kadm5.keytab" #define DEFAULT_KADM5_ACL_FILE KDC_DIR "/kadm5.acl" -#define DEFAULT_KADM5_PORT 749 /* assigned by IANA */ +#define DEFAULT_KADM5_PORT 1749 /* assigned by IANA */ #define KRB5_DEFAULT_SUPPORTED_ENCTYPES \ "aes256-cts-hmac-sha1-96:normal " \ ================================================ FILE: packages/krb5/krb5-config_LDFLAGS.patch ================================================ https://bugs.gentoo.org/show_bug.cgi?id=448778 --- ./build-tools/krb5-config.in 2012-12-18 02:47:04.000000000 +0000 +++ ./build-tools/krb5-config.in 2012-12-28 07:13:16.582693363 +0000 @@ -217,7 +217,7 @@ -e 's#\$(PROG_RPATH)#'$libdir'#' \ -e 's#\$(PROG_LIBPATH)#'$libdirarg'#' \ -e 's#\$(RPATH_FLAG)#'"$RPATH_FLAG"'#' \ - -e 's#\$(LDFLAGS)#'"$LDFLAGS"'#' \ + -e 's#\$(LDFLAGS)##' \ -e 's#\$(PTHREAD_CFLAGS)#'"$PTHREAD_CFLAGS"'#' \ -e 's#\$(CFLAGS)##'` ================================================ FILE: packages/krb5/netbsd_getpass.c ================================================ /* $NetBSD: getpass.c,v 1.15 2003/08/07 16:42:50 agc Exp $ */ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if 0 #include #if defined(LIBC_SCCS) && !defined(lint) #if 0 static char sccsid[] = "@(#)getpass.c 8.1 (Berkeley) 6/4/93"; #else __RCSID("$NetBSD: getpass.c,v 1.15 2003/08/07 16:42:50 agc Exp $"); #endif #endif /* LIBC_SCCS and not lint */ #include "namespace.h" #endif #include #include #include #include #include #include #include #if 0 #ifdef __weak_alias __weak_alias(getpass,_getpass) #endif #endif char * getpass(prompt) const char *prompt; { struct termios term; int ch; char *p; FILE *fp, *outfp; int echo; static char buf[_PASSWORD_LEN + 1]; sigset_t oset, nset; #if 0 _DIAGASSERT(prompt != NULL); #endif /* * read and write to /dev/tty if possible; else read from * stdin and write to stderr. */ if ((outfp = fp = fopen(_PATH_TTY, "w+")) == NULL) { outfp = stderr; fp = stdin; } /* * note - blocking signals isn't necessarily the * right thing, but we leave it for now. */ sigemptyset(&nset); sigaddset(&nset, SIGINT); sigaddset(&nset, SIGTSTP); (void)sigprocmask(SIG_BLOCK, &nset, &oset); (void)tcgetattr(fileno(fp), &term); if ((echo = (term.c_lflag & ECHO)) != 0) { term.c_lflag &= ~ECHO; (void)tcsetattr(fileno(fp), TCSAFLUSH /*|TCSASOFT*/, &term); } if (prompt != NULL) (void)fputs(prompt, outfp); rewind(outfp); /* implied flush */ for (p = buf; (ch = getc(fp)) != EOF && ch != '\n';) if (p < buf + _PASSWORD_LEN) *p++ = ch; *p = '\0'; (void)write(fileno(outfp), "\n", 1); if (echo) { term.c_lflag |= ECHO; (void)tcsetattr(fileno(fp), TCSAFLUSH/*|TCSASOFT*/, &term); } (void)sigprocmask(SIG_SETMASK, &oset, NULL); if (fp != stdin) (void)fclose(fp); return(buf); } ================================================ FILE: packages/krb5/plugins-kdb-db2.patch ================================================ --- ./plugins/kdb/db2/policy_db.h 2017-03-03 03:36:02.000000000 +0530 +++ ../policy_db.h 2017-04-02 09:46:43.244368060 +0530 @@ -30,7 +30,7 @@ where we find u_int32_t. */ #include #include -#include +#include #include "adb_err.h" #include --- ./plugins/kdb/db2/adb_openclose.c 2017-03-03 03:36:02.000000000 +0530 +++ ../adb_openclose.c 2017-04-02 09:50:13.854729855 +0530 @@ -11,7 +11,7 @@ #include #include "policy_db.h" #include -#include +#include struct _locklist { osa_adb_lock_ent lockinfo; --- ./plugins/kdb/db2/db2_exp.c 2017-03-03 03:36:02.000000000 +0530 +++ ../db2_exp.c 2017-04-02 09:51:07.528042151 +0530 @@ -38,7 +38,7 @@ #include #endif -#include +#include #include #include #include --- ./plugins/kdb/db2/kdb_db2.c 2017-03-03 03:36:02.000000000 +0530 +++ ../kdb_db2.c 2017-04-02 09:52:14.924568844 +0530 @@ -57,7 +57,7 @@ #include #endif -#include +#include #include #include #include ================================================ FILE: packages/krb5/sethostent.patch ================================================ --- ./tests/resolve/resolve.c 2016-12-02 04:01:25.000000000 +0530 +++ ../resolve.c 2016-12-07 11:10:38.473122715 +0530 @@ -111,7 +111,7 @@ /* Set the hosts db to close each time - effectively rewinding file */ - sethostent(0); + /* sethostent(0); */ if((host = gethostbyname (myname)) == NULL) { fprintf(stderr, ================================================ FILE: packages/kubectl/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://kubernetes.io TERMUX_PKG_DESCRIPTION="Kubernetes.io client binary" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.16.3 TERMUX_PKG_SRCURL=https://dl.k8s.io/v$TERMUX_PKG_VERSION/kubernetes-src.tar.gz TERMUX_PKG_SHA256=d176b9d8f641be5b4cd2c62be86cb6a0baa7e52c224f02ef12cab1f39b57ecec termux_step_extract_package() { mkdir -p "$TERMUX_PKG_CACHEDIR" mkdir -p "$TERMUX_PKG_SRCDIR" termux_download "$TERMUX_PKG_SRCURL" "$TERMUX_PKG_CACHEDIR"/kubernetes-src.tar.gz \ "$TERMUX_PKG_SHA256" tar xf "$TERMUX_PKG_CACHEDIR"/kubernetes-src.tar.gz \ -C "$TERMUX_PKG_SRCDIR" } termux_step_make() { termux_setup_golang # Needed to generate manpages. #( # export GOPATH="$TERMUX_PKG_BUILDDIR/host" # unset GOOS GOARCH CGO_LDFLAGS # unset CC CXX CFLAGS CXXFLAGS LDFLAGS # cd "$TERMUX_PKG_SRCDIR" # ./hack/update-generated-docs.sh #) export GOPATH="$TERMUX_PKG_BUILDDIR/target" #chmod +w "$TERMUX_PKG_SRCDIR"/_output #rm -rf "$TERMUX_PKG_SRCDIR"/_output cd "$TERMUX_PKG_SRCDIR"/cmd/kubectl go build . } termux_step_make_install() { install -Dm700 "$TERMUX_PKG_SRCDIR"/cmd/kubectl/kubectl \ "$TERMUX_PREFIX"/bin/kubectl #mkdir -p "$TERMUX_PREFIX"/share/man/man1 #cp -f "$TERMUX_PKG_SRCDIR"/docs/man/man1/kubectl-*.1 \ # "$TERMUX_PREFIX"/share/man/man1/ } ================================================ FILE: packages/ldc/build.sh ================================================ LLVM_INSTALL_DIR=$TERMUX_PKG_BUILDDIR/llvm-install TERMUX_PKG_HOMEPAGE=https://github.com/ldc-developers/ldc TERMUX_PKG_DESCRIPTION="D programming language compiler, built with LLVM" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=() TERMUX_PKG_VERSION+=(1.18.0) TERMUX_PKG_VERSION+=(9.0.0) # LLVM version TERMUX_PKG_VERSION+=(2.088.1) # TOOLS version TERMUX_PKG_VERSION+=(8ffc09ed6fb9625837161ffbbda2d926f490196c) # DUB version TERMUX_PKG_REVISION=5 TERMUX_PKG_SRCURL=(https://github.com/ldc-developers/ldc/releases/download/v${TERMUX_PKG_VERSION}/ldc-${TERMUX_PKG_VERSION}-src.tar.gz https://github.com/ldc-developers/llvm/releases/download/ldc-v${TERMUX_PKG_VERSION[1]}/llvm-${TERMUX_PKG_VERSION[1]}.src.tar.xz https://github.com/dlang/tools/archive/v${TERMUX_PKG_VERSION[2]}.tar.gz https://github.com/dlang/dub/archive/${TERMUX_PKG_VERSION[3]}.tar.gz https://github.com/ldc-developers/ldc/releases/download/v${TERMUX_PKG_VERSION}/ldc2-${TERMUX_PKG_VERSION}-linux-x86_64.tar.xz) TERMUX_PKG_SHA256=(aa6b491a4d756942c471778724dbdc7e96026eba4d55720cd66574b9ce42155d 0d8d5ebde82843f9b9829494a210c09315c6866c9f8b5df78be35d44943bb1f0 e2eb1afe24985096554c971059916bfad1573b85786529c0394009c8db967139 e11c4b171c0d26f4d85216aabb1e03d289a5551eda4e2c1bd7b70cf2ca57fd6a 04ba1573fb9c728d555340249b8d54cf7d34d249ea185a240be7ab341c764cf5) TERMUX_PKG_DEPENDS="clang, libc++, zlib" TERMUX_PKG_NO_STATICSPLIT=true TERMUX_PKG_HOSTBUILD=true TERMUX_PKG_FORCE_CMAKE=true #These CMake args are only used to configure a patched LLVM TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DLLVM_ENABLE_PIC=ON -DLLVM_ENABLE_PLUGINS=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_BUILD_UTILS=OFF -DCOMPILER_RT_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_ENABLE_LIBEDIT=OFF -DLLVM_TABLEGEN=$TERMUX_PKG_HOSTBUILD_DIR/bin/llvm-tblgen -DLLVM_CONFIG_PATH=$TERMUX_PKG_HOSTBUILD_DIR/bin/llvm-config -DPYTHON_EXECUTABLE=$(which python3) -DLLVM_TARGETS_TO_BUILD='AArch64;ARM;WebAssembly;X86' -DCMAKE_INSTALL_PREFIX=$LLVM_INSTALL_DIR " termux_step_post_extract_package() { # Certain packages are not safe to build on device because their # build.sh script deletes specific files in $TERMUX_PREFIX. if $TERMUX_ON_DEVICE_BUILD; then termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds." fi mv llvm-${TERMUX_PKG_VERSION[1]}.src llvm mv tools-${TERMUX_PKG_VERSION[2]} dlang-tools mv dub-${TERMUX_PKG_VERSION[3]} dub LLVM_TRIPLE=${TERMUX_HOST_PLATFORM/-/--} if [ $TERMUX_ARCH = arm ]; then LLVM_TRIPLE=${LLVM_TRIPLE/arm-/armv7a-}; fi } termux_step_host_build() { termux_setup_cmake termux_setup_ninja # Build native llvm-tblgen, a prerequisite for cross-compiling LLVM cmake -GNinja $TERMUX_PKG_SRCDIR/llvm \ -DCMAKE_BUILD_TYPE=Release \ -DLLVM_BUILD_TOOLS=OFF \ -DLLVM_BUILD_UTILS=OFF \ -DCOMPILER_RT_INCLUDE_TESTS=OFF \ -DLLVM_INCLUDE_TESTS=OFF ninja -j $TERMUX_MAKE_PROCESSES llvm-tblgen } # Just before CMake invokation for LLVM: termux_step_pre_configure() { LDFLAGS+=" -lc++_shared" local LLVM_TARGET_ARCH if [ $TERMUX_ARCH = "arm" ]; then LLVM_TARGET_ARCH=ARM elif [ $TERMUX_ARCH = "aarch64" ]; then LLVM_TARGET_ARCH=AArch64 # LLVM 8.0.1's libclang_rt.hwasan-*-android.so fails to link for AArch64 and x86_64 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DCOMPILER_RT_BUILD_SANITIZERS=OFF" elif [ $TERMUX_ARCH = "i686" ]; then LLVM_TARGET_ARCH=X86 elif [ $TERMUX_ARCH = "x86_64" ]; then LLVM_TARGET_ARCH=X86 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DCOMPILER_RT_BUILD_SANITIZERS=OFF" else termux_error_exit "Invalid arch: $TERMUX_ARCH" fi TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${LLVM_TRIPLE}" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DLLVM_TARGET_ARCH=${LLVM_TARGET_ARCH}" # CPPFLAGS adds the system llvm to the include path, which causes # conflicts with the local patched llvm when compiling ldc CPPFLAGS="" OLD_TERMUX_PKG_SRCDIR=$TERMUX_PKG_SRCDIR TERMUX_PKG_SRCDIR=$TERMUX_PKG_SRCDIR/llvm OLD_TERMUX_PKG_BUILDDIR=$TERMUX_PKG_BUILDDIR TERMUX_PKG_BUILDDIR=$TERMUX_PKG_BUILDDIR/llvm mkdir "$TERMUX_PKG_BUILDDIR" } # CMake for LLVM has been run: termux_step_post_configure() { # Cross-compile & install LLVM cd "$TERMUX_PKG_BUILDDIR" if test -f build.ninja; then ninja -j $TERMUX_MAKE_PROCESSES install fi # Invoke CMake for LDC: TERMUX_PKG_SRCDIR=$OLD_TERMUX_PKG_SRCDIR TERMUX_PKG_BUILDDIR=$OLD_TERMUX_PKG_BUILDDIR cd "$TERMUX_PKG_BUILDDIR" # Replace non-native llvm-config executable with bash script, # as it is going to be invoked during LDC CMake config. sed $TERMUX_PKG_SRCDIR/.azure-pipelines/android-llvm-config.in \ -e "s|@LLVM_VERSION@|${TERMUX_PKG_VERSION[1]}|g" \ -e "s|@LLVM_INSTALL_DIR@|$LLVM_INSTALL_DIR|g" \ -e "s|@TERMUX_PKG_SRCDIR@|$TERMUX_PKG_SRCDIR/llvm|g" \ -e "s|@LLVM_DEFAULT_TARGET_TRIPLE@|$LLVM_TRIPLE|g" \ -e "s|@LLVM_TARGETS@|AArch64 ARM X86 WebAssembly|g" > $LLVM_INSTALL_DIR/bin/llvm-config chmod 755 $LLVM_INSTALL_DIR/bin/llvm-config LDC_FLAGS="-mtriple=$LLVM_TRIPLE" if [ $TERMUX_ARCH = arm ]; then LDC_FLAGS="$LDC_FLAGS;-mcpu=cortex-a8"; fi LDC_PATH=$TERMUX_PKG_SRCDIR/ldc2-$TERMUX_PKG_VERSION-linux-x86_64 DMD=$LDC_PATH/bin/ldmd2 TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DLLVM_ROOT_DIR=$LLVM_INSTALL_DIR \ -DD_COMPILER=$DMD \ -DCMAKE_INSTALL_PREFIX=$TERMUX_PREFIX \ -DLDC_WITH_LLD=OFF \ -DD_LINKER_ARGS='-fuse-ld=bfd;-Lldc-build-runtime.tmp/lib;-lphobos2-ldc;-ldruntime-ldc;-Wl,--gc-sections'" termux_step_configure_cmake } termux_step_make() { # Cross-compile the runtime libraries $LDC_PATH/bin/ldc-build-runtime --ninja -j $TERMUX_MAKE_PROCESSES \ --dFlags="$LDC_FLAGS" --cFlags="$CFLAGS -I$TERMUX_PREFIX/include" \ --targetSystem="Android;Linux;UNIX" --ldcSrcDir="$TERMUX_PKG_SRCDIR" # Set up host ldmd2 for cross-compilation export DFLAGS="${LDC_FLAGS//;/ }" # Cross-compile LDC executables (linked against runtime libs above) if test -f build.ninja; then ninja -j $TERMUX_MAKE_PROCESSES ldc2 ldmd2 ldc-build-runtime ldc-profdata ldc-prune-cache fi # Cross-compile dlang tools and dub: # Set up host ldmd2 for cross-compilation & -linking export DFLAGS="$DFLAGS -linker=bfd -L-L$TERMUX_PKG_BUILDDIR/ldc-build-runtime.tmp/lib -Xcc=-pie -L-z -Lnocopyreloc" if [ $TERMUX_ARCH = arm ]; then export DFLAGS="$DFLAGS -L--fix-cortex-a8"; fi cd $TERMUX_PKG_SRCDIR/dlang-tools $DMD -w -de rdmd.d -of=$TERMUX_PKG_BUILDDIR/bin/rdmd $DMD -w -de ddemangle.d -of=$TERMUX_PKG_BUILDDIR/bin/ddemangle $DMD -w -de DustMite/dustmite.d DustMite/splitter.d -of=$TERMUX_PKG_BUILDDIR/bin/dustmite cd $TERMUX_PKG_SRCDIR/dub $DMD -O -w -version=DubUseCurl -version=DubApplication -Isource @build-files.txt -of=$TERMUX_PKG_BUILDDIR/bin/dub } termux_step_make_install() { cp bin/{ddemangle,dub,dustmite,ldc-build-runtime,ldc-profdata,ldc-prune-cache,ldc2,ldmd2,rdmd} $TERMUX_PREFIX/bin cp $TERMUX_PKG_BUILDDIR/ldc-build-runtime.tmp/lib/*.a $TERMUX_PREFIX/lib sed "s|$TERMUX_PREFIX/|%%ldcbinarypath%%/../|g" bin/ldc2_install.conf > $TERMUX_PREFIX/etc/ldc2.conf cat $TERMUX_PREFIX/etc/ldc2.conf rm -Rf $TERMUX_PREFIX/include/d mkdir $TERMUX_PREFIX/include/d cp -r $TERMUX_PKG_SRCDIR/runtime/druntime/src/{core,etc,ldc,object.d} $TERMUX_PREFIX/include/d cp $LDC_PATH/import/ldc/gccbuiltins_{aarch64,arm,x86}.di $TERMUX_PREFIX/include/d/ldc cp -r $TERMUX_PKG_SRCDIR/runtime/phobos/etc/c $TERMUX_PREFIX/include/d/etc rm -Rf $TERMUX_PREFIX/include/d/etc/c/zlib cp -r $TERMUX_PKG_SRCDIR/runtime/phobos/std $TERMUX_PREFIX/include/d rm -Rf $TERMUX_PREFIX/share/ldc mkdir $TERMUX_PREFIX/share/ldc cp -r $TERMUX_PKG_SRCDIR/{LICENSE,README,packaging/bash_completion.d} $TERMUX_PREFIX/share/ldc } ================================================ FILE: packages/ldc/ldc-readme.patch ================================================ diff --git a/README b/README new file mode 100644 index 00000000..cd578cb7 --- /dev/null +++ b/README @@ -0,0 +1,18 @@ +This is LDC, the LLVM-based D compiler. It will natively +compile D on Android devices. + +The compiler configuration file is etc/ldc2.conf, and by +default only include/d is on the module search path. + +To develop for Android, you will find the D headers and +sample apps at this github repository useful: + +https://github.com/joakim-noah/android + +You can find instructions on building Android apps at the +D wiki: + +http://wiki.dlang.org/Build_D_for_Android + +For further information, including how to report bugs, +please refer to the LDC wiki: http://wiki.dlang.org/LDC. ================================================ FILE: packages/ldc/ldc-x64-sprintf.patch ================================================ diff --git a/dmd/dmangle.d b/dmd/dmangle.d index 8e2fc5b6f..7de4a02de 100644 --- a/dmd/dmangle.d +++ b/dmd/dmangle.d @@ -926,7 +926,10 @@ public: char[36] buffer = void; // 'A' format yields [-]0xh.hhhhp+-d - const n = CTFloat.sprint(buffer.ptr, 'A', value); + // sprintf/printf with hex formatting is broken for certain long + // doubles on Android/x64, so use decimal format instead. + char fmt = global.params.isAndroidX86_64 ? 'g' : 'A'; + const n = CTFloat.sprint(buffer.ptr, fmt, value); assert(n < buffer.length); foreach (const c; buffer[2 .. n]) { diff --git a/dmd/globals.d b/dmd/globals.d index 8589b6cf2..5dae07256 100644 --- a/dmd/globals.d +++ b/dmd/globals.d @@ -139,6 +139,7 @@ struct Param bool is64bit = (size_t.sizeof == 8); // generate 64 bit code; true by default for 64 bit dmd bool isLP64; // generate code for LP64 bool isLinux; // generate code for linux + bool isAndroidX86_64; // generate code for Android x86_64 bool isOSX; // generate code for Mac OSX bool isWindows; // generate code for Windows bool isFreeBSD; // generate code for FreeBSD diff --git a/dmd/globals.h b/dmd/globals.h index 098116f4d..57429400c 100644 --- a/dmd/globals.h +++ b/dmd/globals.h @@ -119,6 +119,7 @@ struct Param bool is64bit; // generate 64 bit code bool isLP64; // generate code for LP64 bool isLinux; // generate code for linux + bool isAndroidX86_64; // generate code for Android x86_64 bool isOSX; // generate code for Mac OSX bool isWindows; // generate code for Windows bool isFreeBSD; // generate code for FreeBSD diff --git a/driver/main.cpp b/driver/main.cpp index c8c7ec2c5..18b581759 100644 --- a/driver/main.cpp +++ b/driver/main.cpp @@ -1000,6 +1000,9 @@ int cppmain() { llvm::Triple *triple = new llvm::Triple(gTargetMachine->getTargetTriple()); global.params.targetTriple = triple; global.params.isLinux = triple->isOSLinux(); + global.params.isAndroidX86_64 = + triple->getEnvironment() == llvm::Triple::Android && + triple->getArch() == llvm::Triple::x86_64; global.params.isOSX = triple->isOSDarwin(); global.params.isWindows = triple->isOSWindows(); global.params.isFreeBSD = triple->isOSFreeBSD(); ================================================ FILE: packages/ldc/tests/hello_world.sh ================================================ ldc2 --version ldmd2 --version dub --version echo 'void main() { import std.stdio; writefln("Hello world, %d bits", size_t.sizeof * 8); }' > hello.d ldc2 hello.d ./hello rm hello.{d,o} hello ================================================ FILE: packages/ldns/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.nlnetlabs.nl/projects/ldns/ TERMUX_PKG_DESCRIPTION="Library for simplifying DNS programming and supporting recent and experimental RFCs" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=1.7.1 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://www.nlnetlabs.nl/downloads/ldns/ldns-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=8ac84c16bdca60e710eea75782356f3ac3b55680d40e1530d7cea474ac208229 TERMUX_PKG_DEPENDS="openssl" TERMUX_PKG_BREAKS="ldns-dev" TERMUX_PKG_REPLACES="ldns-dev" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --with-ssl=$TERMUX_PREFIX --disable-gost " termux_step_post_make_install() { # The ldns build doesn't install its pkg-config: mkdir -p $TERMUX_PREFIX/lib/pkgconfig cp packaging/libldns.pc $TERMUX_PREFIX/lib/pkgconfig/libldns.pc } ================================================ FILE: packages/ldns/fix-hardcoded-paths.patch ================================================ diff -uNr ldns-1.7.0/ldns/resolver.h ldns-1.7.0.mod/ldns/resolver.h --- ldns-1.7.0/ldns/resolver.h 2016-12-20 12:48:22.000000000 +0200 +++ ldns-1.7.0.mod/ldns/resolver.h 2017-10-04 16:27:10.112448953 +0300 @@ -33,9 +33,9 @@ #endif /** Default location of the resolv.conf file */ -#define LDNS_RESOLV_CONF "/etc/resolv.conf" +#define LDNS_RESOLV_CONF "@TERMUX_PREFIX@/etc/resolv.conf" /** Default location of the hosts file */ -#define LDNS_RESOLV_HOSTS "/etc/hosts" +#define LDNS_RESOLV_HOSTS "@TERMUX_PREFIX@/etc/hosts" #define LDNS_RESOLV_KEYWORD -1 #define LDNS_RESOLV_DEFDOMAIN 0 diff -uNr ldns-1.7.0/resolver.c ldns-1.7.0.mod/resolver.c --- ldns-1.7.0/resolver.c 2016-12-20 12:48:22.000000000 +0200 +++ ldns-1.7.0.mod/resolver.c 2017-10-04 16:28:34.203407382 +0300 @@ -780,7 +780,7 @@ if(!line_nr) line_nr = &lnr; if(!fp) { - myfp = fopen("/etc/resolv.conf", "r"); + myfp = fopen("@TERMUX_PREFIX@/etc/resolv.conf", "r"); if(!myfp) return LDNS_STATUS_FILE_ERR; } ================================================ FILE: packages/ldns/keys.c.patch ================================================ diff -u -r ../ldns-1.7.0/keys.c ./keys.c --- ../ldns-1.7.0/keys.c 2016-12-20 10:48:22.000000000 +0000 +++ ./keys.c 2018-08-23 17:05:00.759800098 +0000 @@ -107,7 +107,7 @@ k = ldns_key_new(); if(!k) return LDNS_STATUS_MEM_ERR; -#ifndef S_SPLINT_S +#if !defined(S_SPLINT_S) && !defined(OPENSSL_NO_ENGINE) k->_key.key = ENGINE_load_private_key(e, key_id, UI_OpenSSL(), NULL); if(!k->_key.key) { ldns_key_free(k); ================================================ FILE: packages/ledger/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.ledger-cli.org TERMUX_PKG_DESCRIPTION="Powerful, double-entry accounting system" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=3.1.3 TERMUX_PKG_REVISION=4 TERMUX_PKG_SRCURL=https://github.com/ledger/ledger/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=b248c91d65c7a101b9d6226025f2b4bf3dabe94c0c49ab6d51ce84a22a39622b TERMUX_PKG_DEPENDS="boost, libc++, libedit, libmpfr, libgmp" TERMUX_PKG_BREAKS="ledger-dev" TERMUX_PKG_REPLACES="ledger-dev" TERMUX_PKG_BUILD_DEPENDS="utf8cpp" # See https://gitlab.kitware.com/cmake/cmake/issues/18865: TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-DBoost_NO_BOOST_CMAKE=ON" ================================================ FILE: packages/leptonica/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.leptonica.com/ TERMUX_PKG_DESCRIPTION="Library for image processing and image analysis" TERMUX_PKG_LICENSE="BSD 2-Clause" TERMUX_PKG_VERSION=1.78.0 TERMUX_PKG_REVISION=3 TERMUX_PKG_SHA256=f8ac4d93cc76b524c2c81d27850bfc342e68b91368aa7a1f7d69e34ce13adbb4 TERMUX_PKG_SRCURL=https://github.com/DanBloomberg/leptonica/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="libjpeg-turbo, libpng, libtiff, zlib" TERMUX_PKG_BREAKS="leptonica-dev" TERMUX_PKG_REPLACES="leptonica-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--without-giflib --without-libwebp --without-libopenjpeg" termux_step_pre_configure() { ./autogen.sh } ================================================ FILE: packages/leptonica/silence-tmpfile-warnings.patch ================================================ diff -u -r ../leptonica-1.74.1/src/boxbasic.c ./src/boxbasic.c --- ../leptonica-1.74.1/src/boxbasic.c 2016-12-02 20:42:49.000000000 +0100 +++ ./src/boxbasic.c 2017-01-29 22:11:16.276072146 +0100 @@ -2066,7 +2066,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = boxaaWriteStream(fp, baa); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); @@ -2287,7 +2286,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = boxaWriteStream(fp, boxa); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); diff -u -r ../leptonica-1.74.1/src/colormap.c ./src/colormap.c --- ../leptonica-1.74.1/src/colormap.c 2016-12-02 20:42:53.000000000 +0100 +++ ./src/colormap.c 2017-01-29 22:11:16.316071650 +0100 @@ -1715,7 +1715,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = pixcmapWriteStream(fp, cmap); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); diff -u -r ../leptonica-1.74.1/src/dewarp1.c ./src/dewarp1.c --- ../leptonica-1.74.1/src/dewarp1.c 2016-12-02 20:42:57.000000000 +0100 +++ ./src/dewarp1.c 2017-01-29 22:11:16.352071204 +0100 @@ -1401,7 +1401,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = dewarpWriteStream(fp, dew); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); @@ -1673,7 +1672,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = dewarpaWriteStream(fp, dewa); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); diff -u -r ../leptonica-1.74.1/src/fpix1.c ./src/fpix1.c --- ../leptonica-1.74.1/src/fpix1.c 2016-12-02 20:43:01.000000000 +0100 +++ ./src/fpix1.c 2017-01-29 22:11:16.400070608 +0100 @@ -1904,7 +1904,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = fpixWriteStream(fp, fpix); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); @@ -2203,7 +2202,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = dpixWriteStream(fp, dpix); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); diff -u -r ../leptonica-1.74.1/src/jp2kio.c ./src/jp2kio.c --- ../leptonica-1.74.1/src/jp2kio.c 2016-12-02 20:43:11.000000000 +0100 +++ ./src/jp2kio.c 2017-01-29 22:11:16.424070311 +0100 @@ -847,7 +847,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = pixWriteStreamJp2k(fp, pix, quality, nlevels, hint, debug); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); diff -u -r ../leptonica-1.74.1/src/jpegio.c ./src/jpegio.c --- ../leptonica-1.74.1/src/jpegio.c 2016-12-02 20:43:18.000000000 +0100 +++ ./src/jpegio.c 2017-01-29 22:11:16.428070261 +0100 @@ -1091,7 +1091,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = pixWriteStreamJpeg(fp, pix, quality, progressive); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); diff -u -r ../leptonica-1.74.1/src/numabasic.c ./src/numabasic.c --- ../leptonica-1.74.1/src/numabasic.c 2016-12-02 20:43:25.000000000 +0100 +++ ./src/numabasic.c 2017-01-29 22:11:16.444070062 +0100 @@ -1276,7 +1276,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = numaWriteStream(fp, na); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); @@ -1962,7 +1961,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = numaaWriteStream(fp, naa); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); diff -u -r ../leptonica-1.74.1/src/pixabasic.c ./src/pixabasic.c --- ../leptonica-1.74.1/src/pixabasic.c 2016-12-02 20:43:29.000000000 +0100 +++ ./src/pixabasic.c 2017-01-29 22:11:16.488069517 +0100 @@ -2626,7 +2626,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = pixaWriteStream(fp, pixa); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); @@ -2998,7 +2997,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = pixaaWriteStream(fp, paa); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); diff -u -r ../leptonica-1.74.1/src/pixcomp.c ./src/pixcomp.c --- ../leptonica-1.74.1/src/pixcomp.c 2016-12-02 20:43:33.000000000 +0100 +++ ./src/pixcomp.c 2017-01-29 22:11:16.500069368 +0100 @@ -1841,7 +1841,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = pixacompWriteStream(fp, pixac); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); diff -u -r ../leptonica-1.74.1/src/pnmio.c ./src/pnmio.c --- ../leptonica-1.74.1/src/pnmio.c 2016-12-27 19:30:34.000000000 +0100 +++ ./src/pnmio.c 2017-01-29 22:11:16.512069219 +0100 @@ -1179,7 +1179,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = pixWriteStreamPnm(fp, pix); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); @@ -1234,7 +1233,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = pixWriteStreamPam(fp, pix); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); diff -u -r ../leptonica-1.74.1/src/ptabasic.c ./src/ptabasic.c --- ../leptonica-1.74.1/src/ptabasic.c 2016-12-02 20:43:49.000000000 +0100 +++ ./src/ptabasic.c 2017-01-29 22:11:16.520069120 +0100 @@ -871,7 +871,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = ptaWriteStream(fp, pta, type); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); @@ -1463,7 +1462,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = ptaaWriteStream(fp, ptaa, type); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); diff -u -r ../leptonica-1.74.1/src/sarray1.c ./src/sarray1.c --- ../leptonica-1.74.1/src/sarray1.c 2016-12-21 21:11:34.000000000 +0100 +++ ./src/sarray1.c 2017-01-29 22:11:16.552068723 +0100 @@ -1567,7 +1567,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = sarrayWriteStream(fp, sa); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); diff -u -r ../leptonica-1.74.1/src/utils2.c ./src/utils2.c --- ../leptonica-1.74.1/src/utils2.c 2016-12-21 21:11:53.000000000 +0100 +++ ./src/utils2.c 2017-01-29 22:11:16.584068326 +0100 @@ -1635,7 +1635,6 @@ if ((fp = fmemopen((void *)data, size, "rb")) == NULL) return (FILE *)ERROR_PTR("stream not opened", procName, NULL); #else /* write to tmp file */ - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return (FILE *)ERROR_PTR("tmpfile stream not opened", procName, NULL); ================================================ FILE: packages/leptonica/src-recogbasic.c.patch ================================================ diff -u -r ../leptonica-1.74.2/src/recogbasic.c ./src/recogbasic.c --- ../leptonica-1.74.2/src/recogbasic.c 2017-05-20 03:30:27.000000000 +0200 +++ ./src/recogbasic.c 2017-06-07 01:17:15.994340419 +0200 @@ -1065,7 +1065,6 @@ return ERROR_INT("stream not opened", procName, 1); ret = recogWriteStream(fp, recog); #else - L_INFO("work-around: writing to a temp file\n", procName); #ifdef _WIN32 if ((fp = fopenWriteWinTempfile()) == NULL) return ERROR_INT("tmpfile stream not opened", procName, 1); ================================================ FILE: packages/less/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.greenwoodsoftware.com/less/ TERMUX_PKG_DESCRIPTION="Terminal pager program used to view the contents of a text file one screen at a time" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=551 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=http://www.greenwoodsoftware.com/less/less-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=ff165275859381a63f19135a8f1f6c5a194d53ec3187f94121ecd8ef0795fe3d TERMUX_PKG_DEPENDS="ncurses" TERMUX_PKG_ESSENTIAL=true ================================================ FILE: packages/less/configure.patch ================================================ diff -u -r ../less-487/configure ./configure --- ../less-487/configure 2016-10-25 14:37:42.000000000 +0000 +++ ./configure 2017-07-07 08:39:29.875341117 +0000 @@ -4077,6 +4077,7 @@ LIBS="$LIBS $TERMLIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include int main () ================================================ FILE: packages/less/less_multilib.patch ================================================ Index: SOURCES/less-multilib.patch diff -u /dev/null SOURCES/less-multilib.patch:1.1 --- /dev/null Fri Mar 2 18:37:48 2007 +++ less-multilib.patch Fri Mar 2 18:37:43 2007 @@ -0,0 +1,19 @@ +--- less-394/Makefile.in.orig 2007-03-02 17:40:55.000000000 +0100 ++++ less-394/Makefile.in 2007-03-02 17:41:38.000000000 +0100 +@@ -51,13 +51,13 @@ + all: less lesskey lessecho + + less: ${OBJ} +- ${CC} ${LDFLAGS} -o $@ ${OBJ} ${LIBS} ++ ${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${OBJ} ${LIBS} + + lesskey: lesskey.${O} version.${O} +- ${CC} ${LDFLAGS} -o $@ lesskey.${O} version.${O} ++ ${CC} ${CFLAGS} ${LDFLAGS} -o $@ lesskey.${O} version.${O} + + lessecho: lessecho.${O} version.${O} +- ${CC} ${LDFLAGS} -o $@ lessecho.${O} version.${O} ++ ${CC} ${CFLAGS} ${LDFLAGS} -o $@ lessecho.${O} version.${O} + + ${OBJ}: ${srcdir}/less.h ${srcdir}/funcs.h defines.h + ================================================ FILE: packages/leveldb/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/google/leveldb TERMUX_PKG_DESCRIPTION="Fast key-value storage library" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=1.22 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/google/leveldb/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=55423cac9e3306f4a9502c738a001e4a339d1a38ffbee7572d4a07d5d63949b2 TERMUX_PKG_DEPENDS="libc++" TERMUX_PKG_BREAKS="leveldb-dev" TERMUX_PKG_REPLACES="leveldb-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-DBUILD_SHARED_LIBS=TRUE" ================================================ FILE: packages/lftp/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://lftp.tech/ TERMUX_PKG_DESCRIPTION="FTP/HTTP client and file transfer program" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=4.8.4 TERMUX_PKG_REVISION=9 TERMUX_PKG_SRCURL=https://lftp.tech/ftp/lftp-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=4ebc271e9e5cea84a683375a0f7e91086e5dac90c5d51bb3f169f75386107a62 TERMUX_PKG_DEPENDS="libandroid-support, libc++, libexpat, libiconv, openssl, readline, libidn2, zlib" # (1) Android has dn_expand, but lftp assumes that dn_skipname then exists, which it does not on android. # (2) Use --with-openssl to use openssl instead of gnutls. TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" ac_cv_func_dn_expand=no --with-openssl --with-expat=$TERMUX_PREFIX --with-readline=$TERMUX_PREFIX --with-zlib=$TERMUX_PREFIX " termux_step_pre_configure() { if $TERMUX_DEBUG; then # When doing debug build, -D_FORTIFY_SOURCE=2 gives this error: # /home/builder/.termux-build/_lib/16-aarch64-21-v3/bin/../sysroot/usr/include/bits/fortify/string.h:79:26: error: use of undeclared identifier '__USE_FORTIFY_LEVEL' export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/} fi CXXFLAGS+=" -DNO_INLINE_GETPASS=1" } ================================================ FILE: packages/lftp/lftp_ssl.cc.patch ================================================ diff -uNr lftp-4.8.3/src/lftp_ssl.cc lftp-4.8.3.mod/src/lftp_ssl.cc --- lftp-4.8.3/src/lftp_ssl.cc 2017-08-10 12:57:37.000000000 +0300 +++ lftp-4.8.3.mod/src/lftp_ssl.cc 2017-12-19 17:06:58.526580533 +0200 @@ -214,6 +214,8 @@ "/usr/local/ssl/certs/ca-bundle.crt", "/etc/apache/ssl.crt/ca-bundle.crt", "/usr/share/curl/curl-ca-bundle.crt", + "@TERMUX_PREFIX@/etc/tls/cert.pem", + "@TERMUX_PREFIX@/etc/tls/ca-bundle.crt", 0}; for(int i=0; ca_file_location[i]; i++) { ================================================ FILE: packages/lftp/lib-vasnprintf.c.patch ================================================ diff -uNr lftp-4.8.4/lib/vasnprintf.c lftp-4.8.4.mod/lib/vasnprintf.c --- lftp-4.8.4/lib/vasnprintf.c 2018-07-31 14:04:57.000000000 +0300 +++ lftp-4.8.4.mod/lib/vasnprintf.c 2019-10-27 20:05:33.109405874 +0200 @@ -4872,7 +4872,7 @@ # if ! (((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) \ && !defined __UCLIBC__) \ || (defined __APPLE__ && defined __MACH__) \ - || (defined _WIN32 && ! defined __CYGWIN__)) + || (defined _WIN32 && ! defined __CYGWIN__) || defined(__ANDROID__)) fbp[1] = '%'; fbp[2] = 'n'; fbp[3] = '\0'; ================================================ FILE: packages/lftp/src-Filter.cc.patch ================================================ diff -u -r ../lftp-4.8.0/src/Filter.cc ./src/Filter.cc --- ../lftp-4.8.0/src/Filter.cc 2017-04-24 08:20:52.000000000 +0200 +++ ./src/Filter.cc 2017-08-20 22:06:59.423505183 +0200 @@ -209,7 +209,7 @@ } else { - execl("/bin/sh","sh","-c",name.get(),NULL); + execl("@TERMUX_PREFIX@/bin/sh","sh","-c",name.get(),NULL); fprintf(stderr,_("execl(/bin/sh) failed: %s\n"),strerror(errno)); } fflush(stderr); ================================================ FILE: packages/lftp/src-PtyShell.cc.patch ================================================ --- ../cache/lftp-4.8.0/src/PtyShell.cc 2016-02-21 00:57:52.000000000 +1100 +++ ./src/PtyShell.cc 2017-07-21 14:33:14.130083766 +1000 @@ -143,7 +143,7 @@ putenv((char*)"LANGUAGE=C"); if(a) execvp(a->a0(),a->GetVNonConst()); - execl("/bin/sh","sh","-c",name.get(),NULL); + execl("@TERMUX_PREFIX@/bin/sh","sh","-c",name.get(),NULL); fprintf(stderr,_("execl(/bin/sh) failed: %s\n"),strerror(errno)); fflush(stderr); _exit(1); ================================================ FILE: packages/lftp/src-SysCmdJob.cc.patch ================================================ diff -u -r ../lftp-4.8.0/src/SysCmdJob.cc ./src/SysCmdJob.cc --- ../lftp-4.8.0/src/SysCmdJob.cc 2013-03-19 14:02:12.000000000 +0100 +++ ./src/SysCmdJob.cc 2017-08-20 22:05:45.452393625 +0200 @@ -54,7 +54,7 @@ const char *shell=getenv("SHELL"); if(!shell) - shell="/bin/sh"; + shell="@TERMUX_PREFIX@/bin/sh"; ProcWait::Signal(false); ================================================ FILE: packages/lftp/src-commands.cc.patch ================================================ diff -uNr lftp-4.8.3/src/commands.cc lftp-4.8.3.mod/src/commands.cc --- lftp-4.8.3/src/commands.cc 2017-08-10 13:17:10.000000000 +0300 +++ lftp-4.8.3.mod/src/commands.cc 2017-12-19 16:59:50.095958249 +0200 @@ -3006,7 +3006,7 @@ xstring cmd0("exec ${EDITOR:-vi} "); cmd0.append(shell_encode(lftp_bookmarks.GetFilePath())); - xstring cmd1("/bin/sh -c "); + xstring cmd1("@TERMUX_PREFIX@/bin/sh -c "); cmd1.append(shell_encode(cmd0)); parent->PrependCmd(xstring::get_tmp("shell ").append_quoted(cmd1)); ================================================ FILE: packages/lhasa/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://fragglet.github.io/lhasa/ TERMUX_PKG_DESCRIPTION="LHA compressor/decompressor" TERMUX_PKG_LICENSE="ISC" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.3.1 TERMUX_PKG_REVISION=5 TERMUX_PKG_SRCURL=https://soulsphere.org/projects/lhasa/lhasa-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=3fb08e5f85a9b9dd023922896be9157d5fb5c0448424681810aaa2b0558a5f24 TERMUX_PKG_BREAKS="lhasa-dev" TERMUX_PKG_REPLACES="lhasa-dev" TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/libandroid-glob/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://man7.org/linux/man-pages/man3/glob.3.html TERMUX_PKG_DESCRIPTION="Shared library for the glob(3) system function" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=0.6 TERMUX_PKG_SKIP_SRC_EXTRACT=true TERMUX_PKG_BREAKS="libandroid-glob-dev" TERMUX_PKG_REPLACES="libandroid-glob-dev" TERMUX_PKG_BUILD_IN_SRC=true termux_step_make() { $CC $CFLAGS $CPPFLAGS -I$TERMUX_PKG_BUILDER_DIR -c $TERMUX_PKG_BUILDER_DIR/glob.c $CC $LDFLAGS -shared glob.o -o libandroid-glob.so $AR rcu libandroid-glob.a glob.o } termux_step_make_install() { install -Dm600 $TERMUX_PKG_BUILDER_DIR/glob.h $TERMUX_PREFIX/include/glob.h install -Dm600 libandroid-glob.a $TERMUX_PREFIX/lib/libandroid-glob.a install -Dm600 libandroid-glob.so $TERMUX_PREFIX/lib/libandroid-glob.so } ================================================ FILE: packages/libandroid-glob/glob.c ================================================ /* * Natanael Arndt, 2011: removed collate.h dependencies * (my changes are trivial) * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Guido van Rossum. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93"; #endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); /* * glob(3) -- a superset of the one defined in POSIX 1003.2. * * The [!...] convention to negate a range is supported (SysV, Posix, ksh). * * Optional extra services, controlled by flags not defined by POSIX: * * GLOB_QUOTE: * Escaping convention: \ inhibits any special meaning the following * character might have (except \ at end of string is retained). * GLOB_MAGCHAR: * Set in gl_flags if pattern contained a globbing character. * GLOB_NOMAGIC: * Same as GLOB_NOCHECK, but it will only append pattern if it did * not contain any magic characters. [Used in csh style globbing] * GLOB_ALTDIRFUNC: * Use alternately specified directory access functions. * GLOB_TILDE: * expand ~user/foo to the /home/dir/of/user/foo * GLOB_BRACE: * expand {1,2}{a,b} to 1a 1b 2a 2b * gl_matchc: * Number of matches in the current invocation of glob. */ /* * Some notes on multibyte character support: * 1. Patterns with illegal byte sequences match nothing - even if * GLOB_NOCHECK is specified. * 2. Illegal byte sequences in filenames are handled by treating them as * single-byte characters with a value of the first byte of the sequence * cast to wchar_t. * 3. State-dependent encodings are not currently supported. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define DOLLAR '$' #define DOT '.' #define EOS '\0' #define LBRACKET '[' #define NOT '!' #define QUESTION '?' #define QUOTE '\\' #define RANGE '-' #define RBRACKET ']' #define SEP '/' #define STAR '*' #define TILDE '~' #define UNDERSCORE '_' #define LBRACE '{' #define RBRACE '}' #define SLASH '/' #define COMMA ',' #ifndef DEBUG #define M_QUOTE 0x8000000000ULL #define M_PROTECT 0x4000000000ULL #define M_MASK 0xffffffffffULL #define M_CHAR 0x00ffffffffULL typedef uint_fast64_t Char; #else #define M_QUOTE 0x80 #define M_PROTECT 0x40 #define M_MASK 0xff #define M_CHAR 0x7f typedef char Char; #endif #define CHAR(c) ((Char)((c)&M_CHAR)) #define META(c) ((Char)((c)|M_QUOTE)) #define M_ALL META('*') #define M_END META(']') #define M_NOT META('!') #define M_ONE META('?') #define M_RNG META('-') #define M_SET META('[') #define ismeta(c) (((c)&M_QUOTE) != 0) static int compare(const void *, const void *); static int g_Ctoc(const Char *, char *, size_t); static int g_lstat(Char *, struct stat *, glob_t *); static DIR *g_opendir(Char *, glob_t *); static const Char *g_strchr(const Char *, wchar_t); #ifdef notdef static Char *g_strcat(Char *, const Char *); #endif static int g_stat(Char *, struct stat *, glob_t *); static int glob0(const Char *, glob_t *, size_t *); static int glob1(Char *, glob_t *, size_t *); static int glob2(Char *, Char *, Char *, Char *, glob_t *, size_t *); static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, size_t *); static int globextend(const Char *, glob_t *, size_t *); static const Char * globtilde(const Char *, Char *, size_t, glob_t *); static int globexp1(const Char *, glob_t *, size_t *); static int globexp2(const Char *, const Char *, glob_t *, int *, size_t *); static int match(Char *, Char *, Char *); #ifdef DEBUG static void qprintf(const char *, Char *); #endif int glob(const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob) { const char *patnext; size_t limit; Char *bufnext, *bufend, patbuf[MAXPATHLEN], prot; mbstate_t mbs; wchar_t wc; size_t clen; patnext = pattern; if (!(flags & GLOB_APPEND)) { pglob->gl_pathc = 0; pglob->gl_pathv = NULL; if (!(flags & GLOB_DOOFFS)) pglob->gl_offs = 0; } if (flags & GLOB_LIMIT) { limit = pglob->gl_matchc; if (limit == 0) limit = sysconf(_SC_ARG_MAX); } else limit = 0; pglob->gl_flags = flags & ~GLOB_MAGCHAR; pglob->gl_errfunc = errfunc; pglob->gl_matchc = 0; bufnext = patbuf; bufend = bufnext + MAXPATHLEN - 1; if (flags & GLOB_NOESCAPE) { memset(&mbs, 0, sizeof(mbs)); while (bufend - bufnext >= MB_CUR_MAX) { clen = mbrtowc(&wc, patnext, MB_LEN_MAX, &mbs); if (clen == (size_t)-1 || clen == (size_t)-2) return (GLOB_NOMATCH); else if (clen == 0) break; *bufnext++ = wc; patnext += clen; } } else { /* Protect the quoted characters. */ memset(&mbs, 0, sizeof(mbs)); while (bufend - bufnext >= MB_CUR_MAX) { if (*patnext == QUOTE) { if (*++patnext == EOS) { *bufnext++ = QUOTE | M_PROTECT; continue; } prot = M_PROTECT; } else prot = 0; clen = mbrtowc(&wc, patnext, MB_LEN_MAX, &mbs); if (clen == (size_t)-1 || clen == (size_t)-2) return (GLOB_NOMATCH); else if (clen == 0) break; *bufnext++ = wc | prot; patnext += clen; } } *bufnext = EOS; if (flags & GLOB_BRACE) return globexp1(patbuf, pglob, &limit); else return glob0(patbuf, pglob, &limit); } /* * Expand recursively a glob {} pattern. When there is no more expansion * invoke the standard globbing routine to glob the rest of the magic * characters */ static int globexp1(const Char *pattern, glob_t *pglob, size_t *limit) { const Char* ptr = pattern; int rv; /* Protect a single {}, for find(1), like csh */ if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) return glob0(pattern, pglob, limit); while ((ptr = g_strchr(ptr, LBRACE)) != NULL) if (!globexp2(ptr, pattern, pglob, &rv, limit)) return rv; return glob0(pattern, pglob, limit); } /* * Recursive brace globbing helper. Tries to expand a single brace. * If it succeeds then it invokes globexp1 with the new pattern. * If it fails then it tries to glob the rest of the pattern and returns. */ static int globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, size_t *limit) { int i; Char *lm, *ls; const Char *pe, *pm, *pm1, *pl; Char patbuf[MAXPATHLEN]; /* copy part up to the brace */ for (lm = patbuf, pm = pattern; pm != ptr; *lm++ = *pm++) continue; *lm = EOS; ls = lm; /* Find the balanced brace */ for (i = 0, pe = ++ptr; *pe; pe++) if (*pe == LBRACKET) { /* Ignore everything between [] */ for (pm = pe++; *pe != RBRACKET && *pe != EOS; pe++) continue; if (*pe == EOS) { /* * We could not find a matching RBRACKET. * Ignore and just look for RBRACE */ pe = pm; } } else if (*pe == LBRACE) i++; else if (*pe == RBRACE) { if (i == 0) break; i--; } /* Non matching braces; just glob the pattern */ if (i != 0 || *pe == EOS) { *rv = glob0(patbuf, pglob, limit); return 0; } for (i = 0, pl = pm = ptr; pm <= pe; pm++) switch (*pm) { case LBRACKET: /* Ignore everything between [] */ for (pm1 = pm++; *pm != RBRACKET && *pm != EOS; pm++) continue; if (*pm == EOS) { /* * We could not find a matching RBRACKET. * Ignore and just look for RBRACE */ pm = pm1; } break; case LBRACE: i++; break; case RBRACE: if (i) { i--; break; } /* FALLTHROUGH */ case COMMA: if (i && *pm == COMMA) break; else { /* Append the current string */ for (lm = ls; (pl < pm); *lm++ = *pl++) continue; /* * Append the rest of the pattern after the * closing brace */ for (pl = pe + 1; (*lm++ = *pl++) != EOS;) continue; /* Expand the current pattern */ #ifdef DEBUG qprintf("globexp2:", patbuf); #endif *rv = globexp1(patbuf, pglob, limit); /* move after the comma, to the next string */ pl = pm + 1; } break; default: break; } *rv = 0; return 0; } /* * expand tilde from the passwd file. */ static const Char * globtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob) { struct passwd *pwd; char *h; const Char *p; Char *b, *eb; if (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE)) return pattern; /* * Copy up to the end of the string or / */ eb = &patbuf[patbuf_len - 1]; for (p = pattern + 1, h = (char *) patbuf; h < (char *)eb && *p && *p != SLASH; *h++ = *p++) continue; *h = EOS; if (((char *) patbuf)[0] == EOS) { /* * handle a plain ~ or ~/ by expanding $HOME first (iff * we're not running setuid or setgid) and then trying * the password file */ if ( #ifndef __ANDROID__ issetugid() != 0 || #endif (h = getenv("HOME")) == NULL) { if (((h = getlogin()) != NULL && (pwd = getpwnam(h)) != NULL) || (pwd = getpwuid(getuid())) != NULL) h = pwd->pw_dir; else return pattern; } } else { /* * Expand a ~user */ if ((pwd = getpwnam((char*) patbuf)) == NULL) return pattern; else h = pwd->pw_dir; } /* Copy the home directory */ for (b = patbuf; b < eb && *h; *b++ = *h++) continue; /* Append the rest of the pattern */ while (b < eb && (*b++ = *p++) != EOS) continue; *b = EOS; return patbuf; } /* * The main glob() routine: compiles the pattern (optionally processing * quotes), calls glob1() to do the real pattern matching, and finally * sorts the list (unless unsorted operation is requested). Returns 0 * if things went well, nonzero if errors occurred. */ static int glob0(const Char *pattern, glob_t *pglob, size_t *limit) { const Char *qpatnext; int err; size_t oldpathc; Char *bufnext, c, patbuf[MAXPATHLEN]; qpatnext = globtilde(pattern, patbuf, MAXPATHLEN, pglob); oldpathc = pglob->gl_pathc; bufnext = patbuf; /* We don't need to check for buffer overflow any more. */ while ((c = *qpatnext++) != EOS) { switch (c) { case LBRACKET: c = *qpatnext; if (c == NOT) ++qpatnext; if (*qpatnext == EOS || g_strchr(qpatnext+1, RBRACKET) == NULL) { *bufnext++ = LBRACKET; if (c == NOT) --qpatnext; break; } *bufnext++ = M_SET; if (c == NOT) *bufnext++ = M_NOT; c = *qpatnext++; do { *bufnext++ = CHAR(c); if (*qpatnext == RANGE && (c = qpatnext[1]) != RBRACKET) { *bufnext++ = M_RNG; *bufnext++ = CHAR(c); qpatnext += 2; } } while ((c = *qpatnext++) != RBRACKET); pglob->gl_flags |= GLOB_MAGCHAR; *bufnext++ = M_END; break; case QUESTION: pglob->gl_flags |= GLOB_MAGCHAR; *bufnext++ = M_ONE; break; case STAR: pglob->gl_flags |= GLOB_MAGCHAR; /* collapse adjacent stars to one, * to avoid exponential behavior */ if (bufnext == patbuf || bufnext[-1] != M_ALL) *bufnext++ = M_ALL; break; default: *bufnext++ = CHAR(c); break; } } *bufnext = EOS; #ifdef DEBUG qprintf("glob0:", patbuf); #endif if ((err = glob1(patbuf, pglob, limit)) != 0) return(err); /* * If there was no match we are going to append the pattern * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified * and the pattern did not contain any magic characters * GLOB_NOMAGIC is there just for compatibility with csh. */ if (pglob->gl_pathc == oldpathc) { if (((pglob->gl_flags & GLOB_NOCHECK) || ((pglob->gl_flags & GLOB_NOMAGIC) && !(pglob->gl_flags & GLOB_MAGCHAR)))) return(globextend(pattern, pglob, limit)); else return(GLOB_NOMATCH); } if (!(pglob->gl_flags & GLOB_NOSORT)) qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc, pglob->gl_pathc - oldpathc, sizeof(char *), compare); return(0); } static int compare(const void *p, const void *q) { return(strcmp(*(char **)p, *(char **)q)); } static int glob1(Char *pattern, glob_t *pglob, size_t *limit) { Char pathbuf[MAXPATHLEN]; /* A null pathname is invalid -- POSIX 1003.1 sect. 2.4. */ if (*pattern == EOS) return(0); return(glob2(pathbuf, pathbuf, pathbuf + MAXPATHLEN - 1, pattern, pglob, limit)); } /* * The functions glob2 and glob3 are mutually recursive; there is one level * of recursion for each segment in the pattern that contains one or more * meta characters. */ static int glob2(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern, glob_t *pglob, size_t *limit) { struct stat sb; Char *p, *q; int anymeta; /* * Loop over pattern segments until end of pattern or until * segment with meta character found. */ for (anymeta = 0;;) { if (*pattern == EOS) { /* End of pattern? */ *pathend = EOS; if (g_lstat(pathbuf, &sb, pglob)) return(0); if (((pglob->gl_flags & GLOB_MARK) && pathend[-1] != SEP) && (S_ISDIR(sb.st_mode) || (S_ISLNK(sb.st_mode) && (g_stat(pathbuf, &sb, pglob) == 0) && S_ISDIR(sb.st_mode)))) { if (pathend + 1 > pathend_last) return (GLOB_ABORTED); *pathend++ = SEP; *pathend = EOS; } ++pglob->gl_matchc; return(globextend(pathbuf, pglob, limit)); } /* Find end of next segment, copy tentatively to pathend. */ q = pathend; p = pattern; while (*p != EOS && *p != SEP) { if (ismeta(*p)) anymeta = 1; if (q + 1 > pathend_last) return (GLOB_ABORTED); *q++ = *p++; } if (!anymeta) { /* No expansion, do next segment. */ pathend = q; pattern = p; while (*pattern == SEP) { if (pathend + 1 > pathend_last) return (GLOB_ABORTED); *pathend++ = *pattern++; } } else /* Need expansion, recurse. */ return(glob3(pathbuf, pathend, pathend_last, pattern, p, pglob, limit)); } /* NOTREACHED */ } static int glob3(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern, Char *restpattern, glob_t *pglob, size_t *limit) { struct dirent *dp; DIR *dirp; int err; char buf[MAXPATHLEN]; /* * The readdirfunc declaration can't be prototyped, because it is * assigned, below, to two functions which are prototyped in glob.h * and dirent.h as taking pointers to differently typed opaque * structures. */ struct dirent *(*readdirfunc)(); if (pathend > pathend_last) return (GLOB_ABORTED); *pathend = EOS; errno = 0; if ((dirp = g_opendir(pathbuf, pglob)) == NULL) { /* TODO: don't call for ENOENT or ENOTDIR? */ if (pglob->gl_errfunc) { if (g_Ctoc(pathbuf, buf, sizeof(buf))) return (GLOB_ABORTED); if (pglob->gl_errfunc(buf, errno) || pglob->gl_flags & GLOB_ERR) return (GLOB_ABORTED); } return(0); } err = 0; /* Search directory for matching names. */ if (pglob->gl_flags & GLOB_ALTDIRFUNC) readdirfunc = pglob->gl_readdir; else readdirfunc = readdir; while ((dp = (*readdirfunc)(dirp))) { char *sc; Char *dc; wchar_t wc; size_t clen; mbstate_t mbs; /* Initial DOT must be matched literally. */ if (dp->d_name[0] == DOT && *pattern != DOT) continue; memset(&mbs, 0, sizeof(mbs)); dc = pathend; sc = dp->d_name; while (dc < pathend_last) { clen = mbrtowc(&wc, sc, MB_LEN_MAX, &mbs); if (clen == (size_t)-1 || clen == (size_t)-2) { wc = *sc; clen = 1; memset(&mbs, 0, sizeof(mbs)); } if ((*dc++ = wc) == EOS) break; sc += clen; } if (!match(pathend, pattern, restpattern)) { *pathend = EOS; continue; } err = glob2(pathbuf, --dc, pathend_last, restpattern, pglob, limit); if (err) break; } if (pglob->gl_flags & GLOB_ALTDIRFUNC) (*pglob->gl_closedir)(dirp); else closedir(dirp); return(err); } /* * Extend the gl_pathv member of a glob_t structure to accomodate a new item, * add the new item, and update gl_pathc. * * This assumes the BSD realloc, which only copies the block when its size * crosses a power-of-two boundary; for v7 realloc, this would cause quadratic * behavior. * * Return 0 if new item added, error code if memory couldn't be allocated. * * Invariant of the glob_t structure: * Either gl_pathc is zero and gl_pathv is NULL; or gl_pathc > 0 and * gl_pathv points to (gl_offs + gl_pathc + 1) items. */ static int globextend(const Char *path, glob_t *pglob, size_t *limit) { char **pathv; size_t i, newsize, len; char *copy; const Char *p; if (*limit && pglob->gl_pathc > *limit) { errno = 0; return (GLOB_NOSPACE); } newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs); pathv = pglob->gl_pathv ? realloc((char *)pglob->gl_pathv, newsize) : malloc(newsize); if (pathv == NULL) { if (pglob->gl_pathv) { free(pglob->gl_pathv); pglob->gl_pathv = NULL; } return(GLOB_NOSPACE); } if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { /* first time around -- clear initial gl_offs items */ pathv += pglob->gl_offs; for (i = pglob->gl_offs + 1; --i > 0; ) *--pathv = NULL; } pglob->gl_pathv = pathv; for (p = path; *p++;) continue; len = MB_CUR_MAX * (size_t)(p - path); /* XXX overallocation */ if ((copy = malloc(len)) != NULL) { if (g_Ctoc(path, copy, len)) { free(copy); return (GLOB_NOSPACE); } pathv[pglob->gl_offs + pglob->gl_pathc++] = copy; } pathv[pglob->gl_offs + pglob->gl_pathc] = NULL; return(copy == NULL ? GLOB_NOSPACE : 0); } /* * pattern matching function for filenames. Each occurrence of the * * pattern causes a recursion level. */ static int match(Char *name, Char *pat, Char *patend) { int ok, negate_range; Char c, k; while (pat < patend) { c = *pat++; switch (c & M_MASK) { case M_ALL: if (pat == patend) return(1); do if (match(name, pat, patend)) return(1); while (*name++ != EOS); return(0); case M_ONE: if (*name++ == EOS) return(0); break; case M_SET: ok = 0; if ((k = *name++) == EOS) return(0); if ((negate_range = ((*pat & M_MASK) == M_NOT)) != EOS) ++pat; while (((c = *pat++) & M_MASK) != M_END) if ((*pat & M_MASK) == M_RNG) { if (CHAR(c) <= CHAR(k) && CHAR(k) <= CHAR(pat[1])) ok = 1; pat += 2; } else if (c == k) ok = 1; if (ok == negate_range) return(0); break; default: if (*name++ != c) return(0); break; } } return(*name == EOS); } /* Free allocated data belonging to a glob_t structure. */ void globfree(glob_t *pglob) { size_t i; char **pp; if (pglob->gl_pathv != NULL) { pp = pglob->gl_pathv + pglob->gl_offs; for (i = pglob->gl_pathc; i--; ++pp) if (*pp) free(*pp); free(pglob->gl_pathv); pglob->gl_pathv = NULL; } } static DIR * g_opendir(Char *str, glob_t *pglob) { char buf[MAXPATHLEN]; if (!*str) strcpy(buf, "."); else { if (g_Ctoc(str, buf, sizeof(buf))) return (NULL); } if (pglob->gl_flags & GLOB_ALTDIRFUNC) return((*pglob->gl_opendir)(buf)); return(opendir(buf)); } static int g_lstat(Char *fn, struct stat *sb, glob_t *pglob) { char buf[MAXPATHLEN]; if (g_Ctoc(fn, buf, sizeof(buf))) { errno = ENAMETOOLONG; return (-1); } if (pglob->gl_flags & GLOB_ALTDIRFUNC) return((*pglob->gl_lstat)(buf, sb)); return(lstat(buf, sb)); } static int g_stat(Char *fn, struct stat *sb, glob_t *pglob) { char buf[MAXPATHLEN]; if (g_Ctoc(fn, buf, sizeof(buf))) { errno = ENAMETOOLONG; return (-1); } if (pglob->gl_flags & GLOB_ALTDIRFUNC) return((*pglob->gl_stat)(buf, sb)); return(stat(buf, sb)); } static const Char * g_strchr(const Char *str, wchar_t ch) { do { if (*str == ch) return (str); } while (*str++); return (NULL); } static int g_Ctoc(const Char *str, char *buf, size_t len) { mbstate_t mbs; size_t clen; memset(&mbs, 0, sizeof(mbs)); while (len >= MB_CUR_MAX) { clen = wcrtomb(buf, *str, &mbs); if (clen == (size_t)-1) return (1); if (*str == L'\0') return (0); str++; buf += clen; len -= clen; } return (1); } #ifdef DEBUG static void qprintf(const char *str, Char *s) { Char *p; (void)printf("%s:\n", str); for (p = s; *p; p++) (void)printf("%c", CHAR(*p)); (void)printf("\n"); for (p = s; *p; p++) (void)printf("%c", *p & M_PROTECT ? '"' : ' '); (void)printf("\n"); for (p = s; *p; p++) (void)printf("%c", ismeta(*p) ? '_' : ' '); (void)printf("\n"); } #endif ================================================ FILE: packages/libandroid-glob/glob.h ================================================ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Guido van Rossum. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)glob.h 8.1 (Berkeley) 6/2/93 * $FreeBSD$ */ #ifndef _GLOB_H_ #define _GLOB_H_ #include #include struct stat; typedef struct { size_t gl_pathc; /* Count of total paths so far. */ size_t gl_matchc; /* Count of paths matching pattern. */ size_t gl_offs; /* Reserved at beginning of gl_pathv. */ int gl_flags; /* Copy of flags parameter to glob. */ char **gl_pathv; /* List of paths matching pattern. */ /* Copy of errfunc parameter to glob. */ int (*gl_errfunc)(const char *, int); /* * Alternate filesystem access methods for glob; replacement * versions of closedir(3), readdir(3), opendir(3), stat(2) * and lstat(2). */ void (*gl_closedir)(void *); struct dirent *(*gl_readdir)(void *); void *(*gl_opendir)(const char *); int (*gl_lstat)(const char *, struct stat *); int (*gl_stat)(const char *, struct stat *); } glob_t; /* Believed to have been introduced in 1003.2-1992 */ #define GLOB_APPEND 0x0001 /* Append to output from previous call. */ #define GLOB_DOOFFS 0x0002 /* Use gl_offs. */ #define GLOB_ERR 0x0004 /* Return on error. */ #define GLOB_MARK 0x0008 /* Append / to matching directories. */ #define GLOB_NOCHECK 0x0010 /* Return pattern itself if nothing matches. */ #define GLOB_NOSORT 0x0020 /* Don't sort. */ #define GLOB_NOESCAPE 0x2000 /* Disable backslash escaping. */ /* Error values returned by glob(3) */ #define GLOB_NOSPACE (-1) /* Malloc call failed. */ #define GLOB_ABORTED (-2) /* Unignored error. */ #define GLOB_NOMATCH (-3) /* No match and GLOB_NOCHECK was not set. */ #define GLOB_NOSYS (-4) /* Obsolete: source comptability only. */ #define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */ #define GLOB_BRACE 0x0080 /* Expand braces ala csh. */ #define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */ #define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */ #define GLOB_QUOTE 0x0400 /* Quote special chars with \. */ #define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */ #define GLOB_LIMIT 0x1000 /* limit number of returned paths */ /* source compatibility, these are the old names */ #define GLOB_MAXPATH GLOB_LIMIT #define GLOB_ABEND GLOB_ABORTED __BEGIN_DECLS int glob(const char *, int, int (*)(const char *, int), glob_t *); void globfree(glob_t *); __END_DECLS #endif /* !_GLOB_H_ */ ================================================ FILE: packages/libandroid-shmem/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/termux/libandroid-shmem TERMUX_PKG_DESCRIPTION="System V shared memory emulation on Android using ashmem" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=0.2.1 TERMUX_PKG_SRCURL=https://github.com/termux/libandroid-shmem/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=09369398658af357e3644178d42ebfcc79ea11fe760b10855011521fc3e35be4 TERMUX_PKG_BREAKS="libandroid-shmem-dev" TERMUX_PKG_REPLACES="libandroid-shmem-dev" TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/libandroid-spawn/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://man7.org/linux/man-pages/man3/posix_spawn.3.html TERMUX_PKG_DESCRIPTION="Shared library for the posix_spawn system function" TERMUX_PKG_LICENSE="BSD 2-Clause" TERMUX_PKG_VERSION=0.2 TERMUX_PKG_SKIP_SRC_EXTRACT=true TERMUX_PKG_BUILD_IN_SRC=true termux_step_make() { $CC $CFLAGS $CPPFLAGS -I$TERMUX_PKG_BUILDER_DIR -c $TERMUX_PKG_BUILDER_DIR/posix_spawn.cpp $CC $LDFLAGS -shared posix_spawn.o -o libandroid-spawn.so $AR rcu libandroid-spawn.a posix_spawn.o } termux_step_make_install() { install -Dm600 $TERMUX_PKG_BUILDER_DIR/posix_spawn.h $TERMUX_PREFIX/include/spawn.h install -Dm600 libandroid-spawn.a $TERMUX_PREFIX/lib/libandroid-spawn.a install -Dm600 libandroid-spawn.so $TERMUX_PREFIX/lib/libandroid-spawn.so } ================================================ FILE: packages/libandroid-spawn/posix_spawn.cpp ================================================ /* * Copyright (C) 2017 The Android Open Source Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include #include #include #include #include #include #include #include "posix_spawn.h" // Bionic "private/ScopedSignalBlocker.h" + one macro needed #define BIONIC_DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&) = delete; \ void operator=(const TypeName&) = delete class ScopedSignalBlocker { public: // Block all signals. explicit ScopedSignalBlocker() { sigset_t set; sigfillset(&set); sigprocmask(SIG_BLOCK, &set, &old_set_); } // Block just the specified signal. explicit ScopedSignalBlocker(int signal) { sigset_t set = {}; sigaddset(&set, signal); sigprocmask(SIG_BLOCK, &set, &old_set_); } ~ScopedSignalBlocker() { reset(); } void reset() { sigprocmask(SIG_SETMASK, &old_set_, nullptr); } sigset_t old_set_; BIONIC_DISALLOW_COPY_AND_ASSIGN(ScopedSignalBlocker); }; // Bionic "private/SigSetConverter.h" union SigSetConverter { int bsd; sigset_t sigset; sigset64_t sigset64; }; enum Action { kOpen, kClose, kDup2 }; struct __posix_spawn_file_action { __posix_spawn_file_action* next; Action what; int fd; int new_fd; char* path; int flags; mode_t mode; void Do() { if (what == kOpen) { fd = open(path, flags, mode); if (fd == -1) _exit(127); // If it didn't land where we wanted it, move it. if (fd != new_fd) { if (dup2(fd, new_fd) == -1) _exit(127); close(fd); } } else if (what == kClose) { // Failure to close is ignored. close(fd); } else { if (dup2(fd, new_fd) == -1) _exit(127); } } }; struct __posix_spawn_file_actions { __posix_spawn_file_action* head; __posix_spawn_file_action* last; void Do() { for (__posix_spawn_file_action* action = head; action != nullptr; action = action->next) { action->Do(); } } }; struct __posix_spawnattr { short flags; pid_t pgroup; sched_param schedparam; int schedpolicy; SigSetConverter sigmask; SigSetConverter sigdefault; }; static void ApplyAttrs(short flags, const posix_spawnattr_t* attr) { // POSIX: "If POSIX_SPAWN_SETSIGDEF is set ... signals in sigdefault ... // shall be set to their default actions in the child process." // POSIX: "Signals set to be caught by the calling process shall be // set to the default action in the child process." bool use_sigdefault = ((flags & POSIX_SPAWN_SETSIGDEF) != 0); const struct sigaction default_sa = { .sa_handler = SIG_DFL }; for (int s = 1; s < _NSIG; ++s) { bool reset = false; if (use_sigdefault && sigismember(&(*attr)->sigdefault.sigset, s)) { reset = true; } else { struct sigaction current; if (sigaction(s, nullptr, ¤t) == -1) _exit(127); reset = (current.sa_handler != SIG_IGN && current.sa_handler != SIG_DFL); } if (reset && sigaction(s, &default_sa, nullptr) == -1) _exit(127); } if ((flags & POSIX_SPAWN_SETPGROUP) != 0 && setpgid(0, (*attr)->pgroup) == -1) _exit(127); if ((flags & POSIX_SPAWN_SETSID) != 0 && setsid() == -1) _exit(127); // POSIX_SPAWN_SETSCHEDULER overrides POSIX_SPAWN_SETSCHEDPARAM, but it is not an error // to set both. if ((flags & POSIX_SPAWN_SETSCHEDULER) != 0) { if (sched_setscheduler(0, (*attr)->schedpolicy, &(*attr)->schedparam) == -1) _exit(127); } else if ((flags & POSIX_SPAWN_SETSCHEDPARAM) != 0) { if (sched_setparam(0, &(*attr)->schedparam) == -1) _exit(127); } if ((flags & POSIX_SPAWN_RESETIDS) != 0) { if (seteuid(getuid()) == -1 || setegid(getgid()) == -1) _exit(127); } if ((flags & POSIX_SPAWN_SETSIGMASK) != 0) { if (sigprocmask(SIG_SETMASK, &(*attr)->sigmask.sigset, nullptr)) _exit(127); } } static int posix_spawn(pid_t* pid_ptr, const char* path, const posix_spawn_file_actions_t* actions, const posix_spawnattr_t* attr, char* const argv[], char* const env[], int exec_fn(const char* path, char* const argv[], char* const env[])) { // See http://man7.org/linux/man-pages/man3/posix_spawn.3.html // and http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawn.html ScopedSignalBlocker ssb; short flags = attr ? (*attr)->flags : 0; bool use_vfork = ((flags & POSIX_SPAWN_USEVFORK) != 0) || (actions == nullptr && flags == 0); pid_t pid = use_vfork ? vfork() : fork(); if (pid == -1) return errno; if (pid == 0) { // Child. ApplyAttrs(flags, attr); if (actions) (*actions)->Do(); if ((flags & POSIX_SPAWN_SETSIGMASK) == 0) ssb.reset(); exec_fn(path, argv, env ? env : environ); _exit(127); } // Parent. if (pid_ptr) *pid_ptr = pid; return 0; } int posix_spawn(pid_t* pid, const char* path, const posix_spawn_file_actions_t* actions, const posix_spawnattr_t* attr, char* const argv[], char* const env[]) { return posix_spawn(pid, path, actions, attr, argv, env, execve); } int posix_spawnp(pid_t* pid, const char* file, const posix_spawn_file_actions_t* actions, const posix_spawnattr_t* attr, char* const argv[], char* const env[]) { return posix_spawn(pid, file, actions, attr, argv, env, execvpe); } int posix_spawnattr_init(posix_spawnattr_t* attr) { *attr = reinterpret_cast<__posix_spawnattr*>(calloc(1, sizeof(__posix_spawnattr))); return (*attr == nullptr) ? errno : 0; } int posix_spawnattr_destroy(posix_spawnattr_t* attr) { free(*attr); *attr = nullptr; return 0; } int posix_spawnattr_setflags(posix_spawnattr_t* attr, short flags) { if ((flags & ~(POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP | POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER | POSIX_SPAWN_USEVFORK | POSIX_SPAWN_SETSID)) != 0) { return EINVAL; } (*attr)->flags = flags; return 0; } int posix_spawnattr_getflags(const posix_spawnattr_t* attr, short* flags) { *flags = (*attr)->flags; return 0; } int posix_spawnattr_setpgroup(posix_spawnattr_t* attr, pid_t pgroup) { (*attr)->pgroup = pgroup; return 0; } int posix_spawnattr_getpgroup(const posix_spawnattr_t* attr, pid_t* pgroup) { *pgroup = (*attr)->pgroup; return 0; } int posix_spawnattr_setsigmask(posix_spawnattr_t* attr, const sigset_t* mask) { (*attr)->sigmask.sigset = *mask; return 0; } int posix_spawnattr_setsigmask64(posix_spawnattr_t* attr, const sigset64_t* mask) { (*attr)->sigmask.sigset64 = *mask; return 0; } int posix_spawnattr_getsigmask(const posix_spawnattr_t* attr, sigset_t* mask) { *mask = (*attr)->sigmask.sigset; return 0; } int posix_spawnattr_getsigmask64(const posix_spawnattr_t* attr, sigset64_t* mask) { *mask = (*attr)->sigmask.sigset64; return 0; } int posix_spawnattr_setsigdefault(posix_spawnattr_t* attr, const sigset_t* mask) { (*attr)->sigdefault.sigset = *mask; return 0; } int posix_spawnattr_setsigdefault64(posix_spawnattr_t* attr, const sigset64_t* mask) { (*attr)->sigdefault.sigset64 = *mask; return 0; } int posix_spawnattr_getsigdefault(const posix_spawnattr_t* attr, sigset_t* mask) { *mask = (*attr)->sigdefault.sigset; return 0; } int posix_spawnattr_getsigdefault64(const posix_spawnattr_t* attr, sigset64_t* mask) { *mask = (*attr)->sigdefault.sigset64; return 0; } int posix_spawnattr_setschedparam(posix_spawnattr_t* attr, const struct sched_param* param) { (*attr)->schedparam = *param; return 0; } int posix_spawnattr_getschedparam(const posix_spawnattr_t* attr, struct sched_param* param) { *param = (*attr)->schedparam; return 0; } int posix_spawnattr_setschedpolicy(posix_spawnattr_t* attr, int policy) { (*attr)->schedpolicy = policy; return 0; } int posix_spawnattr_getschedpolicy(const posix_spawnattr_t* attr, int* policy) { *policy = (*attr)->schedpolicy; return 0; } int posix_spawn_file_actions_init(posix_spawn_file_actions_t* actions) { *actions = reinterpret_cast<__posix_spawn_file_actions*>(calloc(1, sizeof(**actions))); return (*actions == nullptr) ? errno : 0; } int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t* actions) { __posix_spawn_file_action* a = (*actions)->head; while (a) { __posix_spawn_file_action* last = a; a = a->next; free(last->path); free(last); } free(*actions); *actions = nullptr; return 0; } static int posix_spawn_add_file_action(posix_spawn_file_actions_t* actions, Action what, int fd, int new_fd, const char* path, int flags, mode_t mode) { __posix_spawn_file_action* action = reinterpret_cast<__posix_spawn_file_action*>(malloc(sizeof(*action))); if (action == nullptr) return errno; action->next = nullptr; if (path != nullptr) { action->path = strdup(path); if (action->path == nullptr) { free(action); return errno; } } else { action->path = nullptr; } action->what = what; action->fd = fd; action->new_fd = new_fd; action->flags = flags; action->mode = mode; if ((*actions)->head == nullptr) { (*actions)->head = (*actions)->last = action; } else { (*actions)->last->next = action; (*actions)->last = action; } return 0; } int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t* actions, int fd, const char* path, int flags, mode_t mode) { if (fd < 0) return EBADF; return posix_spawn_add_file_action(actions, kOpen, -1, fd, path, flags, mode); } int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t* actions, int fd) { if (fd < 0) return EBADF; return posix_spawn_add_file_action(actions, kClose, fd, -1, nullptr, 0, 0); } int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t* actions, int fd, int new_fd) { if (fd < 0 || new_fd < 0) return EBADF; return posix_spawn_add_file_action(actions, kDup2, fd, new_fd, nullptr, 0, 0); } ================================================ FILE: packages/libandroid-spawn/posix_spawn.h ================================================ /* * Copyright (C) 2017 The Android Open Source Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef _SPAWN_H_ #define _SPAWN_H_ #include #include #include #include __BEGIN_DECLS #define POSIX_SPAWN_RESETIDS 1 #define POSIX_SPAWN_SETPGROUP 2 #define POSIX_SPAWN_SETSIGDEF 4 #define POSIX_SPAWN_SETSIGMASK 8 #define POSIX_SPAWN_SETSCHEDPARAM 16 #define POSIX_SPAWN_SETSCHEDULER 32 #if defined(__USE_GNU) #define POSIX_SPAWN_USEVFORK 64 #define POSIX_SPAWN_SETSID 128 #endif typedef struct __posix_spawnattr* posix_spawnattr_t; typedef struct __posix_spawn_file_actions* posix_spawn_file_actions_t; int posix_spawn(pid_t* __pid, const char* __path, const posix_spawn_file_actions_t* __actions, const posix_spawnattr_t* __attr, char* const __argv[], char* const __env[]) __INTRODUCED_IN(28); int posix_spawnp(pid_t* __pid, const char* __file, const posix_spawn_file_actions_t* __actions, const posix_spawnattr_t* __attr, char* const __argv[], char* const __env[]) __INTRODUCED_IN(28); int posix_spawnattr_init(posix_spawnattr_t* __attr) __INTRODUCED_IN(28); int posix_spawnattr_destroy(posix_spawnattr_t* __attr) __INTRODUCED_IN(28); int posix_spawnattr_setflags(posix_spawnattr_t* __attr, short __flags) __INTRODUCED_IN(28); int posix_spawnattr_getflags(const posix_spawnattr_t* __attr, short* __flags) __INTRODUCED_IN(28); int posix_spawnattr_setpgroup(posix_spawnattr_t* __attr, pid_t __pgroup) __INTRODUCED_IN(28); int posix_spawnattr_getpgroup(const posix_spawnattr_t* __attr, pid_t* __pgroup) __INTRODUCED_IN(28); int posix_spawnattr_setsigmask(posix_spawnattr_t* __attr, const sigset_t* __mask) __INTRODUCED_IN(28); int posix_spawnattr_setsigmask64(posix_spawnattr_t* __attr, const sigset64_t* __mask) __INTRODUCED_IN(28); int posix_spawnattr_getsigmask(const posix_spawnattr_t* __attr, sigset_t* __mask) __INTRODUCED_IN(28); int posix_spawnattr_getsigmask64(const posix_spawnattr_t* __attr, sigset64_t* __mask) __INTRODUCED_IN(28); int posix_spawnattr_setsigdefault(posix_spawnattr_t* __attr, const sigset_t* __mask) __INTRODUCED_IN(28); int posix_spawnattr_setsigdefault64(posix_spawnattr_t* __attr, const sigset64_t* __mask) __INTRODUCED_IN(28); int posix_spawnattr_getsigdefault(const posix_spawnattr_t* __attr, sigset_t* __mask) __INTRODUCED_IN(28); int posix_spawnattr_getsigdefault64(const posix_spawnattr_t* __attr, sigset64_t* __mask) __INTRODUCED_IN(28); int posix_spawnattr_setschedparam(posix_spawnattr_t* __attr, const struct sched_param* __param) __INTRODUCED_IN(28); int posix_spawnattr_getschedparam(const posix_spawnattr_t* __attr, struct sched_param* __param) __INTRODUCED_IN(28); int posix_spawnattr_setschedpolicy(posix_spawnattr_t* __attr, int __policy) __INTRODUCED_IN(28); int posix_spawnattr_getschedpolicy(const posix_spawnattr_t* __attr, int* __policy) __INTRODUCED_IN(28); int posix_spawn_file_actions_init(posix_spawn_file_actions_t* __actions) __INTRODUCED_IN(28); int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t* __actions) __INTRODUCED_IN(28); int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t* __actions, int __fd, const char* __path, int __flags, mode_t __mode) __INTRODUCED_IN(28); int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t* __actions, int __fd) __INTRODUCED_IN(28); int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t* __actions, int __fd, int __new_fd) __INTRODUCED_IN(28); __END_DECLS #endif ================================================ FILE: packages/libandroid-support/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/termux/libandroid-support TERMUX_PKG_DESCRIPTION="Library extending the Android C library (Bionic) for additional multibyte, locale and math support" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_VERSION=25 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/termux/libandroid-support/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=42e7b55c2e5fc91cc0447fa8bea432e7a75ec78b03469330668af17aea56f660 TERMUX_PKG_PRE_DEPENDS="dpkg (>= 1.19.4-3)" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_ESSENTIAL=true termux_step_make() { local c_file mkdir objects for c_file in $(find src -type f -iname \*.c); do $CC $CPPFLAGS $CFLAGS -std=c99 -DNULL=0 -fPIC -Iinclude \ -c $c_file -o ./objects/$(basename "$c_file").o done cd objects ar rcu ../libandroid-support.a *.o $CC $LDFLAGS -shared -o ../libandroid-support.so *.o } termux_step_make_install() { install -Dm600 libandroid-support.a $TERMUX_PREFIX/lib/libandroid-support.a install -Dm600 libandroid-support.so $TERMUX_PREFIX/lib/libandroid-support.so } ================================================ FILE: packages/libao/ao_private.h.patch ================================================ --- ../cache/libao-1.2.2/include/ao/ao_private.h 2016-11-14 16:03:30.000000000 +0000 +++ ./include/ao/ao_private.h 2018-07-10 21:09:26.757188903 +0000 @@ -51,7 +51,7 @@ /* --- Constants --- */ #ifndef AO_SYSTEM_CONFIG -#define AO_SYSTEM_CONFIG "/etc/libao.conf" +#define AO_SYSTEM_CONFIG "@TERMUX_PREFIX@/etc/libao.conf" #endif #ifndef AO_USER_CONFIG #define AO_USER_CONFIG "/.libao" ================================================ FILE: packages/libao/ao_pulse.c.patch ================================================ diff --git a/src/plugins/pulse/ao_pulse.c b/src/plugins/pulse/ao_pulse.c index 2d10d57..6780830 100644 --- a/src/plugins/pulse/ao_pulse.c +++ b/src/plugins/pulse/ao_pulse.c @@ -41,7 +41,7 @@ #include #include -#define AO_PULSE_BUFFER_TIME 20000 +#define AO_PULSE_BUFFER_TIME 20 /* Unfortunately libao doesn't allow "const" for these structures... */ static char * ao_pulse_options[] = { @@ -73,7 +73,7 @@ typedef struct ao_pulse_internal { struct pa_simple *simple; char *server, *sink, *client_name; pa_usec_t static_delay; - pa_usec_t buffer_time; + int buffer_time; } ao_pulse_internal; /* Yes, this is very ugly, but required nonetheless... */ @@ -174,8 +174,8 @@ int ao_plugin_set_option(ao_device *device, const char *key, const char *value) } else if (!strcmp(key, "client_name")) { free(internal->client_name); internal->client_name = strdup(value); - }else if (!strcmp(key, "buffer_time")){ - internal->buffer_time = atoi(value) * 1000; + } else if (!strcmp(key, "buffer_time")) { + internal->buffer_time = atoi(value); } return 1; @@ -256,12 +256,10 @@ int ao_plugin_open(ao_device *device, ao_sample_format *format) { } /* buffering attributes */ - battr.prebuf = battr.minreq = battr.fragsize = -1; + battr.prebuf = battr.minreq = battr.fragsize = battr.maxlength = -1; - battr.tlength = (int)(internal->buffer_time * format->rate) / 1000000 * - ((format->bits+7)/8) * device->output_channels; - battr.minreq = battr.tlength/4; - battr.maxlength = battr.tlength+battr.minreq; + battr.tlength = internal->buffer_time * format->rate / 1000 * + (format->bits / 8) * device->output_channels; internal->simple = pa_simple_new(internal->server, t, PA_STREAM_PLAYBACK, internal->sink, t2, &ss, ================================================ FILE: packages/libao/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.xiph.org/ao/ TERMUX_PKG_DESCRIPTION="A cross platform audio library" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.2.2 TERMUX_PKG_REVISION=2 TERMUX_PKG_SHA256=df8a6d0e238feeccb26a783e778716fb41a801536fe7b6fce068e313c0e2bf4d TERMUX_PKG_SRCURL=https://github.com/xiph/libao/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="pulseaudio" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-pulse" TERMUX_PKG_CONFFILES="etc/libao.conf" termux_step_pre_configure () { ./autogen.sh } termux_step_post_make_install () { #generate libao config file mkdir -p $TERMUX_PREFIX/etc/ cat << EOF > $TERMUX_PREFIX/etc/libao.conf default_driver=pulse buffer_time=50 quiet EOF } ================================================ FILE: packages/libao/configure.ac.patch ================================================ --- ../cache/libao-1.2.2/configure.ac 2016-11-14 16:03:30.000000000 +0800 +++ ./configure.ac 2018-08-03 00:58:07.600931951 +0800 @@ -114,7 +114,7 @@ LIBAO_LA_LDFLAGS="-no-undefined" ;; *) - LIBAO_LA_LDFLAGS="" + LIBAO_LA_LDFLAGS="-lpulse" ;; esac AC_SUBST(LIBAO_LA_LDFLAGS) ================================================ FILE: packages/libarchive/archive.h.patch ================================================ diff -u -r ../libarchive-3.2.0/libarchive/archive.h ./libarchive/archive.h --- ../libarchive-3.2.0/libarchive/archive.h 2016-04-30 00:44:07.000000000 -0400 +++ ./libarchive/archive.h 2016-05-02 19:58:33.742590137 -0400 @@ -96,11 +96,6 @@ # endif #endif -/* Large file support for Android */ -#ifdef __ANDROID__ -#include "android_lf.h" -#endif - /* * On Windows, define LIBARCHIVE_STATIC if you're building or using a * .lib. The default here assumes you're building a DLL. Only ================================================ FILE: packages/libarchive/archive_entry.h.patch ================================================ diff -u -r ../libarchive-3.2.0/libarchive/archive_entry.h ./libarchive/archive_entry.h --- ../libarchive-3.2.0/libarchive/archive_entry.h 2016-04-30 00:44:07.000000000 -0400 +++ ./libarchive/archive_entry.h 2016-05-02 19:58:22.878678982 -0400 @@ -75,11 +75,6 @@ # define __LA_MODE_T mode_t #endif -/* Large file support for Android */ -#ifdef __ANDROID__ -#include "android_lf.h" -#endif - /* * On Windows, define LIBARCHIVE_STATIC if you're building or using a * .lib. The default here assumes you're building a DLL. Only ================================================ FILE: packages/libarchive/archive_string.c.patch ================================================ diff -u -r ../libarchive-3.1.2/libarchive/archive_string.c ./libarchive/archive_string.c --- ../libarchive-3.1.2/libarchive/archive_string.c 2013-01-14 02:43:45.000000000 +0100 +++ ./libarchive/archive_string.c 2014-07-15 19:07:54.334848056 +0200 @@ -414,7 +414,9 @@ default_iconv_charset(const char *charset) { if (charset != NULL && charset[0] != '\0') return charset; -#if HAVE_LOCALE_CHARSET && !defined(__APPLE__) +#ifdef __ANDROID__ + return "UTF-8"; +#elif HAVE_LOCALE_CHARSET && !defined(__APPLE__) /* locale_charset() is broken on Mac OS */ return locale_charset(); #elif HAVE_NL_LANGINFO ================================================ FILE: packages/libarchive/archive_util.c.patch ================================================ diff -uNr libarchive-3.3.3/libarchive/archive_util.c libarchive-3.3.3.mod/libarchive/archive_util.c --- libarchive-3.3.3/libarchive/archive_util.c 2018-09-02 09:05:18.000000000 +0300 +++ libarchive-3.3.3.mod/libarchive/archive_util.c 2019-03-02 02:14:39.252942170 +0200 @@ -374,7 +374,7 @@ #ifdef _PATH_TMP tmp = _PATH_TMP; #else - tmp = "/tmp"; + tmp = "@TERMUX_PREFIX@/tmp"; #endif archive_strcpy(temppath, tmp); if (temppath->s[temppath->length-1] != '/') ================================================ FILE: packages/libarchive/archive_write_disk_posix.c.patch ================================================ diff -u -r ../libarchive-3.3.1/libarchive/archive_write_disk_posix.c ./libarchive/archive_write_disk_posix.c --- ../libarchive-3.3.1/libarchive/archive_write_disk_posix.c 2017-02-25 18:37:08.000000000 +0100 +++ ./libarchive/archive_write_disk_posix.c 2017-03-27 02:35:07.446390387 +0200 @@ -2756,7 +2756,11 @@ alen = 0; mb = 0; complete = 1; +#ifdef __ANDROID__ + utf8 = 1; +#else utf8 = (strcmp(nl_langinfo(CODESET), "UTF-8") == 0)? 1: 0; +#endif for (p = path; *p != '\0'; p++) { ++alen; if (*p == '\\') { ================================================ FILE: packages/libarchive/archive_write_set_format_zip.c.patch ================================================ diff -u -r ../libarchive-3.2.0/libarchive/archive_write_set_format_zip.c ./libarchive/archive_write_set_format_zip.c --- ../libarchive-3.2.0/libarchive/archive_write_set_format_zip.c 2016-01-01 17:18:57.000000000 -0500 +++ ./libarchive/archive_write_set_format_zip.c 2016-05-02 20:09:52.331542213 -0400 @@ -651,10 +651,8 @@ if (strcmp(archive_string_conversion_charset_name( zip->opt_sconv), "UTF-8") == 0) zip->entry_flags |= ZIP_ENTRY_FLAG_UTF8_NAME; -#if HAVE_NL_LANGINFO - } else if (strcmp(nl_langinfo(CODESET), "UTF-8") == 0) { + } else { zip->entry_flags |= ZIP_ENTRY_FLAG_UTF8_NAME; -#endif } } filename_length = path_length(zip->entry); ================================================ FILE: packages/libarchive/bsdtar.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="bin/ share/man/man1/" TERMUX_SUBPKG_DESCRIPTION="The tar(1) and cpio(1) programs from FreeBSD, using libarchive" ================================================ FILE: packages/libarchive/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.libarchive.org/ TERMUX_PKG_DESCRIPTION="Multi-format archive and compression library" TERMUX_PKG_LICENSE="BSD 2-Clause" TERMUX_PKG_VERSION=3.4.0 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=8643d50ed40c759f5412a3af4e353cffbce4fdf3b5cf321cb72cacf06b2d825e TERMUX_PKG_SRCURL=https://github.com/libarchive/libarchive/releases/download/v$TERMUX_PKG_VERSION/libarchive-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_DEPENDS="libbz2, libiconv, liblzma, libxml2, openssl, zlib" TERMUX_PKG_BREAKS="libarchive-dev" TERMUX_PKG_REPLACES="libarchive-dev" # --without-nettle to use openssl instead: TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --without-nettle --without-lz4 --without-zstd " ================================================ FILE: packages/libass/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/libass/libass TERMUX_PKG_DESCRIPTION="A portable library for SSA/ASS subtitles rendering" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.14.0 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/libass/libass/releases/download/$TERMUX_PKG_VERSION/libass-$TERMUX_PKG_VERSION.tar.xz TERMUX_PKG_SHA256=881f2382af48aead75b7a0e02e65d88c5ebd369fe46bc77d9270a94aa8fd38a2 TERMUX_PKG_DEPENDS="fontconfig, fribidi, glib, harfbuzz" TERMUX_PKG_BREAKS="libass-dev" TERMUX_PKG_REPLACES="libass-dev" ================================================ FILE: packages/libassuan/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnupg.org/related_software/libassuan/ TERMUX_PKG_DESCRIPTION="Library implementing the Assuan IPC protocol used between most newer GnuPG components" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.5.3 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=91bcb0403866b4e7c4bc1cc52ed4c364a9b5414b3994f718c70303f7f765e702 TERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/libassuan/libassuan-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_DEPENDS="libgpg-error" TERMUX_PKG_BREAKS="libassuan-dev" TERMUX_PKG_REPLACES="libassuan-dev" ================================================ FILE: packages/libbsd/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://libbsd.freedesktop.org TERMUX_PKG_DESCRIPTION="utility functions from BSD systems" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=0.10.0 TERMUX_PKG_SRCURL=https://libbsd.freedesktop.org/releases/libbsd-$TERMUX_PKG_VERSION.tar.xz TERMUX_PKG_SHA256=34b8adc726883d0e85b3118fa13605e179a62b31ba51f676136ecb2d0bc1a887 TERMUX_PKG_BREAKS="libbsd-dev" TERMUX_PKG_REPLACES="libbsd-dev" TERMUX_PKG_BUILD_IN_SRC=true ================================================ FILE: packages/libbsd/endian.h.patch ================================================ diff -uNr libbsd-0.10.0/include/bsd/sys/endian.h libbsd-0.10.0.mod/include/bsd/sys/endian.h --- libbsd-0.10.0/include/bsd/sys/endian.h 2019-08-08 01:00:44.000000000 +0300 +++ libbsd-0.10.0.mod/include/bsd/sys/endian.h 2019-08-11 20:23:57.120370524 +0300 @@ -28,12 +28,12 @@ #ifdef LIBBSD_OVERLAY #include -#if __has_include_next() +#if __has_include_next() && !defined(__ANDROID__) #include_next #endif #else #include -#if __has_include() +#if __has_include() && !defined(__ANDROID__) #include #endif #endif ================================================ FILE: packages/libbsd/funopen.c.patch ================================================ --- ../cache/libbsd-0.9.1/src/funopen.c 2018-04-21 21:30:22.000000000 +0000 +++ ./src/funopen.c 2018-10-16 02:22:46.623852072 +0000 @@ -137,7 +137,7 @@ return fopencookie(cookiewrap, mode, funcswrap); } -#elif defined(__MUSL__) +#elif defined(__MUSL__) || defined(__BIONIC__) /* * This is unimplementable on musl based systems, and upstream has stated * they will not add the needed support to implement it. Just ignore this ================================================ FILE: packages/libbsd/local-elf.h.patch ================================================ --- ../cache/libbsd-0.9.1/src/local-elf.h 2018-04-21 21:30:22.000000000 +0000 +++ ./src/local-elf.h 2018-10-16 03:40:41.756419536 +0000 @@ -240,8 +240,10 @@ #endif #if ELF_TARG_CLASS == ELFCLASS32 +#if !defined(__ANDROID__) #define ELF_ST_BIND ELF32_ST_BIND #define ELF_ST_TYPE ELF32_ST_TYPE +#endif #define Elf_Word Elf32_Word #define Elf_Sword Elf32_Sword #define Elf_Sym Elf32_Sym @@ -249,8 +251,10 @@ #define Elf_Shdr Elf32_Shdr #define Elf_Ehdr Elf32_Ehdr #elif ELF_TARG_CLASS == ELFCLASS64 +#if !defined(__ANDROID__) #define ELF_ST_BIND ELF64_ST_BIND #define ELF_ST_TYPE ELF64_ST_TYPE +#endif #define Elf_Word Elf64_Word #define Elf_Sword Elf64_Sword #define Elf_Sym Elf64_Sym ================================================ FILE: packages/libbsd/nlist.c.patch ================================================ --- ../cache/libbsd-0.9.1/src/nlist.c 2018-05-14 22:54:12.000000000 +0000 +++ ./src/nlist.c 2018-10-16 03:17:23.141271836 +0000 @@ -39,8 +39,11 @@ #include #include #include +#if !defined(__ANDROID__) #include - +#else +#include "../include/bsd/nlist.h" +#endif #include "local-elf.h" #define SIZE_T_MAX 0xffffffffU ================================================ FILE: packages/libbz2/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.bzip.org/ TERMUX_PKG_DESCRIPTION="BZ2 format compression library" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_VERSION=1.0.8 TERMUX_PKG_REVISION=5 TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/bzip2-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=47fd74b2ff83effad0ddf62074e6fad1f6b4a77a96e121ab421c20a216371a1f TERMUX_PKG_BREAKS="libbz2-dev" TERMUX_PKG_REPLACES="libbz2-dev" TERMUX_PKG_ESSENTIAL=true TERMUX_PKG_EXTRA_MAKE_ARGS="PREFIX=$TERMUX_PREFIX" TERMUX_PKG_BUILD_IN_SRC=true termux_step_configure() { # Certain packages are not safe to build on device because their # build.sh script deletes specific files in $TERMUX_PREFIX. if $TERMUX_ON_DEVICE_BUILD; then termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds." fi # bzip2 does not use configure. But place man pages at correct path: sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" $TERMUX_PKG_SRCDIR/Makefile } termux_step_make() { # bzip2 uses a separate makefile for the shared library make -f Makefile-libbz2_so } termux_step_make_install() { # The shared library makefile contains no install makefile, so issue a normal install to get scripts make $TERMUX_PKG_EXTRA_MAKE_ARGS install # Clean out statically linked binaries and libs and replace them with shared ones: rm -Rf $TERMUX_PREFIX/lib/libbz2* rm -Rf $TERMUX_PREFIX/bin/{bzcat,bunzip2} cp bzip2-shared $TERMUX_PREFIX/bin/bzip2 cp libbz2.so.${TERMUX_PKG_VERSION} $TERMUX_PREFIX/lib (cd $TERMUX_PREFIX/lib && ln -s libbz2.so.${TERMUX_PKG_VERSION} libbz2.so.1.0) (cd $TERMUX_PREFIX/lib && ln -s libbz2.so.${TERMUX_PKG_VERSION} libbz2.so) (cd $TERMUX_PREFIX/bin && ln -s bzip2 bzcat) (cd $TERMUX_PREFIX/bin && ln -s bzip2 bunzip2) # bzgrep should be enough so remove bz{e,f}grep rm $TERMUX_PREFIX/bin/bz{e,f}grep $TERMUX_PREFIX/share/man/man1/bz{e,f}grep.1 } ================================================ FILE: packages/libbz2/bzdiff.patch ================================================ diff -uNr bzip2-1.0.8/bzdiff bzip2-1.0.8.mod/bzdiff --- bzip2-1.0.8/bzdiff 2019-07-13 20:50:05.000000000 +0300 +++ bzip2-1.0.8.mod/bzdiff 2019-07-20 11:46:36.090211623 +0300 @@ -49,14 +49,14 @@ case "$2" in *.bz2) F=`echo "$2" | sed 's|.*/||;s|.bz2$||'` - tmp=`mktemp "${TMPDIR:-/tmp}"/bzdiff.XXXXXXXXXX` || { + tmp=`mktemp "${TMPDIR:-@TERMUX_PREFIX@/tmp}"/bzdiff.XXXXXXXXXX` || { echo 'cannot create a temporary file' >&2 exit 1 } bzip2 -cdfq "$2" > "$tmp" bzip2 -cdfq "$1" | $comp $OPTIONS - "$tmp" STAT="$?" - /bin/rm -f "$tmp";; + rm -f "$tmp";; *) bzip2 -cdfq "$1" | $comp $OPTIONS - "$2" STAT="$?";; ================================================ FILE: packages/libbz2/bzip2.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="bin/ share/man/man1/" TERMUX_SUBPKG_DESCRIPTION="Tools for working with bzip2 compression" TERMUX_SUBPKG_ESSENTIAL=true ================================================ FILE: packages/libbz2/cross_compile.patch ================================================ diff -u -r ../bzip2-1.0.6/Makefile ./Makefile --- ../bzip2-1.0.6/Makefile 2010-09-11 00:46:02.000000000 +0200 +++ ./Makefile 2014-02-24 22:03:59.000000000 +0100 @@ -14,17 +14,11 @@ SHELL=/bin/sh -# To assist in cross-compiling -CC=gcc -AR=ar -RANLIB=ranlib -LDFLAGS= BIGFILES=-D_FILE_OFFSET_BITS=64 CFLAGS=-Wall -Winline -O2 -g $(BIGFILES) # Where you want it installed when you do 'make install' -PREFIX=/usr/local OBJS= blocksort.o \ ================================================ FILE: packages/libbz2/shared_library.patch ================================================ diff -uNr bzip2-1.0.8/Makefile-libbz2_so bzip2-1.0.8.mod/Makefile-libbz2_so --- bzip2-1.0.8/Makefile-libbz2_so 2019-07-13 20:50:05.000000000 +0300 +++ bzip2-1.0.8.mod/Makefile-libbz2_so 2019-07-20 11:51:36.370015038 +0300 @@ -22,9 +22,9 @@ SHELL=/bin/sh -CC=gcc +CC ?= gcc BIGFILES=-D_FILE_OFFSET_BITS=64 -CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES) +CFLAGS ?= -fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES) OBJS= blocksort.o \ huffman.o \ @@ -35,8 +35,8 @@ bzlib.o all: $(OBJS) - $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS) - $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8 + $(CC) $(LDFLAGS) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS) + $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8 rm -f libbz2.so.1.0 ln -s libbz2.so.1.0.8 libbz2.so.1.0 ================================================ FILE: packages/libc++/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://libcxx.llvm.org/ TERMUX_PKG_DESCRIPTION="C++ Standard Library" TERMUX_PKG_LICENSE="NCSA" TERMUX_PKG_VERSION=$TERMUX_NDK_VERSION TERMUX_PKG_SKIP_SRC_EXTRACT=true TERMUX_PKG_ESSENTIAL=true termux_step_post_make_install() { cp "$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/${TERMUX_HOST_PLATFORM}/libc++_shared.so" $TERMUX_PREFIX/lib } ================================================ FILE: packages/libcaca/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://caca.zoy.org/wiki/libcaca TERMUX_PKG_DESCRIPTION="Graphics library that outputs text instead of pixels" TERMUX_PKG_LICENSE="WTFPL" TERMUX_PKG_VERSION=0.99.beta19 TERMUX_PKG_REVISION=8 TERMUX_PKG_SRCURL=http://fossies.org/linux/privat/libcaca-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=128b467c4ed03264c187405172a4e83049342cc8cc2f655f53a2d0ee9d3772f4 TERMUX_PKG_DEPENDS="imlib2, libc++, ncurses, zlib" TERMUX_PKG_BREAKS="libcaca-dev" TERMUX_PKG_REPLACES="libcaca-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-doc --disable-java --disable-python --disable-ruby --enable-imlib2 " termux_step_post_configure() { if [ $TERMUX_ARCH = x86_64 ]; then # Remove troublesome asm usage: perl -p -i -e 's/#define HAVE_FLDLN2 1//' $TERMUX_PKG_BUILDDIR/config.h fi } ================================================ FILE: packages/libcairo/android-shmem.patch ================================================ Just linking with libandroid-shmem doesn't work for libcairo for some reason. diff -uNr cairo-1.16.0/src/android-shmem.c cairo-1.16.0.mod/src/android-shmem.c --- cairo-1.16.0/src/android-shmem.c 1970-01-01 03:00:00.000000000 +0300 +++ cairo-1.16.0.mod/src/android-shmem.c 2019-08-16 20:37:14.952643714 +0300 @@ -0,0 +1,549 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define __u32 uint32_t +#include + +#include "android-shmem.h" + +#define DBG(...) __android_log_print(ANDROID_LOG_INFO, "shmem", __VA_ARGS__) +#define ASHV_KEY_SYMLINK_PATH _PATH_TMP "ashv_key_%d" +#define ANDROID_SHMEM_SOCKNAME "/dev/shm/%08x" +#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) + +static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; + +typedef struct { + // The shmid (shared memory id) contains the socket address (16 bits) + // and a local id (15 bits). + int id; + void *addr; + int descriptor; + size_t size; + bool markedForDeletion; + key_t key; +} shmem_t; + +static shmem_t* shmem = NULL; +static size_t shmem_amount = 0; + +// The lower 16 bits of (getpid() + i), where i is a sequence number. +// It is unique among processes as it's only set when bound. +static int ashv_local_socket_id = 0; +// To handle forks we store which pid the ashv_local_socket_id was +// created for. +static int ashv_pid_setup = 0; +static pthread_t ashv_listening_thread_id = 0; + +static int ancil_send_fd(int sock, int fd) +{ + char nothing = '!'; + struct iovec nothing_ptr = { .iov_base = ¬hing, .iov_len = 1 }; + + struct { + struct cmsghdr align; + int fd[1]; + } ancillary_data_buffer; + + struct msghdr message_header = { + .msg_name = NULL, + .msg_namelen = 0, + .msg_iov = ¬hing_ptr, + .msg_iovlen = 1, + .msg_flags = 0, + .msg_control = &ancillary_data_buffer, + .msg_controllen = sizeof(struct cmsghdr) + sizeof(int) + }; + + struct cmsghdr* cmsg = CMSG_FIRSTHDR(&message_header); + cmsg->cmsg_len = message_header.msg_controllen; // sizeof(int); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + ((int*) CMSG_DATA(cmsg))[0] = fd; + + return sendmsg(sock, &message_header, 0) >= 0 ? 0 : -1; +} + +static int ancil_recv_fd(int sock) +{ + char nothing = '!'; + struct iovec nothing_ptr = { .iov_base = ¬hing, .iov_len = 1 }; + + struct { + struct cmsghdr align; + int fd[1]; + } ancillary_data_buffer; + + struct msghdr message_header = { + .msg_name = NULL, + .msg_namelen = 0, + .msg_iov = ¬hing_ptr, + .msg_iovlen = 1, + .msg_flags = 0, + .msg_control = &ancillary_data_buffer, + .msg_controllen = sizeof(struct cmsghdr) + sizeof(int) + }; + + struct cmsghdr* cmsg = CMSG_FIRSTHDR(&message_header); + cmsg->cmsg_len = message_header.msg_controllen; + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + ((int*) CMSG_DATA(cmsg))[0] = -1; + + if (recvmsg(sock, &message_header, 0) < 0) return -1; + + return ((int*) CMSG_DATA(cmsg))[0]; +} + +static int ashmem_get_size_region(int fd) +{ + //int ret = __ashmem_is_ashmem(fd, 1); + //if (ret < 0) return ret; + return TEMP_FAILURE_RETRY(ioctl(fd, ASHMEM_GET_SIZE, NULL)); +} + +/* + * From https://android.googlesource.com/platform/system/core/+/master/libcutils/ashmem-dev.c + * + * ashmem_create_region - creates a new named ashmem region and returns the file + * descriptor, or <0 on error. + * + * `name' is the label to give the region (visible in /proc/pid/maps) + * `size' is the size of the region, in page-aligned bytes + */ +static int ashmem_create_region(char const* name, size_t size) +{ + int fd = open("/dev/ashmem", O_RDWR); + if (fd < 0) return fd; + + char name_buffer[ASHMEM_NAME_LEN] = {0}; + strncpy(name_buffer, name, sizeof(name_buffer)); + name_buffer[sizeof(name_buffer)-1] = 0; + + int ret = ioctl(fd, ASHMEM_SET_NAME, name_buffer); + if (ret < 0) goto error; + + ret = ioctl(fd, ASHMEM_SET_SIZE, size); + if (ret < 0) goto error; + + return fd; +error: + close(fd); + return ret; +} + +static void ashv_check_pid() +{ + pid_t mypid = getpid(); + if (ashv_pid_setup == 0) { + ashv_pid_setup = mypid; + } else if (ashv_pid_setup != mypid) { + DBG("%s: Cleaning to new pid=%d from oldpid=%d", __PRETTY_FUNCTION__, mypid, ashv_pid_setup); + // We inherited old state across a fork. + ashv_pid_setup = mypid; + ashv_local_socket_id = 0; + ashv_listening_thread_id = 0; + shmem_amount = 0; + // Unlock if fork left us with held lock from parent thread. + pthread_mutex_unlock(&mutex); + if (shmem != NULL) free(shmem); + shmem = NULL; + } +} + + +// Store index in the lower 15 bits and the socket id in the +// higher 16 bits. +static int ashv_shmid_from_counter(unsigned int counter) +{ + return ashv_local_socket_id * 0x10000 + counter; +} + +static int ashv_socket_id_from_shmid(int shmid) +{ + return shmid / 0x10000; +} + +static int ashv_find_local_index(int shmid) +{ + for (size_t i = 0; i < shmem_amount; i++) + if (shmem[i].id == shmid) + return i; + return -1; +} + +static void* ashv_thread_function(void* arg) +{ + int sock = *(int*)arg; + free(arg); + struct sockaddr_un addr; + socklen_t len = sizeof(addr); + int sendsock; + //DBG("%s: thread started", __PRETTY_FUNCTION__); + while ((sendsock = accept(sock, (struct sockaddr *)&addr, &len)) != -1) { + int shmid; + if (recv(sendsock, &shmid, sizeof(shmid), 0) != sizeof(shmid)) { + DBG("%s: ERROR: recv() returned not %zu bytes", __PRETTY_FUNCTION__, sizeof(shmid)); + close(sendsock); + continue; + } + pthread_mutex_lock(&mutex); + int idx = ashv_find_local_index(shmid); + if (idx != -1) { + if (write(sendsock, &shmem[idx].key, sizeof(key_t)) != sizeof(key_t)) { + DBG("%s: ERROR: write failed: %s", __PRETTY_FUNCTION__, strerror(errno)); + } + if (ancil_send_fd(sendsock, shmem[idx].descriptor) != 0) { + DBG("%s: ERROR: ancil_send_fd() failed: %s", __PRETTY_FUNCTION__, strerror(errno)); + } + } else { + DBG("%s: ERROR: cannot find shmid 0x%x", __PRETTY_FUNCTION__, shmid); + } + pthread_mutex_unlock(&mutex); + close(sendsock); + len = sizeof(addr); + } + DBG ("%s: ERROR: listen() failed, thread stopped", __PRETTY_FUNCTION__); + return NULL; +} + +static void android_shmem_delete(int idx) +{ + if (shmem[idx].descriptor) close(shmem[idx].descriptor); + shmem_amount--; + memmove(&shmem[idx], &shmem[idx+1], (shmem_amount - idx) * sizeof(shmem_t)); +} + +static int ashv_read_remote_segment(int shmid) +{ + struct sockaddr_un addr; + memset(&addr, 0, sizeof(addr)); + addr.sun_family = AF_UNIX; + sprintf(&addr.sun_path[1], ANDROID_SHMEM_SOCKNAME, ashv_socket_id_from_shmid(shmid)); + int addrlen = sizeof(addr.sun_family) + strlen(&addr.sun_path[1]) + 1; + + int recvsock = socket(AF_UNIX, SOCK_STREAM, 0); + if (recvsock == -1) { + DBG ("%s: cannot create UNIX socket: %s", __PRETTY_FUNCTION__, strerror(errno)); + return -1; + } + if (connect(recvsock, (struct sockaddr*) &addr, addrlen) != 0) { + DBG("%s: Cannot connect to UNIX socket %s: %s, len %d", __PRETTY_FUNCTION__, addr.sun_path + 1, strerror(errno), addrlen); + close(recvsock); + return -1; + } + + if (send(recvsock, &shmid, sizeof(shmid), 0) != sizeof(shmid)) { + DBG ("%s: send() failed on socket %s: %s", __PRETTY_FUNCTION__, addr.sun_path + 1, strerror(errno)); + close(recvsock); + return -1; + } + + key_t key; + if (read(recvsock, &key, sizeof(key_t)) != sizeof(key_t)) { + DBG("%s: ERROR: failed read", __PRETTY_FUNCTION__); + close(recvsock); + return -1; + } + + int descriptor = ancil_recv_fd(recvsock); + if (descriptor < 0) { + DBG("%s: ERROR: ancil_recv_fd() failed on socket %s: %s", __PRETTY_FUNCTION__, addr.sun_path + 1, strerror(errno)); + close(recvsock); + return -1; + } + close(recvsock); + + int size = ashmem_get_size_region(descriptor); + if (size == 0 || size == -1) { + DBG ("%s: ERROR: ashmem_get_size_region() returned %d on socket %s: %s", __PRETTY_FUNCTION__, size, addr.sun_path + 1, strerror(errno)); + return -1; + } + + int idx = shmem_amount; + shmem_amount ++; + shmem = realloc(shmem, shmem_amount * sizeof(shmem_t)); + shmem[idx].id = shmid; + shmem[idx].descriptor = descriptor; + shmem[idx].size = size; + shmem[idx].addr = NULL; + shmem[idx].markedForDeletion = false; + shmem[idx].key = key; + return idx; +} + +/* Get shared memory area identifier. */ +int android_shmget(key_t key, size_t size, int flags) +{ + (void) flags; + + ashv_check_pid(); + + // Counter wrapping around at 15 bits. + static size_t shmem_counter = 0; + + if (!ashv_listening_thread_id) { + int sock = socket(AF_UNIX, SOCK_STREAM, 0); + if (!sock) { + DBG ("%s: cannot create UNIX socket: %s", __PRETTY_FUNCTION__, strerror(errno)); + errno = EINVAL; + return -1; + } + int i; + for (i = 0; i < 4096; i++) { + struct sockaddr_un addr; + int len; + memset (&addr, 0, sizeof(addr)); + addr.sun_family = AF_UNIX; + ashv_local_socket_id = (getpid() + i) & 0xffff; + sprintf(&addr.sun_path[1], ANDROID_SHMEM_SOCKNAME, ashv_local_socket_id); + len = sizeof(addr.sun_family) + strlen(&addr.sun_path[1]) + 1; + if (bind(sock, (struct sockaddr *)&addr, len) != 0) continue; + DBG("%s: bound UNIX socket %s in pid=%d", __PRETTY_FUNCTION__, addr.sun_path + 1, getpid()); + break; + } + if (i == 4096) { + DBG("%s: cannot bind UNIX socket, bailing out", __PRETTY_FUNCTION__); + ashv_local_socket_id = 0; + errno = ENOMEM; + return -1; + } + if (listen(sock, 4) != 0) { + DBG("%s: listen failed", __PRETTY_FUNCTION__); + errno = ENOMEM; + return -1; + } + int* socket_arg = malloc(sizeof(int)); + *socket_arg = sock; + pthread_create(&ashv_listening_thread_id, NULL, &ashv_thread_function, socket_arg); + } + + int shmid = -1; + + pthread_mutex_lock(&mutex); + char symlink_path[256]; + if (key != IPC_PRIVATE) { + // (1) Check if symlink exists telling us where to connect. + // (2) If so, try to connect and open. + // (3) If connected and opened, done. If connection refused + // take ownership of the key and create the symlink. + // (4) If no symlink, create it. + sprintf(symlink_path, ASHV_KEY_SYMLINK_PATH, key); + char path_buffer[256]; + char num_buffer[64]; + while (true) { + int path_length = readlink(symlink_path, path_buffer, sizeof(path_buffer) - 1); + if (path_length != -1) { + path_buffer[path_length] = '\0'; + int shmid = atoi(path_buffer); + if (shmid != 0) { + int idx = ashv_read_remote_segment(shmid); + if (idx != -1) { + pthread_mutex_unlock(&mutex); + return shmem[idx].id; + } + } + // TODO: Not sure we should try to remove previous owner if e.g. + // there was a tempporary failture to get a soket. Need to + // distinguish between why ashv_read_remote_segment failed. + unlink(symlink_path); + } + // Take ownership. + // TODO: HAndle error (out of resouces, no infinite loop) + if (shmid == -1) { + shmem_counter = (shmem_counter + 1) & 0x7fff; + shmid = ashv_shmid_from_counter(shmem_counter); + sprintf(num_buffer, "%d", shmid); + } + if (symlink(num_buffer, symlink_path) == 0) break; + } + } + + + int idx = shmem_amount; + char buf[256]; + sprintf(buf, ANDROID_SHMEM_SOCKNAME "-%d", ashv_local_socket_id, idx); + + shmem_amount++; + if (shmid == -1) { + shmem_counter = (shmem_counter + 1) & 0x7fff; + shmid = ashv_shmid_from_counter(shmem_counter); + } + + shmem = realloc(shmem, shmem_amount * sizeof(shmem_t)); + size = ROUND_UP(size, getpagesize()); + shmem[idx].size = size; + shmem[idx].descriptor = ashmem_create_region(buf, size); + shmem[idx].addr = NULL; + shmem[idx].id = shmid; + shmem[idx].markedForDeletion = false; + shmem[idx].key = key; + + if (shmem[idx].descriptor < 0) { + DBG("%s: ashmem_create_region() failed for size %zu: %s", __PRETTY_FUNCTION__, size, strerror(errno)); + shmem_amount --; + shmem = realloc(shmem, shmem_amount * sizeof(shmem_t)); + pthread_mutex_unlock (&mutex); + return -1; + } + //DBG("%s: ID %d shmid %x FD %d size %zu", __PRETTY_FUNCTION__, idx, shmid, shmem[idx].descriptor, shmem[idx].size); + /* + status = ashmem_set_prot_region (shmem[idx].descriptor, 0666); + if (status < 0) { + DBG ("%s: ashmem_set_prot_region() failed for size %zu: %s %d", __PRETTY_FUNCTION__, size, strerror(status), status); + shmem_amount --; + shmem = realloc (shmem, shmem_amount * sizeof(shmem_t)); + pthread_mutex_unlock (&mutex); + return -1; + } + */ + /* + status = ashmem_pin_region (shmem[idx].descriptor, 0, shmem[idx].size); + if (status < 0) { + DBG ("%s: ashmem_pin_region() failed for size %zu: %s %d", __PRETTY_FUNCTION__, size, strerror(status), status); + shmem_amount --; + shmem = realloc (shmem, shmem_amount * sizeof(shmem_t)); + pthread_mutex_unlock (&mutex); + return -1; + } + */ + pthread_mutex_unlock(&mutex); + + return shmid; +} + +/* Attach shared memory segment. */ +void* android_shmat(int shmid, void const* shmaddr, int shmflg) +{ + ashv_check_pid(); + + int socket_id = ashv_socket_id_from_shmid(shmid); + void *addr; + + pthread_mutex_lock(&mutex); + + int idx = ashv_find_local_index(shmid); + if (idx == -1 && socket_id != ashv_local_socket_id) { + idx = ashv_read_remote_segment(shmid); + } + + if (idx == -1) { + DBG ("%s: shmid %x does not exist", __PRETTY_FUNCTION__, shmid); + pthread_mutex_unlock(&mutex); + errno = EINVAL; + return (void*) -1; + } + + if (shmem[idx].addr == NULL) { + shmem[idx].addr = mmap((void*) shmaddr, shmem[idx].size, PROT_READ | (shmflg == 0 ? PROT_WRITE : 0), MAP_SHARED, shmem[idx].descriptor, 0); + if (shmem[idx].addr == MAP_FAILED) { + DBG ("%s: mmap() failed for ID %x FD %d: %s", __PRETTY_FUNCTION__, idx, shmem[idx].descriptor, strerror(errno)); + shmem[idx].addr = NULL; + } + } + addr = shmem[idx].addr; + DBG ("%s: mapped addr %p for FD %d ID %d", __PRETTY_FUNCTION__, addr, shmem[idx].descriptor, idx); + pthread_mutex_unlock (&mutex); + + return addr ? addr : (void *)-1; +} + +/* Detach shared memory segment. */ +int android_shmdt(void const* shmaddr) +{ + ashv_check_pid(); + + pthread_mutex_lock(&mutex); + for (size_t i = 0; i < shmem_amount; i++) { + if (shmem[i].addr == shmaddr) { + if (munmap(shmem[i].addr, shmem[i].size) != 0) { + DBG("%s: munmap %p failed", __PRETTY_FUNCTION__, shmaddr); + } + shmem[i].addr = NULL; + DBG("%s: unmapped addr %p for FD %d ID %zu shmid %x", __PRETTY_FUNCTION__, shmaddr, shmem[i].descriptor, i, shmem[i].id); + if (shmem[i].markedForDeletion || ashv_socket_id_from_shmid(shmem[i].id) != ashv_local_socket_id) { + DBG ("%s: deleting shmid %x", __PRETTY_FUNCTION__, shmem[i].id); + android_shmem_delete(i); + } + pthread_mutex_unlock(&mutex); + return 0; + } + } + pthread_mutex_unlock(&mutex); + + DBG("%s: invalid address %p", __PRETTY_FUNCTION__, shmaddr); + /* Could be a remove segment, do not report an error for that. */ + return 0; +} + +/* Shared memory control operation. */ +int android_shmctl(int shmid, int cmd, struct shmid_ds *buf) +{ + ashv_check_pid(); + + if (cmd == IPC_RMID) { + DBG("%s: IPC_RMID for shmid=%x", __PRETTY_FUNCTION__, shmid); + pthread_mutex_lock(&mutex); + int idx = ashv_find_local_index(shmid); + if (idx == -1) { + DBG("%s: shmid=%x does not exist locally", __PRETTY_FUNCTION__, shmid); + /* We do not rm non-local regions, but do not report an error for that. */ + pthread_mutex_unlock(&mutex); + return 0; + } + + if (shmem[idx].addr) { + // shmctl(2): The segment will actually be destroyed only + // after the last process detaches it (i.e., when the shm_nattch + // member of the associated structure shmid_ds is zero. + shmem[idx].markedForDeletion = true; + } else { + android_shmem_delete(idx); + } + pthread_mutex_unlock(&mutex); + return 0; + } else if (cmd == IPC_STAT) { + if (!buf) { + DBG ("%s: ERROR: buf == NULL for shmid %x", __PRETTY_FUNCTION__, shmid); + errno = EINVAL; + return -1; + } + + pthread_mutex_lock(&mutex); + int idx = ashv_find_local_index(shmid); + if (idx == -1) { + DBG ("%s: ERROR: shmid %x does not exist", __PRETTY_FUNCTION__, shmid); + pthread_mutex_unlock (&mutex); + errno = EINVAL; + return -1; + } + /* Report max permissive mode */ + memset(buf, 0, sizeof(struct shmid_ds)); + buf->shm_segsz = shmem[idx].size; + buf->shm_nattch = 1; + buf->shm_perm.key = shmem[idx].key; + buf->shm_perm.uid = geteuid(); + buf->shm_perm.gid = getegid(); + buf->shm_perm.cuid = geteuid(); + buf->shm_perm.cgid = getegid(); + buf->shm_perm.mode = 0666; + buf->shm_perm.seq = 1; + + pthread_mutex_unlock (&mutex); + return 0; + } + + DBG("%s: cmd %d not implemented yet!", __PRETTY_FUNCTION__, cmd); + errno = EINVAL; + return -1; +} diff -uNr cairo-1.16.0/src/android-shmem.h cairo-1.16.0.mod/src/android-shmem.h --- cairo-1.16.0/src/android-shmem.h 1970-01-01 03:00:00.000000000 +0300 +++ cairo-1.16.0.mod/src/android-shmem.h 2019-08-16 20:37:14.955977067 +0300 @@ -0,0 +1,28 @@ +#ifndef _SYS_SHM_H +#define _SYS_SHM_H + +#include +#include +#include + +__BEGIN_DECLS + +#ifndef shmid_ds +# define shmid_ds shmid64_ds +#endif + +/* Shared memory control operations. */ +int android_shmctl(int shmid, int cmd, struct shmid_ds* buf); + +/* Get shared memory area identifier. */ +int android_shmget(key_t key, size_t size, int shmflg); + +/* Attach shared memory segment. */ +void *android_shmat(int shmid, void const* shmaddr, int shmflg); + +/* Detach shared memory segment. */ +int android_shmdt(void const* shmaddr); + +__END_DECLS + +#endif diff -uNr cairo-1.16.0/src/cairo.pc.in cairo-1.16.0.mod/src/cairo.pc.in --- cairo-1.16.0/src/cairo.pc.in 2018-08-17 04:10:53.000000000 +0300 +++ cairo-1.16.0.mod/src/cairo.pc.in 2019-08-16 20:37:14.955977067 +0300 @@ -9,5 +9,5 @@ @PKGCONFIG_REQUIRES@: @CAIRO_REQUIRES@ Libs: -L${libdir} -lcairo -Libs.private: @CAIRO_NONPKGCONFIG_LIBS@ +Libs.private: @CAIRO_NONPKGCONFIG_LIBS@ -llog Cflags: -I${includedir}/cairo diff -uNr cairo-1.16.0/src/cairo-xcb-connection.c cairo-1.16.0.mod/src/cairo-xcb-connection.c --- cairo-1.16.0/src/cairo-xcb-connection.c 2018-08-17 04:10:53.000000000 +0300 +++ cairo-1.16.0.mod/src/cairo-xcb-connection.c 2019-08-16 20:38:23.676405816 +0300 @@ -32,6 +32,7 @@ #include "cairoint.h" +#include "android-shmem.h" #include "cairo-xcb-private.h" #include "cairo-hash-private.h" #include "cairo-freelist-private.h" @@ -43,7 +44,6 @@ #if CAIRO_HAS_XCB_SHM_FUNCTIONS #include -#include #include #endif @@ -452,13 +452,13 @@ uint32_t shmseg; void *ptr; - shmid = shmget (IPC_PRIVATE, 0x1000, IPC_CREAT | 0600); + shmid = android_shmget (IPC_PRIVATE, 0x1000, IPC_CREAT | 0600); if (shmid == -1) return FALSE; - ptr = shmat (shmid, NULL, 0); + ptr = android_shmat (shmid, NULL, 0); if (ptr == (char *) -1) { - shmctl (shmid, IPC_RMID, NULL); + android_shmctl (shmid, IPC_RMID, NULL); return FALSE; } @@ -475,8 +475,8 @@ if (error != NULL) success = FALSE; - shmctl (shmid, IPC_RMID, NULL); - shmdt (ptr); + android_shmctl (shmid, IPC_RMID, NULL); + android_shmdt (ptr); return success; } diff -uNr cairo-1.16.0/src/cairo-xcb-shm.c cairo-1.16.0.mod/src/cairo-xcb-shm.c --- cairo-1.16.0/src/cairo-xcb-shm.c 2018-08-17 04:10:53.000000000 +0300 +++ cairo-1.16.0.mod/src/cairo-xcb-shm.c 2019-08-16 20:37:48.552853136 +0300 @@ -38,13 +38,13 @@ #if CAIRO_HAS_XCB_SHM_FUNCTIONS +#include "android-shmem.h" #include "cairo-xcb-private.h" #include "cairo-list-inline.h" #include "cairo-mempool-private.h" #include #include -#include #include #define CAIRO_MAX_SHM_MEMORY (16*1024*1024) @@ -75,7 +75,7 @@ { cairo_list_del (&pool->link); - shmdt (pool->shm); + android_shmdt (pool->shm); _cairo_mempool_fini (&pool->mem); free (pool); @@ -221,7 +221,7 @@ bytes <<= 3; do { - pool->shmid = shmget (IPC_PRIVATE, bytes, IPC_CREAT | 0600); + pool->shmid = android_shmget (IPC_PRIVATE, bytes, IPC_CREAT | 0600); if (pool->shmid != -1) break; @@ -240,9 +240,9 @@ return CAIRO_INT_STATUS_UNSUPPORTED; } - pool->shm = shmat (pool->shmid, NULL, 0); + pool->shm = android_shmat (pool->shmid, NULL, 0); if (unlikely (pool->shm == (char *) -1)) { - shmctl (pool->shmid, IPC_RMID, NULL); + android_shmctl (pool->shmid, IPC_RMID, NULL); free (pool); CAIRO_MUTEX_UNLOCK (connection->shm_mutex); return _cairo_error (CAIRO_STATUS_NO_MEMORY); @@ -251,14 +251,14 @@ status = _cairo_mempool_init (&pool->mem, pool->shm, bytes, minbits, maxbits - minbits + 1); if (unlikely (status)) { - shmdt (pool->shm); + android_shmdt (pool->shm); free (pool); CAIRO_MUTEX_UNLOCK (connection->shm_mutex); return status; } pool->shmseg = _cairo_xcb_connection_shm_attach (connection, pool->shmid, FALSE); - shmctl (pool->shmid, IPC_RMID, NULL); + android_shmctl (pool->shmid, IPC_RMID, NULL); cairo_list_add (&pool->link, &connection->shm_pools); mem = _cairo_mempool_alloc (&pool->mem, size); diff -uNr cairo-1.16.0/src/cairo-xlib-surface.c cairo-1.16.0.mod/src/cairo-xlib-surface.c --- cairo-1.16.0/src/cairo-xlib-surface.c 2018-08-17 04:10:53.000000000 +0300 +++ cairo-1.16.0.mod/src/cairo-xlib-surface.c 2019-08-16 20:37:56.532902932 +0300 @@ -70,7 +70,6 @@ #include #include -#include #define XLIB_COORD_MAX 32767 @@ -1390,7 +1389,7 @@ *image_extra = NULL; *image_out = (cairo_image_surface_t *) _cairo_xlib_surface_get_shm (abstract_surface, FALSE); - if (*image_out) + if (*image_out) return (*image_out)->base.status; extents.x = extents.y = 0; diff -uNr cairo-1.16.0/src/cairo-xlib-surface-shm.c cairo-1.16.0.mod/src/cairo-xlib-surface-shm.c --- cairo-1.16.0/src/cairo-xlib-surface-shm.c 2018-08-17 04:10:53.000000000 +0300 +++ cairo-1.16.0.mod/src/cairo-xlib-surface-shm.c 2019-08-16 20:38:09.702985163 +0300 @@ -39,6 +39,7 @@ #if !CAIRO_HAS_XLIB_XCB_FUNCTIONS +#include "android-shmem.h" #include "cairo-xlib-private.h" #include "cairo-xlib-surface-private.h" @@ -150,7 +151,6 @@ #include #endif #include -#include #define MIN_PIXMAP_SIZE 4096 @@ -372,14 +372,14 @@ XShmQueryVersion (dpy, &major, &minor, has_pixmap); - shm.shmid = shmget (IPC_PRIVATE, 0x1000, IPC_CREAT | 0600); + shm.shmid = android_shmget (IPC_PRIVATE, 0x1000, IPC_CREAT | 0600); if (shm.shmid == -1) return FALSE; shm.readOnly = FALSE; - shm.shmaddr = shmat (shm.shmid, NULL, 0); + shm.shmaddr = android_shmat (shm.shmid, NULL, 0); if (shm.shmaddr == (char *) -1) { - shmctl (shm.shmid, IPC_RMID, NULL); + android_shmctl (shm.shmid, IPC_RMID, NULL); return FALSE; } @@ -398,8 +398,8 @@ XSetErrorHandler (old_handler); XUnlockDisplay (dpy); - shmctl (shm.shmid, IPC_RMID, NULL); - shmdt (shm.shmaddr); + android_shmctl (shm.shmid, IPC_RMID, NULL); + android_shmdt (shm.shmaddr); return success && ! _x_error_occurred; } @@ -420,7 +420,7 @@ _cairo_xlib_display_shm_pool_destroy (cairo_xlib_display_t *display, cairo_xlib_shm_t *pool) { - shmdt (pool->shm.shmaddr); + android_shmdt (pool->shm.shmaddr); if (display->display) /* may be called after CloseDisplay */ XShmDetach (display->display, &pool->shm); @@ -584,18 +584,18 @@ minbits += (maxbits - 16) / 2; - pool->shm.shmid = shmget (IPC_PRIVATE, bytes, IPC_CREAT | 0600); + pool->shm.shmid = android_shmget (IPC_PRIVATE, bytes, IPC_CREAT | 0600); while (pool->shm.shmid == -1 && bytes >= 2*size) { bytes >>= 1; - pool->shm.shmid = shmget (IPC_PRIVATE, bytes, IPC_CREAT | 0600); + pool->shm.shmid = android_shmget (IPC_PRIVATE, bytes, IPC_CREAT | 0600); } if (pool->shm.shmid == -1) goto cleanup; pool->shm.readOnly = FALSE; - pool->shm.shmaddr = shmat (pool->shm.shmid, NULL, 0); + pool->shm.shmaddr = android_shmat (pool->shm.shmid, NULL, 0); if (pool->shm.shmaddr == (char *) -1) { - shmctl (pool->shm.shmid, IPC_RMID, NULL); + android_shmctl (pool->shm.shmid, IPC_RMID, NULL); goto cleanup; } @@ -604,7 +604,7 @@ #if !IPC_RMID_DEFERRED_RELEASE XSync (dpy, FALSE); #endif - shmctl (pool->shm.shmid, IPC_RMID, NULL); + android_shmctl (pool->shm.shmid, IPC_RMID, NULL); if (! success) goto cleanup_shm; @@ -622,7 +622,7 @@ cleanup_detach: XShmDetach (dpy, &pool->shm); cleanup_shm: - shmdt (pool->shm.shmaddr); + android_shmdt (pool->shm.shmaddr); cleanup: free (pool); return NULL; @@ -1307,14 +1307,14 @@ XShmCompletionEvent ev; XShmSegmentInfo info; - info.shmid = shmget (IPC_PRIVATE, 0x1000, IPC_CREAT | 0600); + info.shmid = android_shmget (IPC_PRIVATE, 0x1000, IPC_CREAT | 0600); if (info.shmid == -1) return TRUE; info.readOnly = FALSE; - info.shmaddr = shmat (info.shmid, NULL, 0); + info.shmaddr = android_shmat (info.shmid, NULL, 0); if (info.shmaddr == (char *) -1) { - shmctl (info.shmid, IPC_RMID, NULL); + android_shmctl (info.shmid, IPC_RMID, NULL); return TRUE; } @@ -1343,8 +1343,8 @@ XSetErrorHandler (old_handler); XUnlockDisplay (dpy); - shmctl (info.shmid, IPC_RMID, NULL); - shmdt (info.shmaddr); + android_shmctl (info.shmid, IPC_RMID, NULL); + android_shmdt (info.shmaddr); return _x_error_occurred; } diff -uNr cairo-1.16.0/src/Makefile.am cairo-1.16.0.mod/src/Makefile.am --- cairo-1.16.0/src/Makefile.am 2018-08-17 04:10:53.000000000 +0300 +++ cairo-1.16.0.mod/src/Makefile.am 2019-08-16 20:37:14.955977067 +0300 @@ -35,7 +35,7 @@ $(enabled_cairo_cxx_sources) \ $(NULL) libcairo_cxx_la_LDFLAGS = $(AM_LDFLAGS) $(export_symbols) -libcairo_cxx_la_LIBADD = $(CAIRO_LIBS) +libcairo_cxx_la_LIBADD = $(CAIRO_LIBS) -llog libcairo_cxx_la_DEPENDENCIES = $(cairo_def_dependency) @@ -46,7 +46,7 @@ $(NULL) libcairo_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols) libcairo_la_LIBADD = $(CAIRO_LIBS) \ - $(cairo_cxx_lib) + $(cairo_cxx_lib) -llog libcairo_la_DEPENDENCIES = $(cairo_def_dependency) $(cairo_cxx_lib) # Special headers diff -uNr cairo-1.16.0/src/Makefile.in cairo-1.16.0.mod/src/Makefile.in --- cairo-1.16.0/src/Makefile.in 2018-10-19 23:20:07.000000000 +0300 +++ cairo-1.16.0.mod/src/Makefile.in 2019-08-16 20:37:14.959310422 +0300 @@ -568,7 +568,7 @@ cairo-svg-surface.c test-compositor-surface.c \ test-null-compositor-surface.c test-base-compositor-surface.c \ test-paginated-surface.c cairo-tee-surface.c \ - cairo-xml-surface.c cairo-version.h + cairo-xml-surface.c cairo-version.h android-shmem.c am__objects_1 = @CAIRO_HAS_XLIB_SURFACE_TRUE@am__objects_2 = $(am__objects_1) @CAIRO_HAS_XLIB_XRENDER_SURFACE_TRUE@am__objects_3 = $(am__objects_1) @@ -780,7 +780,7 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent -am__v_lt_1 = +am__v_lt_1 = libcairo_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libcairo_la_LDFLAGS) $(LDFLAGS) -o $@ @@ -896,11 +896,11 @@ AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = +am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ -am__v_at_1 = +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles @@ -914,7 +914,7 @@ AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -922,7 +922,7 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = +am__v_CCLD_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ @@ -932,7 +932,7 @@ AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; -am__v_CXX_1 = +am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ @@ -940,7 +940,7 @@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; -am__v_CXXLD_1 = +am__v_CXXLD_1 = SOURCES = $(libcairo_la_SOURCES) $(nodist_libcairo_la_SOURCES) \ $(libcairo_cxx_la_SOURCES) check-link.c DIST_SOURCES = $(am__libcairo_la_SOURCES_DIST) \ @@ -1177,7 +1177,7 @@ CAIROBOILERPLATE_LIBS = @CAIROBOILERPLATE_LIBS@ CAIRO_CFLAGS = @CAIRO_CFLAGS@ CAIRO_LDFLAGS = @CAIRO_LDFLAGS@ -CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_LIBS = @CAIRO_LIBS@ -llog CAIRO_LIBTOOL_VERSION_INFO = @CAIRO_LIBTOOL_VERSION_INFO@ CAIRO_NONPKGCONFIG_CFLAGS = @CAIRO_NONPKGCONFIG_CFLAGS@ CAIRO_NONPKGCONFIG_LIBS = @CAIRO_NONPKGCONFIG_LIBS@ @@ -1390,7 +1390,7 @@ cairo-supported-features.h EXTRA_DIST = Makefile.win32 Makefile.win32.features $(TESTS_SH) \ check-has-hidden-symbols.c check-doc-syntax.awk -EXTRA_LTLIBRARIES = +EXTRA_LTLIBRARIES = MAINTAINERCLEANFILES = Makefile.in cairo_headers = cairo.h cairo-deprecated.h cairo_private = cairoint.h cairo-analysis-surface-private.h \ @@ -1901,7 +1901,7 @@ cairoinclude_HEADERS = $(enabled_cairo_headers) \ $(top_srcdir)/cairo-version.h lib_LTLIBRARIES = libcairo.la -@BUILD_CXX_FALSE@cairo_cxx_lib = +@BUILD_CXX_FALSE@cairo_cxx_lib = @BUILD_CXX_TRUE@cairo_cxx_lib = libcairo_cxx.la noinst_LTLIBRARIES = $(cairo_cxx_lib) libcairo_cxx_la_SOURCES = \ @@ -2103,10 +2103,10 @@ rm -f $${locs}; \ } -libcairo.la: $(libcairo_la_OBJECTS) $(libcairo_la_DEPENDENCIES) $(EXTRA_libcairo_la_DEPENDENCIES) +libcairo.la: $(libcairo_la_OBJECTS) $(libcairo_la_DEPENDENCIES) $(EXTRA_libcairo_la_DEPENDENCIES) $(AM_V_CCLD)$(libcairo_la_LINK) -rpath $(libdir) $(libcairo_la_OBJECTS) $(libcairo_la_LIBADD) $(LIBS) -libcairo_cxx.la: $(libcairo_cxx_la_OBJECTS) $(libcairo_cxx_la_DEPENDENCIES) $(EXTRA_libcairo_cxx_la_DEPENDENCIES) +libcairo_cxx.la: $(libcairo_cxx_la_OBJECTS) $(libcairo_cxx_la_DEPENDENCIES) $(EXTRA_libcairo_cxx_la_DEPENDENCIES) $(AM_V_CXXLD)$(libcairo_cxx_la_LINK) $(am_libcairo_cxx_la_rpath) $(libcairo_cxx_la_OBJECTS) $(libcairo_cxx_la_LIBADD) $(LIBS) clean-checkPROGRAMS: @@ -2118,7 +2118,7 @@ echo " rm -f" $$list; \ rm -f $$list -check-link$(EXEEXT): $(check_link_OBJECTS) $(check_link_DEPENDENCIES) $(EXTRA_check_link_DEPENDENCIES) +check-link$(EXEEXT): $(check_link_OBJECTS) $(check_link_DEPENDENCIES) $(EXTRA_check_link_DEPENDENCIES) @rm -f check-link$(EXEEXT) $(AM_V_CCLD)$(LINK) $(check_link_OBJECTS) $(check_link_LDADD) $(LIBS) diff -uNr cairo-1.16.0/src/Makefile.sources cairo-1.16.0.mod/src/Makefile.sources --- cairo-1.16.0/src/Makefile.sources 2018-10-18 03:21:03.000000000 +0300 +++ cairo-1.16.0.mod/src/Makefile.sources 2019-08-16 20:37:14.959310422 +0300 @@ -240,6 +240,7 @@ cairo-version.c \ cairo-wideint.c \ cairo.c \ + android-shmem.c \ $(NULL) _cairo_font_subset_private = \ ================================================ FILE: packages/libcairo/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://cairographics.org TERMUX_PKG_DESCRIPTION="Cairo 2D vector graphics library" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=1.16.0 TERMUX_PKG_REVISION=4 TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/cairo-$TERMUX_PKG_VERSION.tar.xz TERMUX_PKG_SHA256=5e7b29b3f113ef870d1e3ecf8adf21f923396401604bda16d44be45e66052331 TERMUX_PKG_DEPENDS="fontconfig, freetype, glib, liblzo, libpixman, libpng, libx11, libxcb, libxext, libxrender, zlib" TERMUX_PKG_BREAKS="libcairo-dev, libcairo-gobject" TERMUX_PKG_REPLACES="libcairo-dev, libcairo-gobject" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-gtk-doc-html --disable-gl --enable-gobject --enable-pdf --enable-svg --enable-ps " TERMUX_PKG_RM_AFTER_INSTALL="share/gtk-doc/html" termux_step_pre_configure() { autoreconf -fi } ================================================ FILE: packages/libcairo/cairo-script-operators.c.patch ================================================ diff -uNr cairo-1.14.12/util/cairo-script/cairo-script-operators.c cairo-1.14.12.mod/util/cairo-script/cairo-script-operators.c --- cairo-1.14.12/util/cairo-script/cairo-script-operators.c 2017-12-05 00:26:25.000000000 +0200 +++ cairo-1.14.12.mod/util/cairo-script/cairo-script-operators.c 2018-06-19 17:48:57.767824702 +0300 @@ -1719,7 +1719,7 @@ static void * _mmap_bytes (const struct mmap_vec *vec, int count) { - char template[] = "/tmp/csi-font.XXXXXX"; + char template[] = "@TERMUX_PREFIX@/tmp/csi-font.XXXXXX"; void *ptr; int fd; int num_bytes; ================================================ FILE: packages/libcairo/fdr.c.patch ================================================ diff -uNr cairo-1.14.12/util/cairo-fdr/fdr.c cairo-1.14.12.mod/util/cairo-fdr/fdr.c --- cairo-1.14.12/util/cairo-fdr/fdr.c 2017-12-05 00:24:46.000000000 +0200 +++ cairo-1.14.12.mod/util/cairo-fdr/fdr.c 2017-12-17 13:40:14.062948088 +0200 @@ -67,7 +67,7 @@ cairo_device_t *ctx; int n; - ctx = DLCALL (cairo_script_create, "/tmp/fdr.trace"); + ctx = DLCALL (cairo_script_create, "@TERMUX_PREFIX@/tmp/fdr.trace"); for (n = fdr_position; n < RINGBUFFER_SIZE; n++) fdr_replay_to_script (fdr_ringbuffer[n], ctx); ================================================ FILE: packages/libcap/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://sites.google.com/site/fullycapable/ TERMUX_PKG_DESCRIPTION="POSIX 1003.1e capabilities" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=2.27 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=dac1792d0118bee6aae6ba7fb93ff1602c6a9bda812fd63916eee1435b9c486a TERMUX_PKG_DEPENDS="attr" TERMUX_PKG_BREAKS="libcap-dev" TERMUX_PKG_REPLACES="libcap-dev" TERMUX_PKG_BUILD_IN_SRC=true termux_step_make() { make CC="$CC -Wl,-rpath=$TERMUX_PREFIX/lib -Wl,--enable-new-dtags" PREFIX="$TERMUX_PREFIX" } termux_step_make_install() { make CC="$CC -Wl,-rpath=$TERMUX_PREFIX/lib -Wl,--enable-new-dtags" prefix="$TERMUX_PREFIX" RAISE_SETFCAP=no lib=/lib install } ================================================ FILE: packages/libcap/libcap-makefile.patch ================================================ diff -uNr libcap-2.26/libcap/Makefile libcap-2.26.mod/libcap/Makefile --- libcap-2.26/libcap/Makefile 2018-09-11 06:02:10.000000000 +0300 +++ libcap-2.26.mod/libcap/Makefile 2019-03-18 21:53:27.413691421 +0200 @@ -35,7 +35,7 @@ $< >$@ _makenames: _makenames.c cap_names.list.h - $(BUILD_CC) $(BUILD_CFLAGS) $< -o $@ + gcc $(BUILD_CFLAGS) $< -o $@ cap_names.h: _makenames ./_makenames > cap_names.h ================================================ FILE: packages/libcap/progs-capsh.patch ================================================ diff -uNr libcap-2.26/progs/capsh.c libcap-2.26.mod/progs/capsh.c --- libcap-2.26/progs/capsh.c 2018-09-08 23:07:52.000000000 +0300 +++ libcap-2.26.mod/progs/capsh.c 2019-03-05 19:42:47.917246690 +0200 @@ -692,10 +692,10 @@ } else if (!strcmp("--print", argv[i])) { arg_print(); } else if ((!strcmp("--", argv[i])) || (!strcmp("==", argv[i]))) { - argv[i] = strdup(argv[i][0] == '-' ? "/bin/bash" : argv[0]); + argv[i] = strdup(argv[i][0] == '-' ? "@TERMUX_PREFIX@/bin/bash" : argv[0]); argv[argc] = NULL; execve(argv[i], argv+i, envp); - fprintf(stderr, "execve /bin/bash failed!\n"); + fprintf(stderr, "execve @TERMUX_PREFIX@/bin/bash failed!\n"); exit(1); } else { usage: @@ -720,7 +720,7 @@ " --killit= send signal(n) to child\n" " --forkfor= fork and make child sleep for sec\n" " == re-exec(capsh) with args as for --\n" - " -- remaing arguments are for /bin/bash\n" + " -- remaing arguments are for $PREFIX/bin/bash\n" " (without -- [%s] will simply exit(0))\n", argv[0], argv[0]); ================================================ FILE: packages/libcln/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.ginac.de/CLN/ TERMUX_PKG_DESCRIPTION="CLN is a library for efficient computations with all kinds of numbers in arbitrary precision" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.3.5 TERMUX_PKG_SRCURL=https://www.ginac.de/CLN/cln-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SHA256=78810064a50b4299a0a3c16cade54a7d2e72ac92a8ee295f9a9177efc81e842d TERMUX_PKG_DEPENDS="libc++, libgmp" TERMUX_PKG_BREAKS="libcln-dev" TERMUX_PKG_REPLACES="libcln-dev" TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { if [ $TERMUX_ARCH = arm ]; then # See the following section in INSTALL: # "(*) On these platforms, problems with the assembler routines have been # reported. It may be best to add "-DNO_ASM" to CPPFLAGS before configuring." CPPFLAGS+=" -DNO_ASM" CXXFLAGS+=" -fintegrated-as" fi sed -i -e 's%tests/Makefile %%' configure.ac sed -i -e 's%examples/Makefile %%' configure.ac sed -i -e 's%benchmarks/Makefile %%' configure.ac autoreconf } termux_step_post_configure() { cd $TERMUX_PKG_SRCDIR sed -i -e 's% tests%%' Makefile sed -i -e 's% examples%%' Makefile sed -i -e 's% benchmarks%%' Makefile } ================================================ FILE: packages/libcln/revert_configure_tests.patch ================================================ Reverts this commit in the cln repo: commit 2f7994014542920ad6ca726fbd8d023a5f49abc2 Author: Richard Kreckel Date: Sun Oct 27 14:57:36 2019 +0100 Replace typedef int[] trick with static_assert. diff -u -r ../src/m4/floatparam.m4 ./m4/floatparam.m4 --- ../src/m4/floatparam.m4 2019-10-27 14:41:55.000000000 +0100 +++ ./m4/floatparam.m4 2019-11-28 08:21:28.161830204 +0100 @@ -22,16 +22,20 @@ epsilon_bits=-1; y="($type)1.0" while true; do AC_TRY_COMPILE([], - [static_assert((($type)(($type)1.0 + ($type)($y)) == ($type)1.0) - || ($type)(($type)(($type)1.0 + ($type)($y)) - ($type)1.0) != ($type)($y), "");], + [typedef int verify[2*( + (($type)(($type)1.0 + ($type)($y)) == ($type)1.0) + || ($type)(($type)(($type)1.0 + ($type)($y)) - ($type)1.0) != ($type)($y) + ) - 1];], [break;]) epsilon_bits=`expr $epsilon_bits + 1`; y="$y * ($type)0.5" done negepsilon_bits=-1; y="($type)-1.0" while true; do AC_TRY_COMPILE([], - [static_assert((($type)(($type)1.0 + ($type)($y)) == ($type)1.0) - || ($type)(($type)(($type)1.0 + ($type)($y)) - ($type)1.0) != ($type)($y), "");], + [typedef int verify[2*( + (($type)(($type)1.0 + ($type)($y)) == ($type)1.0) + || ($type)(($type)(($type)1.0 + ($type)($y)) - ($type)1.0) != ($type)($y) + ) - 1];], [break;]) negepsilon_bits=`expr $negepsilon_bits + 1`; y="$y * ($type)0.5" done @@ -64,22 +68,30 @@ rounds= if test -z "$rounds"; then AC_TRY_COMPILE([], - [static_assert($ys1 == $y1 && $ys2 == $y2 && $zs1 == $z1 && $zs2 == $z2, "");], + [typedef int verify[2*( + $ys1 == $y1 && $ys2 == $y2 && $zs1 == $z1 && $zs2 == $z2 + ) - 1];], [rounds=rounds_to_nearest]) fi if test -z "$rounds"; then AC_TRY_COMPILE([], - [static_assert($ys1 == $y1 && $ys2 == $y1 && $zs1 == $z1 && $zs2 == $z1, "");], + [typedef int verify[2*( + $ys1 == $y1 && $ys2 == $y1 && $zs1 == $z1 && $zs2 == $z1 + ) - 1];], [rounds=rounds_to_zero]) fi if test -z "$rounds"; then AC_TRY_COMPILE([], - [static_assert($ys1 == $y2 && $ys2 == $y2 && $zs1 == $z1 && $zs2 == $z1, "");], + [typedef int verify[2*( + $ys1 == $y2 && $ys2 == $y2 && $zs1 == $z1 && $zs2 == $z1 + ) - 1];], [rounds=rounds_to_infinity]) fi if test -z "$rounds"; then AC_TRY_COMPILE([], - [static_assert($ys1 == $y1 && $ys2 == $y1 && $zs1 == $z2 && $zs2 == $z2, "");], + [typedef int verify[2*( + $ys1 == $y1 && $ys2 == $y1 && $zs1 == $z2 && $zs2 == $z2 + ) - 1];], [rounds=rounds_to_minus_infinity]) fi if test -n "$rounds"; then diff -u -r ../src/m4/intparam.m4 ./m4/intparam.m4 --- ../src/m4/intparam.m4 2019-11-02 17:04:20.000000000 +0100 +++ ./m4/intparam.m4 2019-11-28 08:21:28.161830204 +0100 @@ -113,7 +113,7 @@ echo "#error \"Integer types long long and unsigned long long have different sizes!!\"" fi fi - AC_TRY_COMPILE([], [static_assert(sizeof(char*) <= sizeof(intptr_t), "");], + AC_TRY_COMPILE([], [typedef int verify[2*(sizeof(char*)<=sizeof (long))-1];], [], [echo "#error \"Type char * does not fit into an intptr_t!!\""]) _AC_COMPUTE_INT([sizeof (char *)], [pointer_size]) pointer_bitsize=`expr $pointer_size '*' $char_bitsize` @@ -258,7 +258,7 @@ [ n=1; x="($1)2" while true; do - AC_TRY_COMPILE([], [static_assert(($1)($x) == 0, "");], + AC_TRY_COMPILE([], [typedef int verify[2*(($1)($x) == 0) - 1];], [$2=$n; break;], [if test $n = 1000; then $2=; break; fi;]) n=`expr $n + 1`; x="$x * ($1)2" @@ -290,7 +290,7 @@ #else # define alignof(type) offsetof (struct { char slot1; type slot2; }, slot2) #endif -], [static_assert(alignof($1) == $n, "");], +], [typedef int verify[2*(alignof($1) == $n) - 1];], [$2=$n; break;] [if test $n = 0; then $2=; break; fi]) n=`expr $n '*' 2` --- ../src/include/cln/number.h 2019-10-27 14:29:45.000000000 +0100 +++ ./include/cln/number.h 2019-11-28 08:21:28.161830204 +0100 @@ -257,8 +257,7 @@ inline const type& the(const cl_number& x) { // check that sizeof(type)==sizeof(cl_number) - static_assert(sizeof(type)==sizeof(cl_number), - "sizeof(type)!=sizeof(cl_number)"); + int (*dummy1)(int assertion1 [1 - 2 * (sizeof(type) != sizeof(cl_number))]); (void)dummy1; return *(const type *) &x; } // Conversions to subtypes without checking, macro version: ================================================ FILE: packages/libcln/src-base-low-cl_low_div.cc.patch ================================================ diff -u -r ../cln-1.3.4/src/base/low/cl_low_div.cc ./src/base/low/cl_low_div.cc --- ../cln-1.3.4/src/base/low/cl_low_div.cc 2011-04-08 21:07:28.000000000 +0000 +++ ./src/base/low/cl_low_div.cc 2017-01-17 23:06:55.460210789 +0000 @@ -10,11 +10,11 @@ // Implementation. #ifdef NEED_VAR_divu_16_rest -uint16 divu_16_rest; +extern "C" { uint16 divu_16_rest; } #endif #ifdef NEED_FUNCTION_divu_3216_1616_ -uint16 divu_16_rest; +extern "C" { uint16 divu_16_rest; } namespace cln { #if 1 // Most processors have a good 32 by 32 bit division, use that. @@ -101,11 +101,11 @@ #endif #ifdef NEED_VAR_divu_32_rest -uint32 divu_32_rest; +extern "C" { uint32 divu_32_rest; } #endif #ifdef NEED_FUNCTION_divu_6432_3232_ -uint32 divu_32_rest; +extern "C" { uint32 divu_32_rest; } namespace cln { uint32 divu_6432_3232_(uint32 xhi, uint32 xlo, uint32 y) // Methode: @@ -207,7 +207,7 @@ #endif #ifdef NEED_VAR_divu_64_rest -uint64 divu_64_rest; +extern "C" { uint64 divu_64_rest; } #endif #ifdef NEED_FUNCTION_divu_6464_6464_ ================================================ FILE: packages/libcln/src-base-low-cl_low_mul.cc.patch ================================================ diff -u -r ../cln-1.3.4/src/base/low/cl_low_mul.cc ./src/base/low/cl_low_mul.cc --- ../cln-1.3.4/src/base/low/cl_low_mul.cc 2011-04-08 21:06:30.000000000 +0000 +++ ./src/base/low/cl_low_mul.cc 2017-01-17 23:08:39.856001383 +0000 @@ -10,11 +10,11 @@ // Implementation. #ifdef NEED_VAR_mulu32_high -uint32 mulu32_high; +extern "C" { uint32 mulu32_high; } #endif #ifdef NEED_FUNCTION_mulu32_ -uint32 mulu32_high; +extern "C" { uint32 mulu32_high; } namespace cln { uint32 mulu32_ (uint32 x, uint32 y) { @@ -50,11 +50,11 @@ #ifdef NEED_VAR_mulu64_high -uint64 mulu64_high; +extern "C" { uint64 mulu64_high; } #endif #ifdef NEED_FUNCTION_mulu64_ -uint64 mulu64_high; +extern "C" { uint64 mulu64_high; } namespace cln { extern "C" uint64 mulu64_ (uint64 x, uint64 y); uint64 mulu64_ (uint64 x, uint64 y) ================================================ FILE: packages/libcoap/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://libcoap.net/ TERMUX_PKG_DESCRIPTION="Implementation of CoAP, a lightweight protocol for resource constrained devices" TERMUX_PKG_LICENSE="BSD 2-Clause" TERMUX_PKG_VERSION=4.2.1 TERMUX_PKG_SHA256=29a0394a265d3febee41e5e2dc03d34292a0aede37f5f80334e529ac0dab2321 TERMUX_PKG_SRCURL=https://github.com/obgm/libcoap/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_DEPENDS="openssl" TERMUX_PKG_BREAKS="libcoap-dev" TERMUX_PKG_REPLACES="libcoap-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-openssl --disable-doxygen" termux_step_pre_configure() { NOCONFIGURE=1 ./autogen.sh } ================================================ FILE: packages/libconfig/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/hyperrealm/libconfig TERMUX_PKG_DESCRIPTION="C/C++ Configuration File Library" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=1.7.2 TERMUX_PKG_REVISION=3 TERMUX_PKG_SRCURL=https://github.com/hyperrealm/libconfig/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=f67ac44099916ae260a6c9e290a90809e7d782d96cdd462cac656ebc5b685726 TERMUX_PKG_DEPENDS="libc++" TERMUX_PKG_BREAKS="libconfig-dev" TERMUX_PKG_REPLACES="libconfig-dev" termux_step_pre_configure() { autoreconf -fi } ================================================ FILE: packages/libconfuse/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/martinh/libconfuse TERMUX_PKG_DESCRIPTION="Small configuration file parser library for C" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=3.2.2 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=71316b55592f8d0c98924242c98dbfa6252153a8b6e7d89e57fe6923934d77d0 TERMUX_PKG_BREAKS="libconfuse-dev" TERMUX_PKG_REPLACES="libconfuse-dev" TERMUX_PKG_SRCURL=https://github.com/martinh/libconfuse/releases/download/v$TERMUX_PKG_VERSION/confuse-$TERMUX_PKG_VERSION.tar.gz ================================================ FILE: packages/libcroco/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/GNOME/libcroco TERMUX_PKG_DESCRIPTION="CSS parsing and manipulation library" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=0.6.13 TERMUX_PKG_REVISION=2 TERMUX_PKG_SHA256=767ec234ae7aa684695b3a735548224888132e063f92db585759b422570621d4 TERMUX_PKG_SRCURL=http://ftp.gnome.org/pub/gnome/sources/libcroco/${TERMUX_PKG_VERSION:0:3}/libcroco-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_DEPENDS="glib,liblzma,libxml2" TERMUX_PKG_BREAKS="libcroco-dev" TERMUX_PKG_REPLACES="libcroco-dev" ================================================ FILE: packages/libcrypt/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://michael.dipperstein.com/crypt/ TERMUX_PKG_DESCRIPTION="A crypt(3) implementation" TERMUX_PKG_LICENSE="BSD 2-Clause" TERMUX_PKG_VERSION=0.2 TERMUX_PKG_REVISION=2 TERMUX_PKG_SKIP_SRC_EXTRACT=true TERMUX_PKG_DEPENDS="openssl" TERMUX_PKG_BREAKS="libcrypt-dev" TERMUX_PKG_REPLACES="libcrypt-dev" termux_step_make_install() { $CC $CFLAGS $CPPFLAGS $LDFLAGS -Wall -Wextra -fPIC -shared $TERMUX_PKG_BUILDER_DIR/crypt3.c -lcrypto -o $TERMUX_PREFIX/lib/libcrypt.so mkdir -p $TERMUX_PREFIX/include/ cp $TERMUX_PKG_BUILDER_DIR/crypt.h $TERMUX_PREFIX/include/ } ================================================ FILE: packages/libcrypt/crypt.h ================================================ #ifndef CRYPT_H_INCLUDED #define CRYPT_H_INCLUDED #include __BEGIN_DECLS char* crypt(const char* key, const char* salt); __END_DECLS #endif ================================================ FILE: packages/libcrypt/crypt3.c ================================================ /************************************************************************** * Implementation of crypt(3) using routines in libcrypto from openssl for * use on Android in Termux. * * https://www.freebsd.org/cgi/man.cgi?crypt(3) * http://man7.org/linux/man-pages/man3/crypt.3.html * * Relevant code is from FreeBSD with license given below. **************************************************************************/ /* * Copyright (c) 2011 The FreeBSD Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include #include #include #include #include #include #include #include #include /* START: Freebsd compat */ typedef unsigned long u_long; #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) #define MD5_SIZE 16 #define _PASSWORD_EFMT1 '_' #define DES_SALT_ALPHABET \ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" #define MD5Init MD5_Init #define MD5Update MD5_Update #define MD5Final MD5_Final /* END: Freebsd compat */ /* START: https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/misc.c */ static char itoa64[] = /* 0 ... 63 => ascii - 64 */ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; void _crypt_to64(char *s, u_long v, int n) { while (--n >= 0) { *s++ = itoa64[v&0x3f]; v >>= 6; } } void b64_from_24bit(uint8_t B2, uint8_t B1, uint8_t B0, int n, int *buflen, char **cp) { uint32_t w; int i; w = (B2 << 16) | (B1 << 8) | B0; for (i = 0; i < n; i++) { **cp = itoa64[w&0x3f]; (*cp)++; if ((*buflen)-- < 0) break; w >>= 6; } } /* END: https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/misc.c */ /* START: https://github.com/freebsd/freebsd/blob/master/secure/lib/libcrypt/crypt-des.c */ #if defined(__GNUC__) && !defined(lint) #define INLINE inline #else #define INLINE #endif static u_char IP[64] = { 58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7 }; static u_char inv_key_perm[64]; static u_char key_perm[56] = { 57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4 }; static u_char key_shifts[16] = { 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 }; static u_char inv_comp_perm[56]; static u_char comp_perm[48] = { 14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32 }; /* * No E box is used, as it's replaced by some ANDs, shifts, and ORs. */ static u_char u_sbox[8][64]; static u_char sbox[8][64] = { { 14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7, 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8, 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0, 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13 }, { 15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10, 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5, 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15, 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9 }, { 10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8, 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1, 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7, 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12 }, { 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15, 13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9, 10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4, 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14 }, { 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9, 14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6, 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14, 11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3 }, { 12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11, 10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8, 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6, 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13 }, { 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1, 13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6, 1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2, 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12 }, { 13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7, 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2, 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8, 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11 } }; static u_char un_pbox[32]; static u_char pbox[32] = { 16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10, 2, 8, 24, 14, 32, 27, 3, 9, 19, 13, 30, 6, 22, 11, 4, 25 }; static u_int32_t bits32[32] = { 0x80000000, 0x40000000, 0x20000000, 0x10000000, 0x08000000, 0x04000000, 0x02000000, 0x01000000, 0x00800000, 0x00400000, 0x00200000, 0x00100000, 0x00080000, 0x00040000, 0x00020000, 0x00010000, 0x00008000, 0x00004000, 0x00002000, 0x00001000, 0x00000800, 0x00000400, 0x00000200, 0x00000100, 0x00000080, 0x00000040, 0x00000020, 0x00000010, 0x00000008, 0x00000004, 0x00000002, 0x00000001 }; static u_char bits8[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 }; static u_int32_t saltbits; static u_int32_t old_salt; static u_int32_t *bits28, *bits24; static u_char init_perm[64], final_perm[64]; static u_int32_t en_keysl[16], en_keysr[16]; static u_int32_t de_keysl[16], de_keysr[16]; static int des_initialised = 0; static u_char m_sbox[4][4096]; static u_int32_t psbox[4][256]; static u_int32_t ip_maskl[8][256], ip_maskr[8][256]; static u_int32_t fp_maskl[8][256], fp_maskr[8][256]; static u_int32_t key_perm_maskl[8][128], key_perm_maskr[8][128]; static u_int32_t comp_maskl[8][128], comp_maskr[8][128]; static u_int32_t old_rawkey0, old_rawkey1; static u_char ascii64[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; /* 0000000000111111111122222222223333333333444444444455555555556666 */ /* 0123456789012345678901234567890123456789012345678901234567890123 */ static INLINE int ascii_to_bin(char ch) { if (ch > 'z') return(0); if (ch >= 'a') return(ch - 'a' + 38); if (ch > 'Z') return(0); if (ch >= 'A') return(ch - 'A' + 12); if (ch > '9') return(0); if (ch >= '.') return(ch - '.'); return(0); } static void des_init(void) { int i, j, b, k, inbit, obit; u_int32_t *p, *il, *ir, *fl, *fr; old_rawkey0 = old_rawkey1 = 0L; saltbits = 0L; old_salt = 0L; bits24 = (bits28 = bits32 + 4) + 4; /* * Invert the S-boxes, reordering the input bits. */ for (i = 0; i < 8; i++) for (j = 0; j < 64; j++) { b = (j & 0x20) | ((j & 1) << 4) | ((j >> 1) & 0xf); u_sbox[i][j] = sbox[i][b]; } /* * Convert the inverted S-boxes into 4 arrays of 8 bits. * Each will handle 12 bits of the S-box input. */ for (b = 0; b < 4; b++) for (i = 0; i < 64; i++) for (j = 0; j < 64; j++) m_sbox[b][(i << 6) | j] = (u_char)((u_sbox[(b << 1)][i] << 4) | u_sbox[(b << 1) + 1][j]); /* * Set up the initial & final permutations into a useful form, and * initialise the inverted key permutation. */ for (i = 0; i < 64; i++) { init_perm[final_perm[i] = IP[i] - 1] = (u_char)i; inv_key_perm[i] = 255; } /* * Invert the key permutation and initialise the inverted key * compression permutation. */ for (i = 0; i < 56; i++) { inv_key_perm[key_perm[i] - 1] = (u_char)i; inv_comp_perm[i] = 255; } /* * Invert the key compression permutation. */ for (i = 0; i < 48; i++) { inv_comp_perm[comp_perm[i] - 1] = (u_char)i; } /* * Set up the OR-mask arrays for the initial and final permutations, * and for the key initial and compression permutations. */ for (k = 0; k < 8; k++) { for (i = 0; i < 256; i++) { *(il = &ip_maskl[k][i]) = 0L; *(ir = &ip_maskr[k][i]) = 0L; *(fl = &fp_maskl[k][i]) = 0L; *(fr = &fp_maskr[k][i]) = 0L; for (j = 0; j < 8; j++) { inbit = 8 * k + j; if (i & bits8[j]) { if ((obit = init_perm[inbit]) < 32) *il |= bits32[obit]; else *ir |= bits32[obit-32]; if ((obit = final_perm[inbit]) < 32) *fl |= bits32[obit]; else *fr |= bits32[obit - 32]; } } } for (i = 0; i < 128; i++) { *(il = &key_perm_maskl[k][i]) = 0L; *(ir = &key_perm_maskr[k][i]) = 0L; for (j = 0; j < 7; j++) { inbit = 8 * k + j; if (i & bits8[j + 1]) { if ((obit = inv_key_perm[inbit]) == 255) continue; if (obit < 28) *il |= bits28[obit]; else *ir |= bits28[obit - 28]; } } *(il = &comp_maskl[k][i]) = 0L; *(ir = &comp_maskr[k][i]) = 0L; for (j = 0; j < 7; j++) { inbit = 7 * k + j; if (i & bits8[j + 1]) { if ((obit=inv_comp_perm[inbit]) == 255) continue; if (obit < 24) *il |= bits24[obit]; else *ir |= bits24[obit - 24]; } } } } /* * Invert the P-box permutation, and convert into OR-masks for * handling the output of the S-box arrays setup above. */ for (i = 0; i < 32; i++) un_pbox[pbox[i] - 1] = (u_char)i; for (b = 0; b < 4; b++) for (i = 0; i < 256; i++) { *(p = &psbox[b][i]) = 0L; for (j = 0; j < 8; j++) { if (i & bits8[j]) *p |= bits32[un_pbox[8 * b + j]]; } } des_initialised = 1; } static void setup_salt(u_int32_t salt) { u_int32_t obit, saltbit; int i; if (salt == old_salt) return; old_salt = salt; saltbits = 0L; saltbit = 1; obit = 0x800000; for (i = 0; i < 24; i++) { if (salt & saltbit) saltbits |= obit; saltbit <<= 1; obit >>= 1; } } static int des_setkey(const char *key) { u_int32_t k0, k1, rawkey0, rawkey1; int shifts, round; if (!des_initialised) des_init(); rawkey0 = ntohl(*(const u_int32_t *) key); rawkey1 = ntohl(*(const u_int32_t *) (key + 4)); if ((rawkey0 | rawkey1) && rawkey0 == old_rawkey0 && rawkey1 == old_rawkey1) { /* * Already setup for this key. * This optimisation fails on a zero key (which is weak and * has bad parity anyway) in order to simplify the starting * conditions. */ return(0); } old_rawkey0 = rawkey0; old_rawkey1 = rawkey1; /* * Do key permutation and split into two 28-bit subkeys. */ k0 = key_perm_maskl[0][rawkey0 >> 25] | key_perm_maskl[1][(rawkey0 >> 17) & 0x7f] | key_perm_maskl[2][(rawkey0 >> 9) & 0x7f] | key_perm_maskl[3][(rawkey0 >> 1) & 0x7f] | key_perm_maskl[4][rawkey1 >> 25] | key_perm_maskl[5][(rawkey1 >> 17) & 0x7f] | key_perm_maskl[6][(rawkey1 >> 9) & 0x7f] | key_perm_maskl[7][(rawkey1 >> 1) & 0x7f]; k1 = key_perm_maskr[0][rawkey0 >> 25] | key_perm_maskr[1][(rawkey0 >> 17) & 0x7f] | key_perm_maskr[2][(rawkey0 >> 9) & 0x7f] | key_perm_maskr[3][(rawkey0 >> 1) & 0x7f] | key_perm_maskr[4][rawkey1 >> 25] | key_perm_maskr[5][(rawkey1 >> 17) & 0x7f] | key_perm_maskr[6][(rawkey1 >> 9) & 0x7f] | key_perm_maskr[7][(rawkey1 >> 1) & 0x7f]; /* * Rotate subkeys and do compression permutation. */ shifts = 0; for (round = 0; round < 16; round++) { u_int32_t t0, t1; shifts += key_shifts[round]; t0 = (k0 << shifts) | (k0 >> (28 - shifts)); t1 = (k1 << shifts) | (k1 >> (28 - shifts)); de_keysl[15 - round] = en_keysl[round] = comp_maskl[0][(t0 >> 21) & 0x7f] | comp_maskl[1][(t0 >> 14) & 0x7f] | comp_maskl[2][(t0 >> 7) & 0x7f] | comp_maskl[3][t0 & 0x7f] | comp_maskl[4][(t1 >> 21) & 0x7f] | comp_maskl[5][(t1 >> 14) & 0x7f] | comp_maskl[6][(t1 >> 7) & 0x7f] | comp_maskl[7][t1 & 0x7f]; de_keysr[15 - round] = en_keysr[round] = comp_maskr[0][(t0 >> 21) & 0x7f] | comp_maskr[1][(t0 >> 14) & 0x7f] | comp_maskr[2][(t0 >> 7) & 0x7f] | comp_maskr[3][t0 & 0x7f] | comp_maskr[4][(t1 >> 21) & 0x7f] | comp_maskr[5][(t1 >> 14) & 0x7f] | comp_maskr[6][(t1 >> 7) & 0x7f] | comp_maskr[7][t1 & 0x7f]; } return(0); } static int do_des( u_int32_t l_in, u_int32_t r_in, u_int32_t *l_out, u_int32_t *r_out, int count) { /* * l_in, r_in, l_out, and r_out are in pseudo-"big-endian" format. */ u_int32_t l, r, *kl, *kr, *kl1, *kr1; u_int32_t f, r48l, r48r; int round; if (count == 0) { return(1); } else if (count > 0) { /* * Encrypting */ kl1 = en_keysl; kr1 = en_keysr; } else { /* * Decrypting */ count = -count; kl1 = de_keysl; kr1 = de_keysr; } /* * Do initial permutation (IP). */ l = ip_maskl[0][l_in >> 24] | ip_maskl[1][(l_in >> 16) & 0xff] | ip_maskl[2][(l_in >> 8) & 0xff] | ip_maskl[3][l_in & 0xff] | ip_maskl[4][r_in >> 24] | ip_maskl[5][(r_in >> 16) & 0xff] | ip_maskl[6][(r_in >> 8) & 0xff] | ip_maskl[7][r_in & 0xff]; r = ip_maskr[0][l_in >> 24] | ip_maskr[1][(l_in >> 16) & 0xff] | ip_maskr[2][(l_in >> 8) & 0xff] | ip_maskr[3][l_in & 0xff] | ip_maskr[4][r_in >> 24] | ip_maskr[5][(r_in >> 16) & 0xff] | ip_maskr[6][(r_in >> 8) & 0xff] | ip_maskr[7][r_in & 0xff]; while (count--) { /* * Do each round. */ kl = kl1; kr = kr1; round = 16; while (round--) { /* * Expand R to 48 bits (simulate the E-box). */ r48l = ((r & 0x00000001) << 23) | ((r & 0xf8000000) >> 9) | ((r & 0x1f800000) >> 11) | ((r & 0x01f80000) >> 13) | ((r & 0x001f8000) >> 15); r48r = ((r & 0x0001f800) << 7) | ((r & 0x00001f80) << 5) | ((r & 0x000001f8) << 3) | ((r & 0x0000001f) << 1) | ((r & 0x80000000) >> 31); /* * Do salting for crypt() and friends, and * XOR with the permuted key. */ f = (r48l ^ r48r) & saltbits; r48l ^= f ^ *kl++; r48r ^= f ^ *kr++; /* * Do sbox lookups (which shrink it back to 32 bits) * and do the pbox permutation at the same time. */ f = psbox[0][m_sbox[0][r48l >> 12]] | psbox[1][m_sbox[1][r48l & 0xfff]] | psbox[2][m_sbox[2][r48r >> 12]] | psbox[3][m_sbox[3][r48r & 0xfff]]; /* * Now that we've permuted things, complete f(). */ f ^= l; l = r; r = f; } r = l; l = f; } /* * Do final permutation (inverse of IP). */ *l_out = fp_maskl[0][l >> 24] | fp_maskl[1][(l >> 16) & 0xff] | fp_maskl[2][(l >> 8) & 0xff] | fp_maskl[3][l & 0xff] | fp_maskl[4][r >> 24] | fp_maskl[5][(r >> 16) & 0xff] | fp_maskl[6][(r >> 8) & 0xff] | fp_maskl[7][r & 0xff]; *r_out = fp_maskr[0][l >> 24] | fp_maskr[1][(l >> 16) & 0xff] | fp_maskr[2][(l >> 8) & 0xff] | fp_maskr[3][l & 0xff] | fp_maskr[4][r >> 24] | fp_maskr[5][(r >> 16) & 0xff] | fp_maskr[6][(r >> 8) & 0xff] | fp_maskr[7][r & 0xff]; return(0); } static int des_cipher(const char *in, char *out, u_long salt, int count) { u_int32_t l_out, r_out, rawl, rawr; int retval; union { u_int32_t *ui32; const char *c; } trans; if (!des_initialised) des_init(); setup_salt(salt); trans.c = in; rawl = ntohl(*trans.ui32++); rawr = ntohl(*trans.ui32); retval = do_des(rawl, rawr, &l_out, &r_out, count); trans.c = out; *trans.ui32++ = htonl(l_out); *trans.ui32 = htonl(r_out); return(retval); } char * crypt_des(const char *key, const char *setting) { int i; u_int32_t count, salt, l, r0, r1, keybuf[2]; u_char *p, *q; static char output[21]; if (!des_initialised) des_init(); /* * Copy the key, shifting each character up by one bit * and padding with zeros. */ q = (u_char *)keybuf; while (q - (u_char *)keybuf - 8) { *q++ = *key << 1; if (*key != '\0') key++; } if (des_setkey((char *)keybuf)) return(NULL); if (*setting == _PASSWORD_EFMT1) { /* * "new"-style: * setting - underscore, 4 bytes of count, 4 bytes of salt * key - unlimited characters */ for (i = 1, count = 0L; i < 5; i++) count |= ascii_to_bin(setting[i]) << ((i - 1) * 6); for (i = 5, salt = 0L; i < 9; i++) salt |= ascii_to_bin(setting[i]) << ((i - 5) * 6); while (*key) { /* * Encrypt the key with itself. */ if (des_cipher((char *)keybuf, (char *)keybuf, 0L, 1)) return(NULL); /* * And XOR with the next 8 characters of the key. */ q = (u_char *)keybuf; while (q - (u_char *)keybuf - 8 && *key) *q++ ^= *key++ << 1; if (des_setkey((char *)keybuf)) return(NULL); } strncpy(output, setting, 9); /* * Double check that we weren't given a short setting. * If we were, the above code will probably have created * wierd values for count and salt, but we don't really care. * Just make sure the output string doesn't have an extra * NUL in it. */ output[9] = '\0'; p = (u_char *)output + strlen(output); } else { /* * "old"-style: * setting - 2 bytes of salt * key - up to 8 characters */ count = 25; salt = (ascii_to_bin(setting[1]) << 6) | ascii_to_bin(setting[0]); output[0] = setting[0]; /* * If the encrypted password that the salt was extracted from * is only 1 character long, the salt will be corrupted. We * need to ensure that the output string doesn't have an extra * NUL in it! */ output[1] = setting[1] ? setting[1] : output[0]; p = (u_char *)output + 2; } setup_salt(salt); /* * Do it. */ if (do_des(0L, 0L, &r0, &r1, (int)count)) return(NULL); /* * Now encode the result... */ l = (r0 >> 8); *p++ = ascii64[(l >> 18) & 0x3f]; *p++ = ascii64[(l >> 12) & 0x3f]; *p++ = ascii64[(l >> 6) & 0x3f]; *p++ = ascii64[l & 0x3f]; l = (r0 << 16) | ((r1 >> 16) & 0xffff); *p++ = ascii64[(l >> 18) & 0x3f]; *p++ = ascii64[(l >> 12) & 0x3f]; *p++ = ascii64[(l >> 6) & 0x3f]; *p++ = ascii64[l & 0x3f]; l = r1 << 2; *p++ = ascii64[(l >> 12) & 0x3f]; *p++ = ascii64[(l >> 6) & 0x3f]; *p++ = ascii64[l & 0x3f]; *p = 0; return(output); } /* END: https://github.com/freebsd/freebsd/blob/master/secure/lib/libcrypt/crypt-des.c */ /* START: https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/crypt-md5.c */ char * crypt_md5(const char *pw, const char *salt) { MD5_CTX ctx,ctx1; unsigned long l; int sl, pl; u_int i; u_char final[MD5_SIZE]; static const char *sp, *ep; static char passwd[120], *p; static const char *magic = "$1$"; /* Refine the Salt first */ sp = salt; /* If it starts with the magic string, then skip that */ if(!strncmp(sp, magic, strlen(magic))) sp += strlen(magic); /* It stops at the first '$', max 8 chars */ for(ep = sp; *ep && *ep != '$' && ep < (sp + 8); ep++) continue; /* get the length of the true salt */ sl = ep - sp; MD5Init(&ctx); /* The password first, since that is what is most unknown */ MD5Update(&ctx, (const u_char *)pw, strlen(pw)); /* Then our magic string */ MD5Update(&ctx, (const u_char *)magic, strlen(magic)); /* Then the raw salt */ MD5Update(&ctx, (const u_char *)sp, (u_int)sl); /* Then just as many characters of the MD5(pw,salt,pw) */ MD5Init(&ctx1); MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); MD5Update(&ctx1, (const u_char *)sp, (u_int)sl); MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); MD5Final(final, &ctx1); for(pl = (int)strlen(pw); pl > 0; pl -= MD5_SIZE) MD5Update(&ctx, (const u_char *)final, (u_int)(pl > MD5_SIZE ? MD5_SIZE : pl)); /* Don't leave anything around in vm they could use. */ memset(final, 0, sizeof(final)); /* Then something really weird... */ for (i = strlen(pw); i; i >>= 1) if(i & 1) MD5Update(&ctx, (const u_char *)final, 1); else MD5Update(&ctx, (const u_char *)pw, 1); /* Now make the output string */ strcpy(passwd, magic); strncat(passwd, sp, (u_int)sl); strcat(passwd, "$"); MD5Final(final, &ctx); /* * and now, just to make sure things don't run too fast * On a 60 Mhz Pentium this takes 34 msec, so you would * need 30 seconds to build a 1000 entry dictionary... */ for(i = 0; i < 1000; i++) { MD5Init(&ctx1); if(i & 1) MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); else MD5Update(&ctx1, (const u_char *)final, MD5_SIZE); if(i % 3) MD5Update(&ctx1, (const u_char *)sp, (u_int)sl); if(i % 7) MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); if(i & 1) MD5Update(&ctx1, (const u_char *)final, MD5_SIZE); else MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); MD5Final(final, &ctx1); } p = passwd + strlen(passwd); l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; _crypt_to64(p, l, 4); p += 4; l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; _crypt_to64(p, l, 4); p += 4; l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; _crypt_to64(p, l, 4); p += 4; l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; _crypt_to64(p, l, 4); p += 4; l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; _crypt_to64(p, l, 4); p += 4; l = final[11]; _crypt_to64(p, l, 2); p += 2; *p = '\0'; /* Don't leave anything around in vm they could use. */ memset(final, 0, sizeof(final)); return (passwd); } /* END: https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/crypt-md5.c */ /* START: https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/crypt-sha256.c */ static const char sha256_salt_prefix[] = "$5$"; /* Prefix for optional rounds specification. */ static const char sha256_rounds_prefix[] = "rounds="; /* Maximum salt string length. */ #define SALT_LEN_MAX 16 /* Default number of rounds if not explicitly specified. */ #define ROUNDS_DEFAULT 5000 /* Minimum number of rounds. */ #define ROUNDS_MIN 1000 /* Maximum number of rounds. */ #define ROUNDS_MAX 999999999 static char * crypt_sha256_r(const char *key, const char *salt, char *buffer, int buflen) { u_long srounds; int n; uint8_t alt_result[32], temp_result[32]; SHA256_CTX ctx, alt_ctx; size_t salt_len, key_len, cnt, rounds; char *cp, *copied_key, *copied_salt, *p_bytes, *s_bytes, *endp; const char *num; bool rounds_custom; copied_key = NULL; copied_salt = NULL; /* Default number of rounds. */ rounds = ROUNDS_DEFAULT; rounds_custom = false; /* Find beginning of salt string. The prefix should normally always * be present. Just in case it is not. */ if (strncmp(sha256_salt_prefix, salt, sizeof(sha256_salt_prefix) - 1) == 0) /* Skip salt prefix. */ salt += sizeof(sha256_salt_prefix) - 1; if (strncmp(salt, sha256_rounds_prefix, sizeof(sha256_rounds_prefix) - 1) == 0) { num = salt + sizeof(sha256_rounds_prefix) - 1; srounds = strtoul(num, &endp, 10); if (*endp == '$') { salt = endp + 1; rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX)); rounds_custom = true; } } salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX); key_len = strlen(key); /* Prepare for the real work. */ SHA256_Init(&ctx); /* Add the key string. */ SHA256_Update(&ctx, key, key_len); /* The last part is the salt string. This must be at most 8 * characters and it ends at the first `$' character (for * compatibility with existing implementations). */ SHA256_Update(&ctx, salt, salt_len); /* Compute alternate SHA256 sum with input KEY, SALT, and KEY. The * final result will be added to the first context. */ SHA256_Init(&alt_ctx); /* Add key. */ SHA256_Update(&alt_ctx, key, key_len); /* Add salt. */ SHA256_Update(&alt_ctx, salt, salt_len); /* Add key again. */ SHA256_Update(&alt_ctx, key, key_len); /* Now get result of this (32 bytes) and add it to the other context. */ SHA256_Final(alt_result, &alt_ctx); /* Add for any character in the key one byte of the alternate sum. */ for (cnt = key_len; cnt > 32; cnt -= 32) SHA256_Update(&ctx, alt_result, 32); SHA256_Update(&ctx, alt_result, cnt); /* Take the binary representation of the length of the key and for * every 1 add the alternate sum, for every 0 the key. */ for (cnt = key_len; cnt > 0; cnt >>= 1) if ((cnt & 1) != 0) SHA256_Update(&ctx, alt_result, 32); else SHA256_Update(&ctx, key, key_len); /* Create intermediate result. */ SHA256_Final(alt_result, &ctx); /* Start computation of P byte sequence. */ SHA256_Init(&alt_ctx); /* For every character in the password add the entire password. */ for (cnt = 0; cnt < key_len; ++cnt) SHA256_Update(&alt_ctx, key, key_len); /* Finish the digest. */ SHA256_Final(temp_result, &alt_ctx); /* Create byte sequence P. */ cp = p_bytes = alloca(key_len); for (cnt = key_len; cnt >= 32; cnt -= 32) { memcpy(cp, temp_result, 32); cp += 32; } memcpy(cp, temp_result, cnt); /* Start computation of S byte sequence. */ SHA256_Init(&alt_ctx); /* For every character in the password add the entire password. */ for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt) SHA256_Update(&alt_ctx, salt, salt_len); /* Finish the digest. */ SHA256_Final(temp_result, &alt_ctx); /* Create byte sequence S. */ cp = s_bytes = alloca(salt_len); for (cnt = salt_len; cnt >= 32; cnt -= 32) { memcpy(cp, temp_result, 32); cp += 32; } memcpy(cp, temp_result, cnt); /* Repeatedly run the collected hash value through SHA256 to burn CPU * cycles. */ for (cnt = 0; cnt < rounds; ++cnt) { /* New context. */ SHA256_Init(&ctx); /* Add key or last result. */ if ((cnt & 1) != 0) SHA256_Update(&ctx, p_bytes, key_len); else SHA256_Update(&ctx, alt_result, 32); /* Add salt for numbers not divisible by 3. */ if (cnt % 3 != 0) SHA256_Update(&ctx, s_bytes, salt_len); /* Add key for numbers not divisible by 7. */ if (cnt % 7 != 0) SHA256_Update(&ctx, p_bytes, key_len); /* Add key or last result. */ if ((cnt & 1) != 0) SHA256_Update(&ctx, alt_result, 32); else SHA256_Update(&ctx, p_bytes, key_len); /* Create intermediate result. */ SHA256_Final(alt_result, &ctx); } /* Now we can construct the result string. It consists of three * parts. */ cp = stpncpy(buffer, sha256_salt_prefix, MAX(0, buflen)); buflen -= sizeof(sha256_salt_prefix) - 1; if (rounds_custom) { n = snprintf(cp, MAX(0, buflen), "%s%zu$", sha256_rounds_prefix, rounds); cp += n; buflen -= n; } cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len)); buflen -= MIN((size_t)MAX(0, buflen), salt_len); if (buflen > 0) { *cp++ = '$'; --buflen; } b64_from_24bit(alt_result[0], alt_result[10], alt_result[20], 4, &buflen, &cp); b64_from_24bit(alt_result[21], alt_result[1], alt_result[11], 4, &buflen, &cp); b64_from_24bit(alt_result[12], alt_result[22], alt_result[2], 4, &buflen, &cp); b64_from_24bit(alt_result[3], alt_result[13], alt_result[23], 4, &buflen, &cp); b64_from_24bit(alt_result[24], alt_result[4], alt_result[14], 4, &buflen, &cp); b64_from_24bit(alt_result[15], alt_result[25], alt_result[5], 4, &buflen, &cp); b64_from_24bit(alt_result[6], alt_result[16], alt_result[26], 4, &buflen, &cp); b64_from_24bit(alt_result[27], alt_result[7], alt_result[17], 4, &buflen, &cp); b64_from_24bit(alt_result[18], alt_result[28], alt_result[8], 4, &buflen, &cp); b64_from_24bit(alt_result[9], alt_result[19], alt_result[29], 4, &buflen, &cp); b64_from_24bit(0, alt_result[31], alt_result[30], 3, &buflen, &cp); if (buflen <= 0) { errno = ERANGE; buffer = NULL; } else *cp = '\0'; /* Terminate the string. */ /* Clear the buffer for the intermediate result so that people * attaching to processes or reading core dumps cannot get any * information. We do it in this way to clear correct_words[] inside * the SHA256 implementation as well. */ SHA256_Init(&ctx); SHA256_Final(alt_result, &ctx); memset(temp_result, '\0', sizeof(temp_result)); memset(p_bytes, '\0', key_len); memset(s_bytes, '\0', salt_len); memset(&ctx, '\0', sizeof(ctx)); memset(&alt_ctx, '\0', sizeof(alt_ctx)); if (copied_key != NULL) memset(copied_key, '\0', key_len); if (copied_salt != NULL) memset(copied_salt, '\0', salt_len); return buffer; } /* This entry point is equivalent to crypt(3). */ char* crypt_sha256(const char *key, const char *salt) { /* We don't want to have an arbitrary limit in the size of the * password. We can compute an upper bound for the size of the * result in advance and so we can prepare the buffer we pass to * `crypt_sha256_r'. */ static char *buffer; static int buflen; int needed; char *new_buffer; needed = (sizeof(sha256_salt_prefix) - 1 + sizeof(sha256_rounds_prefix) + 9 + 1 + strlen(salt) + 1 + 43 + 1); if (buflen < needed) { new_buffer = (char *)realloc(buffer, needed); if (new_buffer == NULL) return NULL; buffer = new_buffer; buflen = needed; } return crypt_sha256_r(key, salt, buffer, buflen); } /* END: https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/crypt-sha256.c */ /* START: https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/crypt-sha512.c */ /* Define our magic string to mark salt for SHA512 "encryption" replacement. */ static const char sha512_salt_prefix[] = "$6$"; /* Prefix for optional rounds specification. */ static const char sha512_rounds_prefix[] = "rounds="; /* Maximum salt string length. */ #define SALT_LEN_MAX 16 /* Default number of rounds if not explicitly specified. */ #define ROUNDS_DEFAULT 5000 /* Minimum number of rounds. */ #define ROUNDS_MIN 1000 /* Maximum number of rounds. */ #define ROUNDS_MAX 999999999 static char * crypt_sha512_r(const char *key, const char *salt, char *buffer, int buflen) { u_long srounds; int n; uint8_t alt_result[64], temp_result[64]; SHA512_CTX ctx, alt_ctx; size_t salt_len, key_len, cnt, rounds; char *cp, *copied_key, *copied_salt, *p_bytes, *s_bytes, *endp; const char *num; bool rounds_custom; copied_key = NULL; copied_salt = NULL; /* Default number of rounds. */ rounds = ROUNDS_DEFAULT; rounds_custom = false; /* Find beginning of salt string. The prefix should normally always * be present. Just in case it is not. */ if (strncmp(sha512_salt_prefix, salt, sizeof(sha512_salt_prefix) - 1) == 0) /* Skip salt prefix. */ salt += sizeof(sha512_salt_prefix) - 1; if (strncmp(salt, sha512_rounds_prefix, sizeof(sha512_rounds_prefix) - 1) == 0) { num = salt + sizeof(sha512_rounds_prefix) - 1; srounds = strtoul(num, &endp, 10); if (*endp == '$') { salt = endp + 1; rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX)); rounds_custom = true; } } salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX); key_len = strlen(key); /* Prepare for the real work. */ SHA512_Init(&ctx); /* Add the key string. */ SHA512_Update(&ctx, key, key_len); /* The last part is the salt string. This must be at most 8 * characters and it ends at the first `$' character (for * compatibility with existing implementations). */ SHA512_Update(&ctx, salt, salt_len); /* Compute alternate SHA512 sum with input KEY, SALT, and KEY. The * final result will be added to the first context. */ SHA512_Init(&alt_ctx); /* Add key. */ SHA512_Update(&alt_ctx, key, key_len); /* Add salt. */ SHA512_Update(&alt_ctx, salt, salt_len); /* Add key again. */ SHA512_Update(&alt_ctx, key, key_len); /* Now get result of this (64 bytes) and add it to the other context. */ SHA512_Final(alt_result, &alt_ctx); /* Add for any character in the key one byte of the alternate sum. */ for (cnt = key_len; cnt > 64; cnt -= 64) SHA512_Update(&ctx, alt_result, 64); SHA512_Update(&ctx, alt_result, cnt); /* Take the binary representation of the length of the key and for * every 1 add the alternate sum, for every 0 the key. */ for (cnt = key_len; cnt > 0; cnt >>= 1) if ((cnt & 1) != 0) SHA512_Update(&ctx, alt_result, 64); else SHA512_Update(&ctx, key, key_len); /* Create intermediate result. */ SHA512_Final(alt_result, &ctx); /* Start computation of P byte sequence. */ SHA512_Init(&alt_ctx); /* For every character in the password add the entire password. */ for (cnt = 0; cnt < key_len; ++cnt) SHA512_Update(&alt_ctx, key, key_len); /* Finish the digest. */ SHA512_Final(temp_result, &alt_ctx); /* Create byte sequence P. */ cp = p_bytes = alloca(key_len); for (cnt = key_len; cnt >= 64; cnt -= 64) { memcpy(cp, temp_result, 64); cp += 64; } memcpy(cp, temp_result, cnt); /* Start computation of S byte sequence. */ SHA512_Init(&alt_ctx); /* For every character in the password add the entire password. */ for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt) SHA512_Update(&alt_ctx, salt, salt_len); /* Finish the digest. */ SHA512_Final(temp_result, &alt_ctx); /* Create byte sequence S. */ cp = s_bytes = alloca(salt_len); for (cnt = salt_len; cnt >= 64; cnt -= 64) { memcpy(cp, temp_result, 64); cp += 64; } memcpy(cp, temp_result, cnt); /* Repeatedly run the collected hash value through SHA512 to burn CPU * cycles. */ for (cnt = 0; cnt < rounds; ++cnt) { /* New context. */ SHA512_Init(&ctx); /* Add key or last result. */ if ((cnt & 1) != 0) SHA512_Update(&ctx, p_bytes, key_len); else SHA512_Update(&ctx, alt_result, 64); /* Add salt for numbers not divisible by 3. */ if (cnt % 3 != 0) SHA512_Update(&ctx, s_bytes, salt_len); /* Add key for numbers not divisible by 7. */ if (cnt % 7 != 0) SHA512_Update(&ctx, p_bytes, key_len); /* Add key or last result. */ if ((cnt & 1) != 0) SHA512_Update(&ctx, alt_result, 64); else SHA512_Update(&ctx, p_bytes, key_len); /* Create intermediate result. */ SHA512_Final(alt_result, &ctx); } /* Now we can construct the result string. It consists of three * parts. */ cp = stpncpy(buffer, sha512_salt_prefix, MAX(0, buflen)); buflen -= sizeof(sha512_salt_prefix) - 1; if (rounds_custom) { n = snprintf(cp, MAX(0, buflen), "%s%zu$", sha512_rounds_prefix, rounds); cp += n; buflen -= n; } cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len)); buflen -= MIN((size_t)MAX(0, buflen), salt_len); if (buflen > 0) { *cp++ = '$'; --buflen; } b64_from_24bit(alt_result[0], alt_result[21], alt_result[42], 4, &buflen, &cp); b64_from_24bit(alt_result[22], alt_result[43], alt_result[1], 4, &buflen, &cp); b64_from_24bit(alt_result[44], alt_result[2], alt_result[23], 4, &buflen, &cp); b64_from_24bit(alt_result[3], alt_result[24], alt_result[45], 4, &buflen, &cp); b64_from_24bit(alt_result[25], alt_result[46], alt_result[4], 4, &buflen, &cp); b64_from_24bit(alt_result[47], alt_result[5], alt_result[26], 4, &buflen, &cp); b64_from_24bit(alt_result[6], alt_result[27], alt_result[48], 4, &buflen, &cp); b64_from_24bit(alt_result[28], alt_result[49], alt_result[7], 4, &buflen, &cp); b64_from_24bit(alt_result[50], alt_result[8], alt_result[29], 4, &buflen, &cp); b64_from_24bit(alt_result[9], alt_result[30], alt_result[51], 4, &buflen, &cp); b64_from_24bit(alt_result[31], alt_result[52], alt_result[10], 4, &buflen, &cp); b64_from_24bit(alt_result[53], alt_result[11], alt_result[32], 4, &buflen, &cp); b64_from_24bit(alt_result[12], alt_result[33], alt_result[54], 4, &buflen, &cp); b64_from_24bit(alt_result[34], alt_result[55], alt_result[13], 4, &buflen, &cp); b64_from_24bit(alt_result[56], alt_result[14], alt_result[35], 4, &buflen, &cp); b64_from_24bit(alt_result[15], alt_result[36], alt_result[57], 4, &buflen, &cp); b64_from_24bit(alt_result[37], alt_result[58], alt_result[16], 4, &buflen, &cp); b64_from_24bit(alt_result[59], alt_result[17], alt_result[38], 4, &buflen, &cp); b64_from_24bit(alt_result[18], alt_result[39], alt_result[60], 4, &buflen, &cp); b64_from_24bit(alt_result[40], alt_result[61], alt_result[19], 4, &buflen, &cp); b64_from_24bit(alt_result[62], alt_result[20], alt_result[41], 4, &buflen, &cp); b64_from_24bit(0, 0, alt_result[63], 2, &buflen, &cp); if (buflen <= 0) { errno = ERANGE; buffer = NULL; } else *cp = '\0'; /* Terminate the string. */ /* Clear the buffer for the intermediate result so that people * attaching to processes or reading core dumps cannot get any * information. We do it in this way to clear correct_words[] inside * the SHA512 implementation as well. */ SHA512_Init(&ctx); SHA512_Final(alt_result, &ctx); memset(temp_result, '\0', sizeof(temp_result)); memset(p_bytes, '\0', key_len); memset(s_bytes, '\0', salt_len); memset(&ctx, '\0', sizeof(ctx)); memset(&alt_ctx, '\0', sizeof(alt_ctx)); if (copied_key != NULL) memset(copied_key, '\0', key_len); if (copied_salt != NULL) memset(copied_salt, '\0', salt_len); return buffer; } /* This entry point is equivalent to crypt(3). */ char * crypt_sha512(const char *key, const char *salt) { /* We don't want to have an arbitrary limit in the size of the * password. We can compute an upper bound for the size of the * result in advance and so we can prepare the buffer we pass to * `crypt_sha512_r'. */ static char *buffer; static int buflen; int needed; char *new_buffer; needed = (sizeof(sha512_salt_prefix) - 1 + sizeof(sha512_rounds_prefix) + 9 + 1 + strlen(salt) + 1 + 86 + 1); if (buflen < needed) { new_buffer = (char *)realloc(buffer, needed); if (new_buffer == NULL) return NULL; buffer = new_buffer; buflen = needed; } return crypt_sha512_r(key, salt, buffer, buflen); } /* END: https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/crypt-sha512.c */ /** From https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/crypt.c */ static const struct crypt_format { const char* const name; const char* const magic; char* (*const func)(char const*, char const*); } crypt_formats[] = { { "des", "_", crypt_des }, { "md5", "$1$", crypt_md5 }, { "sha256", "$5$", crypt_sha256 }, { "sha512", "$6$", crypt_sha512 }, { NULL, NULL, NULL } }; char* crypt(const char* key, const char* salt) { size_t len; const struct crypt_format *cf; for (cf = crypt_formats; cf->name != NULL; ++cf) { if (cf->magic != NULL && strstr(salt, cf->magic) == salt) { return cf->func(key, salt); } } len = strlen(salt); if ((len == 13 || len == 2) && strspn(salt, DES_SALT_ALPHABET) == len) { return (crypt_des(key, salt)); } return crypt_formats[0].func(key, salt); } ================================================ FILE: packages/libcue/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/lipnitsk/libcue/ TERMUX_PKG_DESCRIPTION="CUE Sheet Parser Library" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=2.2.1 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=f27bc3ebb2e892cd9d32a7bee6d84576a60f955f29f748b9b487b173712f1200 TERMUX_PKG_BREAKS="libcue-dev" TERMUX_PKG_REPLACES="libcue-dev" TERMUX_PKG_SRCURL=https://github.com/lipnitsk/libcue/archive/v${TERMUX_PKG_VERSION}.tar.gz # To avoid picking up cross-compiled flex and bison: TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DBISON_EXECUTABLE=$(which bison) -DFLEX_EXECUTABLE=$(which flex) -DBUILD_SHARED_LIBS=ON " ================================================ FILE: packages/libcurl/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://curl.haxx.se/ TERMUX_PKG_DESCRIPTION="Easy-to-use client-side URL transfer library" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=7.67.0 TERMUX_PKG_SRCURL=https://curl.haxx.se/download/curl-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SHA256=dd5f6956821a548bf4b44f067a530ce9445cc8094fd3e7e3fc7854815858586c TERMUX_PKG_DEPENDS="libnghttp2, openssl (>= 1.1.1), zlib" TERMUX_PKG_BREAKS="libcurl-dev" TERMUX_PKG_REPLACES="libcurl-dev" TERMUX_PKG_ESSENTIAL=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --enable-ntlm-wb=$TERMUX_PREFIX/bin/ntlm_auth --with-ca-bundle=$TERMUX_PREFIX/etc/tls/cert.pem --with-ca-path=$TERMUX_PREFIX/etc/tls/certs --with-nghttp2 --without-libidn --without-libidn2 --without-librtmp --without-brotli --with-ssl " # Starting with version 7.62 curl started enabling http/2 by default. # Support for http/2 as added in version 1.4.8-8 of the apt package, so we # conflict with previous versions to avoid broken installations. TERMUX_PKG_CONFLICTS="apt (<< 1.4.8-8)" ================================================ FILE: packages/libcurl/curl.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="bin/curl share/man/man1/curl.1.gz" TERMUX_SUBPKG_DESCRIPTION="Command line tool for transferring data with URL syntax" TERMUX_SUBPKG_ESSENTIAL=true ================================================ FILE: packages/libdav1d/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://code.videolan.org/videolan/dav1d/ TERMUX_PKG_DESCRIPTION="AV1 cross-platform decoder focused on speed and correctness" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_VERSION=0.4.0 TERMUX_PKG_SRCURL=https://downloads.videolan.org/pub/videolan/dav1d/${TERMUX_PKG_VERSION}/dav1d-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=2553b2e65081c0ec799c11a752ea43ad8f2d11b2fb36a83375972d1a00add823 TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -Denable_asm=false -Denable_tools=false -Denable_tests=false " ================================================ FILE: packages/libdb/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.oracle.com/database/berkeley-db TERMUX_PKG_DESCRIPTION="The Berkeley DB embedded database system (library)" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas" TERMUX_PKG_VERSION=18.1.32 TERMUX_PKG_REVISION=3 TERMUX_PKG_SHA256=fa1fe7de9ba91ad472c25d026f931802597c29f28ae951960685cde487c8d654 TERMUX_PKG_BREAKS="libdb-dev" TERMUX_PKG_REPLACES="libdb-dev" TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/db-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --enable-hash --enable-smallbuild --enable-compat185 db_cv_atomic=gcc-builtin --enable-cxx " TERMUX_PKG_RM_AFTER_INSTALL="docs" termux_step_pre_configure() { TERMUX_PKG_SRCDIR=$TERMUX_PKG_SRCDIR/dist } ================================================ FILE: packages/libdb/db.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="bin/" TERMUX_SUBPKG_DESCRIPTION="The Berkeley DB embedded database system" ================================================ FILE: packages/libdb/fix-tmpdir.patch ================================================ diff -uNr db-6.2.32/src/os/os_tmpdir.c db-6.2.32.mod/src/os/os_tmpdir.c --- db-6.2.32/src/os/os_tmpdir.c 2017-04-13 17:06:21.000000000 +0300 +++ db-6.2.32.mod/src/os/os_tmpdir.c 2019-03-02 02:06:03.557665103 +0200 @@ -125,9 +125,9 @@ DB_TEMP_DIRECTORY("C:/temp"); DB_TEMP_DIRECTORY("C:/tmp"); #else - DB_TEMP_DIRECTORY("/var/tmp"); - DB_TEMP_DIRECTORY("/usr/tmp"); - DB_TEMP_DIRECTORY("/tmp"); + DB_TEMP_DIRECTORY("@TERMUX_PREFIX@/var/tmp"); + DB_TEMP_DIRECTORY("@TERMUX_PREFIX@/usr/tmp"); + DB_TEMP_DIRECTORY("@TERMUX_PREFIX@/tmp"); #if defined(ANDROID) || defined(DB_ANDROID) DB_TEMP_DIRECTORY("/cache"); #endif ================================================ FILE: packages/libdb/lang-sql-generated-sqlite3.c.patch ================================================ diff -u -r ../db-18.1.32/lang/sql/generated/sqlite3.c ./lang/sql/generated/sqlite3.c --- ../db-18.1.32/lang/sql/generated/sqlite3.c 2019-02-19 21:51:18.000000000 +0000 +++ ./lang/sql/generated/sqlite3.c 2019-04-13 07:40:01.383960498 +0000 @@ -35380,9 +35380,7 @@ static const char *azDirs[] = { 0, 0, - "/var/tmp", - "/usr/tmp", - "/tmp", + "@TERMUX_PREFIX@/tmp", "." }; unsigned int i = 0; ================================================ FILE: packages/libdb/lang-sql-sqlite-src-os_unix.c.patch ================================================ diff -u -r ../db-18.1.32/lang/sql/sqlite/src/os_unix.c ./lang/sql/sqlite/src/os_unix.c --- ../db-18.1.32/lang/sql/sqlite/src/os_unix.c 2019-02-19 21:51:18.000000000 +0000 +++ ./lang/sql/sqlite/src/os_unix.c 2019-04-13 07:37:00.461881967 +0000 @@ -5421,9 +5421,7 @@ static const char *azDirs[] = { 0, 0, - "/var/tmp", - "/usr/tmp", - "/tmp", + "@TERMUX_PREFIX@/tmp", "." }; unsigned int i = 0; ================================================ FILE: packages/libdispatch/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/apple/swift-corelibs-libdspatch TERMUX_PKG_DESCRIPTION="The libdispatch project, for concurrency on multicore hardware" TERMUX_PKG_LICENSE="Apache-2.0" _VERSION=5.1 TERMUX_PKG_VERSION=1:${_VERSION} TERMUX_PKG_SRCURL=https://github.com/apple/swift-corelibs-libdispatch/archive/swift-${_VERSION}-RELEASE.tar.gz TERMUX_PKG_SHA256=da24d299eecc10e7d4b40a24e0700ca2f73da622795ecf6f4a5da4d33c486662 TERMUX_PKG_DEPENDS="libc++" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-DENABLE_TESTING=OFF" ================================================ FILE: packages/libdispatch/src-CMakeLists.txt.patch ================================================ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2809c11..368d428 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -246,6 +246,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL Darwin) "-Xlinker -alias_list -Xlinker ${PROJECT_SOURCE_DIR}/xcodeconfig/libdispatch.aliases") endif() dispatch_set_linker(dispatch) +if(CMAKE_SYSTEM_NAME STREQUAL Android) + set_property(TARGET dispatch APPEND PROPERTY LINK_LIBRARIES "log") +endif() install(TARGETS dispatch ================================================ FILE: packages/libduktape/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.duktape.org/ TERMUX_PKG_DESCRIPTION="An embeddable Javascript engine with a focus on portability and compact footprint" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=2.4.0 TERMUX_PKG_REPLACES="duktape (<< 2.3.0-1), libduktape-dev" TERMUX_PKG_BREAKS="duktape (<< 2.3.0-1), libduktape-dev" TERMUX_PKG_BUILD_IN_SRC=true termux_step_extract_package() { git clone --depth=1 https://github.com/svaarala/duktape.git -b v${TERMUX_PKG_VERSION} ${TERMUX_PKG_SRCDIR} } termux_step_pre_configure() { if $TERMUX_ON_DEVICE_BUILD; then # configure.py requires 'yaml' python2 module. if ! pip2 show pyyaml > /dev/null 2>&1; then pip2 install pyyaml fi fi } termux_step_make() { make libduktape.so.1.0.0 duk CC=${CC} GXX=${CXX} } termux_step_make_install() { install libduktape.so.1.0.0 ${TERMUX_PREFIX}/lib/libduktape.so install duk ${TERMUX_PREFIX}/bin install prep/nondebug/*.h ${TERMUX_PREFIX}/include } termux_step_post_make_install() { # Add a pkg-config file for the duktape lib cat > "$PKG_CONFIG_LIBDIR/duktape.pc" <<-HERE Name: Duktape Description: Shared library for the Duktape interpreter Version: $TERMUX_PKG_VERSION Requires: Libs: -lduktape -lm HERE } ================================================ FILE: packages/libduktape/duktape.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="bin/" TERMUX_SUBPKG_DESCRIPTION="Simple REPL for Duktape" ================================================ FILE: packages/libedit/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://thrysoee.dk/editline/ TERMUX_PKG_DESCRIPTION="Library providing line editing, history, and tokenization functions" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=20191025-3.1 TERMUX_PKG_SHA256=6dff036660d478bfaa14e407fc5de26d22da1087118c897b1a3ad2e90cb7bf39 TERMUX_PKG_SRCURL=https://thrysoee.dk/editline/libedit-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="libandroid-support, ncurses" TERMUX_PKG_BREAKS="libedit-dev" TERMUX_PKG_REPLACES="libedit-dev" TERMUX_PKG_RM_AFTER_INSTALL="share/man/man7/editline.7 share/man/man3/history.3" termux_step_pre_configure() { CFLAGS+=" -D__STDC_ISO_10646__=201103L -DNBBY=CHAR_BIT" } ================================================ FILE: packages/libedit/src-readline.c.patch ================================================ diff -uNr libedit-20170329-3.1/src/readline.c libedit-20170329-3.1.mod/src/readline.c --- libedit-20170329-3.1/src/readline.c 2017-03-29 21:15:04.000000000 +0300 +++ libedit-20170329-3.1.mod/src/readline.c 2018-06-19 17:16:05.344389818 +0300 @@ -1198,7 +1198,7 @@ return max_input_history != INT_MAX; } -static const char _history_tmp_template[] = "/tmp/.historyXXXXXX"; +static const char _history_tmp_template[] = "@TERMUX_PREFIX@/tmp/.historyXXXXXX"; int history_truncate_file (const char *filename, int nlines) @@ -1772,6 +1772,9 @@ char * username_completion_function(const char *text, int state) { +#ifdef __ANDROID__ + return NULL; +#else struct passwd *pass = NULL; if (text[0] == '\0') @@ -1794,6 +1797,7 @@ return NULL; } return strdup(pass->pw_name); +#endif } ================================================ FILE: packages/libedit/src-vi.c.patch ================================================ diff -uNr libedit-20170329-3.1/src/vi.c libedit-20170329-3.1.mod/src/vi.c --- libedit-20170329-3.1/src/vi.c 2017-03-29 21:08:21.000000000 +0300 +++ libedit-20170329-3.1.mod/src/vi.c 2018-06-19 17:16:24.144390787 +0300 @@ -1004,7 +1004,7 @@ pid_t pid; ssize_t st; int status; - char tempfile[] = "/tmp/histedit.XXXXXXXXXX"; + char tempfile[] = "@TERMUX_PREFIX@/tmp/histedit.XXXXXXXXXX"; char *cp = NULL; size_t len; wchar_t *line = NULL; ================================================ FILE: packages/libelf/aligned_alloc.c ================================================ /***************************************************************************** * aligned_alloc.c: C11 aligned_alloc() replacement ***************************************************************************** * Copyright © 2012, 2017 Rémi Denis-Courmont * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #if !defined (HAVE_POSIX_MEMALIGN) # include #endif void *aligned_alloc(size_t align, size_t size) { /* align must be a power of 2 */ /* size must be a multiple of align */ if ((align & (align - 1)) || (size & (align - 1))) { errno = EINVAL; return NULL; } #ifdef __ANDROID__ if (align < sizeof (void *)) /* POSIX does not allow small alignment */ align = sizeof (void *); void *ptr; int err = posix_memalign(&ptr, align, size); if (err) { errno = err; ptr = NULL; } return ptr; #elif defined(HAVE_MEMALIGN) return memalign(align, size); #elif defined (_WIN32) && defined(__MINGW32__) return __mingw_aligned_malloc(size, align); #elif defined (_WIN32) && defined(_MSC_VER) return _aligned_malloc(size, align); #else #warning unsupported aligned allocation! if (size > 0) errno = ENOMEM; return NULL; #endif } ================================================ FILE: packages/libelf/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://sourceware.org/elfutils/ TERMUX_PKG_DESCRIPTION="ELF object file access library" TERMUX_PKG_LICENSE="GPL-2.0" # NOTE: We only build the libelf part of elfutils for now, # as other parts are not clang compatible. TERMUX_PKG_VERSION=0.177 TERMUX_PKG_SHA256=fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc05042e TERMUX_PKG_SRCURL=ftp://sourceware.org/pub/elfutils/${TERMUX_PKG_VERSION}/elfutils-${TERMUX_PKG_VERSION}.tar.bz2 # libandroid-support for langinfo. TERMUX_PKG_DEPENDS="libandroid-support, zlib" TERMUX_PKG_BUILD_DEPENDS="argp" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_c99=yes --disable-symbol-versioning" TERMUX_PKG_CONFLICTS="elfutils, libelf-dev" TERMUX_PKG_REPLACES="elfutils, libelf-dev" termux_step_pre_configure() { CFLAGS+=" -Wno-error=unused-value -Wno-error=format-nonliteral -Wno-error" # Exposes ACCESSPERMS in which elfutils uses: CFLAGS+=" -D__USE_BSD" CFLAGS+=" -DFNM_EXTMATCH=0" if [ "$TERMUX_ARCH" = "arm" ]; then CFLAGS="${CFLAGS/-Oz/-O1}" fi cp $TERMUX_PKG_BUILDER_DIR/error.h . cp $TERMUX_PKG_BUILDER_DIR/stdio_ext.h . cp $TERMUX_PKG_BUILDER_DIR/obstack.h . cp $TERMUX_PKG_BUILDER_DIR/qsort_r.h . cp $TERMUX_PKG_BUILDER_DIR/aligned_alloc.c libelf autoreconf -if } termux_step_make() { make -j $TERMUX_MAKE_PROCESSES -C lib make -j $TERMUX_MAKE_PROCESSES -C libelf } termux_step_make_install() { make -j $TERMUX_MAKE_PROCESSES -C libelf install } ================================================ FILE: packages/libelf/dwfl_error.c.patch ================================================ diff -u -r ../elfutils-0.166/libdwfl/dwfl_error.c ./libdwfl/dwfl_error.c --- ../elfutils-0.166/libdwfl/dwfl_error.c 2015-11-27 08:36:29.000000000 -0500 +++ ./libdwfl/dwfl_error.c 2016-05-04 13:15:42.522820139 -0400 @@ -140,6 +140,7 @@ const char * dwfl_errmsg (int error) { + char* error_msg; if (error == 0 || error == -1) { int last_error = global_error; @@ -154,7 +155,9 @@ switch (error &~ 0xffff) { case OTHER_ERROR (ERRNO): - return strerror_r (error & 0xffff, "bad", 0); + error_msg = malloc(256); + strerror_r (error & 0xffff, error_msg, 256); + return error_msg; case OTHER_ERROR (LIBELF): return elf_errmsg (error & 0xffff); case OTHER_ERROR (LIBDW): ================================================ FILE: packages/libelf/elf_getarsym.c.patch ================================================ diff -u -r ../elfutils-0.159/libelf/elf_getarsym.c ./libelf/elf_getarsym.c --- ../elfutils-0.159/libelf/elf_getarsym.c 2014-05-18 16:32:15.000000000 +0200 +++ ./libelf/elf_getarsym.c 2014-05-30 14:53:58.602211085 +0200 @@ -45,6 +45,124 @@ #include #include "libelfP.h" +#ifdef __ANDROID__ +/* Find the first occurrence of C in S. */ +void * +rawmemchr (const void *s, int c_in) +{ + /* On 32-bit hardware, choosing longword to be a 32-bit unsigned + long instead of a 64-bit uintmax_t tends to give better + performance. On 64-bit hardware, unsigned long is generally 64 + bits already. Change this typedef to experiment with + performance. */ + typedef unsigned long int longword; + + const unsigned char *char_ptr; + const longword *longword_ptr; + longword repeated_one; + longword repeated_c; + unsigned char c; + + c = (unsigned char) c_in; + + /* Handle the first few bytes by reading one byte at a time. + Do this until CHAR_PTR is aligned on a longword boundary. */ + for (char_ptr = (const unsigned char *) s; + (size_t) char_ptr % sizeof (longword) != 0; + ++char_ptr) + if (*char_ptr == c) + return (void *) char_ptr; + + longword_ptr = (const longword *) char_ptr; + + /* All these elucidatory comments refer to 4-byte longwords, + but the theory applies equally well to any size longwords. */ + + /* Compute auxiliary longword values: + repeated_one is a value which has a 1 in every byte. + repeated_c has c in every byte. */ + repeated_one = 0x01010101; + repeated_c = c | (c << 8); + repeated_c |= repeated_c << 16; + if (0xffffffffU < (longword) -1) + { + repeated_one |= repeated_one << 31 << 1; + repeated_c |= repeated_c << 31 << 1; + if (8 < sizeof (longword)) + { + size_t i; + + for (i = 64; i < sizeof (longword) * 8; i *= 2) + { + repeated_one |= repeated_one << i; + repeated_c |= repeated_c << i; + } + } + } + + /* Instead of the traditional loop which tests each byte, we will + test a longword at a time. The tricky part is testing if *any of + the four* bytes in the longword in question are equal to NUL or + c. We first use an xor with repeated_c. This reduces the task + to testing whether *any of the four* bytes in longword1 is zero. + + We compute tmp = + ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7). + That is, we perform the following operations: + 1. Subtract repeated_one. + 2. & ~longword1. + 3. & a mask consisting of 0x80 in every byte. + Consider what happens in each byte: + - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff, + and step 3 transforms it into 0x80. A carry can also be propagated + to more significant bytes. + - If a byte of longword1 is nonzero, let its lowest 1 bit be at + position k (0 <= k <= 7); so the lowest k bits are 0. After step 1, + the byte ends in a single bit of value 0 and k bits of value 1. + After step 2, the result is just k bits of value 1: 2^k - 1. After + step 3, the result is 0. And no carry is produced. + So, if longword1 has only non-zero bytes, tmp is zero. + Whereas if longword1 has a zero byte, call j the position of the least + significant zero byte. Then the result has a zero at positions 0, ..., + j-1 and a 0x80 at position j. We cannot predict the result at the more + significant bytes (positions j+1..3), but it does not matter since we + already have a non-zero bit at position 8*j+7. + + The test whether any byte in longword1 is zero is equivalent + to testing whether tmp is nonzero. + + This test can read beyond the end of a string, depending on where + C_IN is encountered. However, this is considered safe since the + initialization phase ensured that the read will be aligned, + therefore, the read will not cross page boundaries and will not + cause a fault. */ + + while (1) + { + longword longword1 = *longword_ptr ^ repeated_c; + + if ((((longword1 - repeated_one) & ~longword1) + & (repeated_one << 7)) != 0) + break; + longword_ptr++; + } + + char_ptr = (const unsigned char *) longword_ptr; + + /* At this point, we know that one of the sizeof (longword) bytes + starting at char_ptr is == c. On little-endian machines, we + could determine the first such byte without any further memory + accesses, just by looking at the tmp result from the last loop + iteration. But this does not work on big-endian machines. + Choose code that works in both cases. */ + + char_ptr = (unsigned char *) longword_ptr; + while (*char_ptr != c) + char_ptr++; + return (void *) char_ptr; +} +#endif + static int read_number_entries (uint64_t *nump, Elf *elf, size_t *offp, bool index64_p) ================================================ FILE: packages/libelf/elf_update.c.patch ================================================ diff -u -r ../elfutils-0.166/libelf/elf_update.c ./libelf/elf_update.c --- ../elfutils-0.166/libelf/elf_update.c 2015-11-27 08:36:29.000000000 -0500 +++ ./libelf/elf_update.c 2016-05-04 13:06:15.836140729 -0400 @@ -39,6 +39,7 @@ #include "libelfP.h" +#define off_t loff_t static off_t write_file (Elf *elf, off_t size, int change_bo, size_t shnum) ================================================ FILE: packages/libelf/error.h ================================================ #include #include #include /* program_invocation_short_name GNU extension - http://linux.die.net/man/3/program_invocation_short_name */ extern char* __progname; #define program_invocation_short_name __progname /* error(3) GNU extension - http://man7.org/linux/man-pages/man3/error.3.html */ unsigned int error_message_count; static inline void error(int status, int errnum, const char* format, ...) { error_message_count++; va_list myargs; va_start(myargs, format); vfprintf(stderr, format, myargs); va_end(myargs); exit(status); } /* strchrnul(3) GNU extension - http://man7.org/linux/man-pages/man3/strchr.3.html */ static inline char* strchrnul(char const* s, int c) { char* result = strchr(s, c); return (result == NULL) ? (char*)(s + strlen(s)) : result; } ================================================ FILE: packages/libelf/lib-color.c.patch ================================================ diff -uNr elfutils-0.177/lib/color.c elfutils-0.177.mod/lib/color.c --- elfutils-0.177/lib/color.c 2019-08-14 13:12:33.000000000 +0300 +++ elfutils-0.177.mod/lib/color.c 2019-09-18 16:23:09.802519067 +0300 @@ -40,6 +40,8 @@ #include "libeu.h" #include "color.h" +extern char* __progname; + /* Prototype for option handler. */ static error_t parse_opt (int key, char *arg, struct argp_state *state); @@ -130,9 +132,9 @@ - 'always', 'yes', 'force'\n\ - 'never', 'no', 'none'\n\ - 'auto', 'tty', 'if-tty'\n"), - program_invocation_short_name, arg); + __progname, arg); argp_help (&color_argp, stderr, ARGP_HELP_SEE, - (char *) program_invocation_short_name); + __progname); exit (EXIT_FAILURE); } } ================================================ FILE: packages/libelf/libdwflP.h.patch ================================================ diff -u -r ../elfutils-0.166/libdwfl/libdwflP.h ./libdwfl/libdwflP.h --- ../elfutils-0.166/libdwfl/libdwflP.h 2016-01-12 07:49:19.000000000 -0500 +++ ./libdwfl/libdwflP.h 2016-05-04 13:21:07.997599838 -0400 @@ -771,5 +771,10 @@ /* The default used by dwfl_standard_find_debuginfo. */ #define DEFAULT_DEBUGINFO_PATH ":.debug:/usr/lib/debug" + /* canonicalize_file_name GNU extension - http://man7.org/linux/man-pages/man3/canonicalize_file_name.3.html */ +inline static char* canonicalize_file_name(const char *path) +{ + return realpath(path, NULL); +} #endif /* libdwflP.h */ ================================================ FILE: packages/libelf/libelfmakefile.am.patch ================================================ --- ./libelf/Makefile.am.orig 2019-05-29 05:19:01.983292465 +0000 +++ ./libelf/Makefile.am 2019-05-29 05:19:19.759573256 +0000 @@ -62,7 +62,7 @@ gelf_update_ehdr.c \ elf32_getphdr.c elf64_getphdr.c gelf_getphdr.c \ elf32_newphdr.c elf64_newphdr.c gelf_newphdr.c \ - gelf_update_phdr.c \ + gelf_update_phdr.c aligned_alloc.c \ elf_getarhdr.c elf_getarsym.c \ elf_rawfile.c elf_readall.c elf_cntl.c \ elf_getscn.c elf_nextscn.c elf_ndxscn.c elf_newscn.c \ ================================================ FILE: packages/libelf/obstack.h ================================================ /* obstack.h - object stack macros Copyright (C) 1988-1994,1996-1999,2003,2004,2005,2009,2011,2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* Summary: All the apparent functions defined here are macros. The idea is that you would use these pre-tested macros to solve a very specific set of problems, and they would run fast. Caution: no side-effects in arguments please!! They may be evaluated MANY times!! These macros operate a stack of objects. Each object starts life small, and may grow to maturity. (Consider building a word syllable by syllable.) An object can move while it is growing. Once it has been "finished" it never changes address again. So the "top of the stack" is typically an immature growing object, while the rest of the stack is of mature, fixed size and fixed address objects. These routines grab large chunks of memory, using a function you supply, called `obstack_chunk_alloc'. On occasion, they free chunks, by calling `obstack_chunk_free'. You must define them and declare them before using any obstack macros. Each independent stack is represented by a `struct obstack'. Each of the obstack macros expects a pointer to such a structure as the first argument. One motivation for this package is the problem of growing char strings in symbol tables. Unless you are "fascist pig with a read-only mind" --Gosper's immortal quote from HAKMEM item 154, out of context--you would not like to put any arbitrary upper limit on the length of your symbols. In practice this often means you will build many short symbols and a few long symbols. At the time you are reading a symbol you don't know how long it is. One traditional method is to read a symbol into a buffer, realloc()ating the buffer every time you try to read a symbol that is longer than the buffer. This is beaut, but you still will want to copy the symbol from the buffer to a more permanent symbol-table entry say about half the time. With obstacks, you can work differently. Use one obstack for all symbol names. As you read a symbol, grow the name in the obstack gradually. When the name is complete, finalize it. Then, if the symbol exists already, free the newly read name. The way we do this is to take a large chunk, allocating memory from low addresses. When you want to build a symbol in the chunk you just add chars above the current "high water mark" in the chunk. When you have finished adding chars, because you got to the end of the symbol, you know how long the chars are, and you can create a new object. Mostly the chars will not burst over the highest address of the chunk, because you would typically expect a chunk to be (say) 100 times as long as an average object. In case that isn't clear, when we have enough chars to make up the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed) so we just point to it where it lies. No moving of chars is needed and this is the second win: potentially long strings need never be explicitly shuffled. Once an object is formed, it does not change its address during its lifetime. When the chars burst over a chunk boundary, we allocate a larger chunk, and then copy the partly formed object from the end of the old chunk to the beginning of the new larger chunk. We then carry on accreting characters to the end of the object as we normally would. A special macro is provided to add a single char at a time to a growing object. This allows the use of register variables, which break the ordinary 'growth' macro. Summary: We allocate large chunks. We carve out one object at a time from the current chunk. Once carved, an object never moves. We are free to append data of any size to the currently growing object. Exactly one object is growing in an obstack at any one time. You can run one obstack per control block. You may have as many control blocks as you dare. Because of the way we do it, you can `unwind' an obstack back to a previous state. (You may remove objects much as you would with a stack.) */ /* Don't do the contents of this file more than once. */ #ifndef _OBSTACK_H #define _OBSTACK_H 1 #ifdef __cplusplus extern "C" { #endif /* We need the type of a pointer subtraction. If __PTRDIFF_TYPE__ is defined, as with GNU C, use that; that way we don't pollute the namespace with 's symbols. Otherwise, include and use ptrdiff_t. */ #ifdef __PTRDIFF_TYPE__ # define PTR_INT_TYPE __PTRDIFF_TYPE__ #else # include # define PTR_INT_TYPE ptrdiff_t #endif /* If B is the base of an object addressed by P, return the result of aligning P to the next multiple of A + 1. B and P must be of type char *. A + 1 must be a power of 2. */ #define __BPTR_ALIGN(B, P, A) ((B) + (((P) - (B) + (A)) & ~(A))) /* Similiar to _BPTR_ALIGN (B, P, A), except optimize the common case where pointers can be converted to integers, aligned as integers, and converted back again. If PTR_INT_TYPE is narrower than a pointer (e.g., the AS/400), play it safe and compute the alignment relative to B. Otherwise, use the faster strategy of computing the alignment relative to 0. */ #define __PTR_ALIGN(B, P, A) \ __BPTR_ALIGN (sizeof (PTR_INT_TYPE) < sizeof (void *) ? (B) : (char *) 0, \ P, A) #include struct _obstack_chunk /* Lives at front of each chunk. */ { char *limit; /* 1 past end of this chunk */ struct _obstack_chunk *prev; /* address of prior chunk or NULL */ char contents[4]; /* objects begin here */ }; struct obstack /* control current object in current chunk */ { long chunk_size; /* preferred size to allocate chunks in */ struct _obstack_chunk *chunk; /* address of current struct obstack_chunk */ char *object_base; /* address of object we are building */ char *next_free; /* where to add next char to current object */ char *chunk_limit; /* address of char after current chunk */ union { PTR_INT_TYPE tempint; void *tempptr; } temp; /* Temporary for some macros. */ int alignment_mask; /* Mask of alignment for each object. */ /* These prototypes vary based on `use_extra_arg', and we use casts to the prototypeless function type in all assignments, but having prototypes here quiets -Wstrict-prototypes. */ struct _obstack_chunk *(*chunkfun) (void *, long); void (*freefun) (void *, struct _obstack_chunk *); void *extra_arg; /* first arg for chunk alloc/dealloc funcs */ unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */ unsigned maybe_empty_object:1;/* There is a possibility that the current chunk contains a zero-length object. This prevents freeing the chunk if we allocate a bigger chunk to replace it. */ unsigned alloc_failed:1; /* No longer used, as we now call the failed handler on error, but retained for binary compatibility. */ }; static void _obstack_newchunk (struct obstack *h, int length); /* Exit value used when `print_and_abort' is used. */ extern int obstack_exit_failure; /* Pointer to beginning of object being allocated or to be allocated next. Note that this might not be the final address of the object because a new chunk might be needed to hold the final size. */ #define obstack_base(h) ((void *) (h)->object_base) /* Size for allocating ordinary chunks. */ #define obstack_chunk_size(h) ((h)->chunk_size) /* Pointer to next byte not yet allocated in current chunk. */ #define obstack_next_free(h) ((h)->next_free) /* Mask specifying low bits that should be clear in address of an object. */ #define obstack_alignment_mask(h) ((h)->alignment_mask) /* To prevent prototype warnings provide complete argument list. */ #define obstack_init(h) \ _obstack_begin ((h), 0, 0, \ (void *(*) (long)) obstack_chunk_alloc, \ (void (*) (void *)) obstack_chunk_free) #define obstack_begin(h, size) \ _obstack_begin ((h), (size), 0, \ (void *(*) (long)) obstack_chunk_alloc, \ (void (*) (void *)) obstack_chunk_free) #define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \ _obstack_begin ((h), (size), (alignment), \ (void *(*) (long)) (chunkfun), \ (void (*) (void *)) (freefun)) #define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \ _obstack_begin_1 ((h), (size), (alignment), \ (void *(*) (void *, long)) (chunkfun), \ (void (*) (void *, void *)) (freefun), (arg)) #define obstack_chunkfun(h, newchunkfun) \ ((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun)) #define obstack_freefun(h, newfreefun) \ ((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun)) #define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = (achar)) #define obstack_blank_fast(h,n) ((h)->next_free += (n)) #define obstack_memory_used(h) _obstack_memory_used (h) #if defined __GNUC__ /* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and does not implement __extension__. But that compiler doesn't define __GNUC_MINOR__. */ # if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__) # define __extension__ # endif /* For GNU C, if not -traditional, we can define these macros to compute all args only once without using a global variable. Also, we can avoid using the `temp' slot, to make faster code. */ # define obstack_object_size(OBSTACK) \ __extension__ \ ({ struct obstack const *__o = (OBSTACK); \ (unsigned) (__o->next_free - __o->object_base); }) # define obstack_room(OBSTACK) \ __extension__ \ ({ struct obstack const *__o = (OBSTACK); \ (unsigned) (__o->chunk_limit - __o->next_free); }) # define obstack_make_room(OBSTACK,length) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ int __len = (length); \ if (__o->chunk_limit - __o->next_free < __len) \ _obstack_newchunk (__o, __len); \ (void) 0; }) # define obstack_empty_p(OBSTACK) \ __extension__ \ ({ struct obstack const *__o = (OBSTACK); \ (__o->chunk->prev == 0 \ && __o->next_free == __PTR_ALIGN ((char *) __o->chunk, \ __o->chunk->contents, \ __o->alignment_mask)); }) # define obstack_grow(OBSTACK,where,length) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ int __len = (length); \ if (__o->next_free + __len > __o->chunk_limit) \ _obstack_newchunk (__o, __len); \ memcpy (__o->next_free, where, __len); \ __o->next_free += __len; \ (void) 0; }) # define obstack_grow0(OBSTACK,where,length) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ int __len = (length); \ if (__o->next_free + __len + 1 > __o->chunk_limit) \ _obstack_newchunk (__o, __len + 1); \ memcpy (__o->next_free, where, __len); \ __o->next_free += __len; \ *(__o->next_free)++ = 0; \ (void) 0; }) # define obstack_1grow(OBSTACK,datum) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + 1 > __o->chunk_limit) \ _obstack_newchunk (__o, 1); \ obstack_1grow_fast (__o, datum); \ (void) 0; }) /* These assume that the obstack alignment is good enough for pointers or ints, and that the data added so far to the current object shares that much alignment. */ # define obstack_ptr_grow(OBSTACK,datum) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + sizeof (void *) > __o->chunk_limit) \ _obstack_newchunk (__o, sizeof (void *)); \ obstack_ptr_grow_fast (__o, datum); }) \ # define obstack_int_grow(OBSTACK,datum) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + sizeof (int) > __o->chunk_limit) \ _obstack_newchunk (__o, sizeof (int)); \ obstack_int_grow_fast (__o, datum); }) # define obstack_ptr_grow_fast(OBSTACK,aptr) \ __extension__ \ ({ struct obstack *__o1 = (OBSTACK); \ *(const void **) __o1->next_free = (aptr); \ __o1->next_free += sizeof (const void *); \ (void) 0; }) # define obstack_int_grow_fast(OBSTACK,aint) \ __extension__ \ ({ struct obstack *__o1 = (OBSTACK); \ *(int *) __o1->next_free = (aint); \ __o1->next_free += sizeof (int); \ (void) 0; }) # define obstack_blank(OBSTACK,length) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ int __len = (length); \ if (__o->chunk_limit - __o->next_free < __len) \ _obstack_newchunk (__o, __len); \ obstack_blank_fast (__o, __len); \ (void) 0; }) # define obstack_alloc(OBSTACK,length) \ __extension__ \ ({ struct obstack *__h = (OBSTACK); \ obstack_blank (__h, (length)); \ obstack_finish (__h); }) # define obstack_copy(OBSTACK,where,length) \ __extension__ \ ({ struct obstack *__h = (OBSTACK); \ obstack_grow (__h, (where), (length)); \ obstack_finish (__h); }) # define obstack_copy0(OBSTACK,where,length) \ __extension__ \ ({ struct obstack *__h = (OBSTACK); \ obstack_grow0 (__h, (where), (length)); \ obstack_finish (__h); }) /* The local variable is named __o1 to avoid a name conflict when obstack_blank is called. */ # define obstack_finish(OBSTACK) \ __extension__ \ ({ struct obstack *__o1 = (OBSTACK); \ void *__value = (void *) __o1->object_base; \ if (__o1->next_free == __value) \ __o1->maybe_empty_object = 1; \ __o1->next_free \ = __PTR_ALIGN (__o1->object_base, __o1->next_free, \ __o1->alignment_mask); \ if (__o1->next_free - (char *)__o1->chunk \ > __o1->chunk_limit - (char *)__o1->chunk) \ __o1->next_free = __o1->chunk_limit; \ __o1->object_base = __o1->next_free; \ __value; }) # define obstack_free(OBSTACK, OBJ) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ void *__obj = (OBJ); \ if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \ __o->next_free = __o->object_base = (char *)__obj; \ else (obstack_free_func) (__o, __obj); }) #else /* not __GNUC__ */ # define obstack_object_size(h) \ (unsigned) ((h)->next_free - (h)->object_base) # define obstack_room(h) \ (unsigned) ((h)->chunk_limit - (h)->next_free) # define obstack_empty_p(h) \ ((h)->chunk->prev == 0 \ && (h)->next_free == __PTR_ALIGN ((char *) (h)->chunk, \ (h)->chunk->contents, \ (h)->alignment_mask)) /* Note that the call to _obstack_newchunk is enclosed in (..., 0) so that we can avoid having void expressions in the arms of the conditional expression. Casting the third operand to void was tried before, but some compilers won't accept it. */ # define obstack_make_room(h,length) \ ( (h)->temp.tempint = (length), \ (((h)->next_free + (h)->temp.tempint > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0)) # define obstack_grow(h,where,length) \ ( (h)->temp.tempint = (length), \ (((h)->next_free + (h)->temp.tempint > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \ memcpy ((h)->next_free, where, (h)->temp.tempint), \ (h)->next_free += (h)->temp.tempint) # define obstack_grow0(h,where,length) \ ( (h)->temp.tempint = (length), \ (((h)->next_free + (h)->temp.tempint + 1 > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), (h)->temp.tempint + 1), 0) : 0), \ memcpy ((h)->next_free, where, (h)->temp.tempint), \ (h)->next_free += (h)->temp.tempint, \ *((h)->next_free)++ = 0) # define obstack_1grow(h,datum) \ ( (((h)->next_free + 1 > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), 1), 0) : 0), \ obstack_1grow_fast (h, datum)) # define obstack_ptr_grow(h,datum) \ ( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \ obstack_ptr_grow_fast (h, datum)) # define obstack_int_grow(h,datum) \ ( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \ obstack_int_grow_fast (h, datum)) # define obstack_ptr_grow_fast(h,aptr) \ (((const void **) ((h)->next_free += sizeof (void *)))[-1] = (aptr)) # define obstack_int_grow_fast(h,aint) \ (((int *) ((h)->next_free += sizeof (int)))[-1] = (aint)) # define obstack_blank(h,length) \ ( (h)->temp.tempint = (length), \ (((h)->chunk_limit - (h)->next_free < (h)->temp.tempint) \ ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \ obstack_blank_fast (h, (h)->temp.tempint)) # define obstack_alloc(h,length) \ (obstack_blank ((h), (length)), obstack_finish ((h))) # define obstack_copy(h,where,length) \ (obstack_grow ((h), (where), (length)), obstack_finish ((h))) # define obstack_copy0(h,where,length) \ (obstack_grow0 ((h), (where), (length)), obstack_finish ((h))) # define obstack_finish(h) \ ( ((h)->next_free == (h)->object_base \ ? (((h)->maybe_empty_object = 1), 0) \ : 0), \ (h)->temp.tempptr = (h)->object_base, \ (h)->next_free \ = __PTR_ALIGN ((h)->object_base, (h)->next_free, \ (h)->alignment_mask), \ (((h)->next_free - (char *) (h)->chunk \ > (h)->chunk_limit - (char *) (h)->chunk) \ ? ((h)->next_free = (h)->chunk_limit) : 0), \ (h)->object_base = (h)->next_free, \ (h)->temp.tempptr) # define obstack_free(h,obj) \ ( (h)->temp.tempint = (char *) (obj) - (char *) (h)->chunk, \ ((((h)->temp.tempint > 0 \ && (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk)) \ ? (((h)->next_free = (h)->object_base \ = (h)->temp.tempint + (char *) (h)->chunk), 0) \ : ((obstack_free_func) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0))) #endif /* not __GNUC__ */ /* START LOCAL ADDITION */ static inline int obstack_printf(struct obstack *obst, const char *fmt, ...) { char buf[1024]; va_list ap; int len; va_start(ap, fmt); len = vsnprintf(buf, sizeof(buf), fmt, ap); obstack_grow(obst, buf, len); va_end(ap); return len; } /* Determine default alignment. */ union fooround { uintmax_t i; long double d; void *p; }; struct fooalign { char c; union fooround u; }; /* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT. But in fact it might be less smart and round addresses to as much as DEFAULT_ROUNDING. So we prepare for it to do that. */ enum { DEFAULT_ALIGNMENT = offsetof (struct fooalign, u), DEFAULT_ROUNDING = sizeof (union fooround) }; /* When we copy a long block of data, this is the unit to do it with. On some machines, copying successive ints does not work; in such a case, redefine COPYING_UNIT to `long' (if that works) or `char' as a last resort. */ # ifndef COPYING_UNIT # define COPYING_UNIT int # endif /* The functions allocating more room by calling `obstack_chunk_alloc' jump to the handler pointed to by `obstack_alloc_failed_handler'. This can be set to a user defined function which should either abort gracefully or use longjump - but shouldn't return. This variable by default points to the internal function `print_and_abort'. */ static void print_and_abort (void); # ifdef _LIBC # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) /* A looong time ago (before 1994, anyway; we're not sure) this global variable was used by non-GNU-C macros to avoid multiple evaluation. The GNU C library still exports it because somebody might use it. */ struct obstack *_obstack_compat; compat_symbol (libc, _obstack_compat, _obstack, GLIBC_2_0); # endif # endif /* Define a macro that either calls functions with the traditional malloc/free calling interface, or calls functions with the mmalloc/mfree interface (that adds an extra first argument), based on the state of use_extra_arg. For free, do not use ?:, since some compilers, like the MIPS compilers, do not allow (expr) ? void : void. */ # define CALL_CHUNKFUN(h, size) \ (((h) -> use_extra_arg) \ ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \ : (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size))) # define CALL_FREEFUN(h, old_chunk) \ do { \ if ((h) -> use_extra_arg) \ (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \ else \ (*(void (*) (void *)) (h)->freefun) ((old_chunk)); \ } while (0) /* Initialize an obstack H for use. Specify chunk size SIZE (0 means default). Objects start on multiples of ALIGNMENT (0 means use default). CHUNKFUN is the function to use to allocate chunks, and FREEFUN the function to free them. Return nonzero if successful, calls obstack_alloc_failed_handler if allocation fails. */ static int _obstack_begin (struct obstack *h, int size, int alignment, void *(*chunkfun) (long), void (*freefun) (void *)) { register struct _obstack_chunk *chunk; /* points to new chunk */ if (alignment == 0) alignment = DEFAULT_ALIGNMENT; if (size == 0) /* Default size is what GNU malloc can fit in a 4096-byte block. */ { /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc. Use the values for range checking, because if range checking is off, the extra bytes won't be missed terribly, but if range checking is on and we used a larger request, a whole extra 4096 bytes would be allocated. These number are irrelevant to the new GNU malloc. I suspect it is less sensitive to the size of the request. */ int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)) + 4 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)); size = 4096 - extra; } h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun; h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun; h->chunk_size = size; h->alignment_mask = alignment - 1; h->use_extra_arg = 0; chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size); if (!chunk) print_and_abort(); h->next_free = h->object_base = __PTR_ALIGN ((char *) chunk, chunk->contents, alignment - 1); h->chunk_limit = chunk->limit = (char *) chunk + h->chunk_size; chunk->prev = 0; /* The initial chunk now contains no empty object. */ h->maybe_empty_object = 0; h->alloc_failed = 0; return 1; } static int _obstack_begin_1 (struct obstack *h, int size, int alignment, void *(*chunkfun) (void *, long), void (*freefun) (void *, void *), void *arg) { register struct _obstack_chunk *chunk; /* points to new chunk */ if (alignment == 0) alignment = DEFAULT_ALIGNMENT; if (size == 0) /* Default size is what GNU malloc can fit in a 4096-byte block. */ { /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc. Use the values for range checking, because if range checking is off, the extra bytes won't be missed terribly, but if range checking is on and we used a larger request, a whole extra 4096 bytes would be allocated. These number are irrelevant to the new GNU malloc. I suspect it is less sensitive to the size of the request. */ int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)) + 4 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)); size = 4096 - extra; } h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun; h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun; h->chunk_size = size; h->alignment_mask = alignment - 1; h->extra_arg = arg; h->use_extra_arg = 1; chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size); if (!chunk) print_and_abort(); h->next_free = h->object_base = __PTR_ALIGN ((char *) chunk, chunk->contents, alignment - 1); h->chunk_limit = chunk->limit = (char *) chunk + h->chunk_size; chunk->prev = 0; /* The initial chunk now contains no empty object. */ h->maybe_empty_object = 0; h->alloc_failed = 0; return 1; } /* Allocate a new current chunk for the obstack *H on the assumption that LENGTH bytes need to be added to the current object, or a new object of length LENGTH allocated. Copies any partial object from the end of the old chunk to the beginning of the new one. */ static void _obstack_newchunk (struct obstack *h, int length) { register struct _obstack_chunk *old_chunk = h->chunk; register struct _obstack_chunk *new_chunk; register long new_size; register long obj_size = h->next_free - h->object_base; register long i; long already; char *object_base; /* Compute size for new chunk. */ new_size = (obj_size + length) + (obj_size >> 3) + h->alignment_mask + 100; if (new_size < h->chunk_size) new_size = h->chunk_size; /* Allocate and initialize the new chunk. */ new_chunk = CALL_CHUNKFUN (h, new_size); if (!new_chunk) print_and_abort(); h->chunk = new_chunk; new_chunk->prev = old_chunk; new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size; /* Compute an aligned object_base in the new chunk */ object_base = __PTR_ALIGN ((char *) new_chunk, new_chunk->contents, h->alignment_mask); /* Move the existing object to the new chunk. Word at a time is fast and is safe if the object is sufficiently aligned. */ if (h->alignment_mask + 1 >= DEFAULT_ALIGNMENT) { for (i = obj_size / sizeof (COPYING_UNIT) - 1; i >= 0; i--) ((COPYING_UNIT *)object_base)[i] = ((COPYING_UNIT *)h->object_base)[i]; /* We used to copy the odd few remaining bytes as one extra COPYING_UNIT, but that can cross a page boundary on a machine which does not do strict alignment for COPYING_UNITS. */ already = obj_size / sizeof (COPYING_UNIT) * sizeof (COPYING_UNIT); } else already = 0; /* Copy remaining bytes one by one. */ for (i = already; i < obj_size; i++) object_base[i] = h->object_base[i]; /* If the object just copied was the only data in OLD_CHUNK, free that chunk and remove it from the chain. But not if that chunk might contain an empty object. */ if (! h->maybe_empty_object && (h->object_base == __PTR_ALIGN ((char *) old_chunk, old_chunk->contents, h->alignment_mask))) { new_chunk->prev = old_chunk->prev; CALL_FREEFUN (h, old_chunk); } h->object_base = object_base; h->next_free = h->object_base + obj_size; /* The new chunk certainly contains no empty object yet. */ h->maybe_empty_object = 0; } /* Return nonzero if object OBJ has been allocated from obstack H. This is here for debugging. If you use it in a program, you are probably losing. */ /* Free objects in obstack H, including OBJ and everything allocate more recently than OBJ. If OBJ is zero, free everything in H. */ static void obstack_free_func (struct obstack *h, void *obj) { register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */ register struct _obstack_chunk *plp; /* point to previous chunk if any */ lp = h->chunk; /* We use >= because there cannot be an object at the beginning of a chunk. But there can be an empty object at that address at the end of another chunk. */ while (lp != 0 && ((void *) lp >= obj || (void *) (lp)->limit < obj)) { plp = lp->prev; CALL_FREEFUN (h, lp); lp = plp; /* If we switch chunks, we can't tell whether the new current chunk contains an empty object, so assume that it may. */ h->maybe_empty_object = 1; } if (lp) { h->object_base = h->next_free = (char *) (obj); h->chunk_limit = lp->limit; h->chunk = lp; } else if (obj != 0) /* obj is not in any of the chunks! */ abort (); } static int _obstack_memory_used (struct obstack *h) { register struct _obstack_chunk* lp; register int nbytes = 0; for (lp = h->chunk; lp != 0; lp = lp->prev) { nbytes += lp->limit - (char *) lp; } return nbytes; } static void __attribute__ ((noreturn)) print_and_abort (void) { fprintf(stderr, "%s\n", "memory exhausted"); exit(1); } /* END LOCAL ADDITION */ #ifdef __cplusplus } /* C++ */ #endif #endif /* obstack.h */ ================================================ FILE: packages/libelf/qsort_r.h ================================================ /* https://raw.githubusercontent.com/android/platform_bionic/master/libc/upstream-freebsd/lib/libc/stdlib/qsort.c */ #define I_AM_QSORT_R /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include #include #ifdef I_AM_QSORT_R typedef int cmp_t(void *, const void *, const void *); #else typedef int cmp_t(const void *, const void *); #endif static inline char *med3(char *, char *, char *, cmp_t *, void *); static inline void swapfunc(char *, char *, int, int); #define min(a, b) (a) < (b) ? a : b /* * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". */ #define swapcode(TYPE, parmi, parmj, n) { \ long i = (n) / sizeof (TYPE); \ TYPE *pi = (TYPE *) (parmi); \ TYPE *pj = (TYPE *) (parmj); \ do { \ TYPE t = *pi; \ *pi++ = *pj; \ *pj++ = t; \ } while (--i > 0); \ } #define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \ es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1; static inline void swapfunc(a, b, n, swaptype) char *a, *b; int n, swaptype; { if(swaptype <= 1) swapcode(long, a, b, n) else swapcode(char, a, b, n) } #define swap(a, b) \ if (swaptype == 0) { \ long t = *(long *)(a); \ *(long *)(a) = *(long *)(b); \ *(long *)(b) = t; \ } else \ swapfunc(a, b, es, swaptype) #define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype) #ifdef I_AM_QSORT_R #define CMP(t, x, y) (cmp((t), (x), (y))) #else #define CMP(t, x, y) (cmp((x), (y))) #endif static inline char * med3(char *a, char *b, char *c, cmp_t *cmp, void *thunk #ifndef I_AM_QSORT_R __unused #endif ) { return CMP(thunk, a, b) < 0 ? (CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a )) :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c )); } #ifdef I_AM_QSORT_R void qsort_r(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp) #else #define thunk NULL void qsort(void *a, size_t n, size_t es, cmp_t *cmp) #endif { char *pa, *pb, *pc, *pd, *pl, *pm, *pn; size_t d, r; int cmp_result; int swaptype, swap_cnt; loop: SWAPINIT(a, es); swap_cnt = 0; if (n < 7) { for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es) for (pl = pm; pl > (char *)a && CMP(thunk, pl - es, pl) > 0; pl -= es) swap(pl, pl - es); return; } pm = (char *)a + (n / 2) * es; if (n > 7) { pl = a; pn = (char *)a + (n - 1) * es; if (n > 40) { d = (n / 8) * es; pl = med3(pl, pl + d, pl + 2 * d, cmp, thunk); pm = med3(pm - d, pm, pm + d, cmp, thunk); pn = med3(pn - 2 * d, pn - d, pn, cmp, thunk); } pm = med3(pl, pm, pn, cmp, thunk); } swap(a, pm); pa = pb = (char *)a + es; pc = pd = (char *)a + (n - 1) * es; for (;;) { while (pb <= pc && (cmp_result = CMP(thunk, pb, a)) <= 0) { if (cmp_result == 0) { swap_cnt = 1; swap(pa, pb); pa += es; } pb += es; } while (pb <= pc && (cmp_result = CMP(thunk, pc, a)) >= 0) { if (cmp_result == 0) { swap_cnt = 1; swap(pc, pd); pd -= es; } pc -= es; } if (pb > pc) break; swap(pb, pc); swap_cnt = 1; pb += es; pc -= es; } if (swap_cnt == 0) { /* Switch to insertion sort */ for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es) for (pl = pm; pl > (char *)a && CMP(thunk, pl - es, pl) > 0; pl -= es) swap(pl, pl - es); return; } pn = (char *)a + n * es; r = min(pa - (char *)a, pb - pa); vecswap(a, pb - r, r); r = min(pd - pc, pn - pd - es); vecswap(pb, pn - r, r); if ((r = pb - pa) > es) #ifdef I_AM_QSORT_R qsort_r(a, r / es, es, thunk, cmp); #else qsort(a, r / es, es, cmp); #endif if ((r = pd - pc) > es) { /* Iterate rather than recurse to save stack space */ a = pn - r; n = r / es; goto loop; } /* qsort(pn - r, r / es, es, cmp);*/ } ================================================ FILE: packages/libelf/ranlib.c.patch ================================================ diff -u -r ../elfutils-0.166/src/ranlib.c ./src/ranlib.c --- ../elfutils-0.166/src/ranlib.c 2015-11-27 08:36:29.000000000 -0500 +++ ./src/ranlib.c 2016-05-04 14:18:56.314550152 -0400 @@ -138,11 +138,6 @@ assert (off + n <= len); - /* Tell the kernel we will read all the pages sequentially. */ - size_t ps = sysconf (_SC_PAGESIZE); - if (n > 2 * ps) - posix_madvise (rawfile + (off & ~(ps - 1)), n, POSIX_MADV_SEQUENTIAL); - return write_retry (newfd, rawfile + off, n) != (ssize_t) n; } ================================================ FILE: packages/libelf/src-readelf.c.patch ================================================ diff -u -r ../elfutils-0.170/src/readelf.c ./src/readelf.c --- ../elfutils-0.170/src/readelf.c 2017-08-02 14:06:25.000000000 +0200 +++ ./src/readelf.c 2017-12-10 01:14:25.898858528 +0100 @@ -43,6 +43,7 @@ #include #include #include +#include #include #include ================================================ FILE: packages/libelf/stdio_ext.h ================================================ #ifndef STDIO_EXT_H_INCLUDED #define STDIO_EXT_H_INCLUDED #include /* http://linux.die.net/man/3/__fsetlocking */ #define FSETLOCKING_INTERNAL 1 #define FSETLOCKING_BYCALLER 2 #define FSETLOCKING_QUERY 3 static inline int __fsetlocking(FILE *stream, int type) { (void) stream; (void) type; return FSETLOCKING_INTERNAL; } static inline int feof_unlocked(FILE *stream) { return feof(stream); } static inline int ferror_unlocked(FILE *stream) { return ferror(stream); } static inline int fputs_unlocked(const char *s, FILE *stream) { return fputs(s, stream); } static inline int fputc_unlocked(int c, FILE *stream) { return fputc(c, stream); } static inline size_t fread_unlocked(void *data, size_t size, size_t count, FILE *stream) { return fread(data, size, count, stream); } static inline size_t fwrite_unlocked(const void *data, size_t size, size_t count, FILE *stream) { return fwrite(data, size, count, stream); } #endif ================================================ FILE: packages/libelf/strings.c.patch ================================================ diff -u -r ../elfutils-0.166/src/strings.c ./src/strings.c --- ../elfutils-0.166/src/strings.c 2015-11-27 08:36:29.000000000 -0500 +++ ./src/strings.c 2016-05-04 14:19:55.593602311 -0400 @@ -494,7 +494,6 @@ if (mem != MAP_FAILED) { /* We will go through the mapping sequentially. */ - (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL); break; } if (errno != EINVAL && errno != ENOMEM) ================================================ FILE: packages/libelf/strip.c.patch ================================================ diff -u -r ../elfutils-0.166/src/strip.c ./src/strip.c --- ../elfutils-0.166/src/strip.c 2016-03-02 11:25:38.000000000 -0500 +++ ./src/strip.c 2016-05-04 14:03:53.052913249 -0400 @@ -323,8 +323,14 @@ /* If we have to preserve the timestamp, we need it in the format utimes() understands. */ - tv[0] = pre_st.st_atim; - tv[1] = pre_st.st_mtim; + struct timespec atime; + atime.tv_sec = pre_st.st_atime; + atime.tv_nsec = pre_st.st_atime_nsec; + struct timespec mtime; + mtime.tv_sec = pre_st.st_mtime; + mtime.tv_nsec = pre_st.st_mtime_nsec; + tv[0] = atime; + tv[1] = mtime; } /* Open the file. */ ================================================ FILE: packages/libelf/unstrip.c.patch ================================================ diff -u -r ../elfutils-0.166/src/unstrip.c ./src/unstrip.c --- ../elfutils-0.166/src/unstrip.c 2016-01-12 07:49:19.000000000 -0500 +++ ./src/unstrip.c 2016-05-04 15:22:24.975567076 -0400 @@ -303,7 +304,11 @@ if (lastslash == path) return; - char *dir = strndupa (path, lastslash - path); + size_t substr_len = lastslash - path; + char *dir = alloca(substr_len+1); + strncpy(dir, path, substr_len); + dir[substr_len] = 0; + while (mkdir (dir, 0777) < 0 && errno != EEXIST) if (errno == ENOENT) make_directories (dir); ================================================ FILE: packages/libev/Makefile.in.patch ================================================ diff -u -r ../libev-4.22/Makefile.in ./Makefile.in --- ../libev-4.22/Makefile.in 2015-12-20 16:12:45.000000000 -0500 +++ ./Makefile.in 2016-02-02 10:30:17.445084694 -0500 @@ -343,7 +343,7 @@ ev.3 ev.pod Symbols.ev Symbols.event man_MANS = ev.3 -include_HEADERS = ev.h ev++.h event.h +include_HEADERS = ev.h ev++.h lib_LTLIBRARIES = libev.la libev_la_SOURCES = ev.c event.c libev_la_LDFLAGS = -version-info $(VERSION_INFO) ================================================ FILE: packages/libev/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://software.schmorp.de/pkg/libev.html TERMUX_PKG_DESCRIPTION="Full-featured and high-performance event loop library" TERMUX_PKG_LICENSE="BSD 2-Clause" TERMUX_PKG_VERSION=4.27 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=2d5526fc8da4f072dd5c73e18fbb1666f5ef8ed78b73bba12e195cfdd810344e TERMUX_PKG_BREAKS="libev-dev" TERMUX_PKG_REPLACES="libev-dev" TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/libev-$TERMUX_PKG_VERSION.tar.gz ================================================ FILE: packages/libevent/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://libevent.org/ TERMUX_PKG_DESCRIPTION="Library that provides asynchronous event notification" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=2.1.11 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/libevent/libevent/archive/release-${TERMUX_PKG_VERSION}-stable.tar.gz TERMUX_PKG_SHA256=229393ab2bf0dc94694f21836846b424f3532585bac3468738b7bf752c03901e TERMUX_PKG_BREAKS="libevent-dev" TERMUX_PKG_REPLACES="libevent-dev" TERMUX_PKG_RM_AFTER_INSTALL="bin/event_rpcgen.py" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DEVENT__BUILD_SHARED_LIBRARIES=ON -DEVENT__DISABLE_BENCHMARK=ON -DEVENT__DISABLE_OPENSSL=ON -DEVENT__DISABLE_REGRESS=ON -DEVENT__DISABLE_SAMPLES=ON -DEVENT__DISABLE_TESTS=ON -DEVENT__DISABLE_TESTS=ON -DEVENT__HAVE_WAITPID_WITH_WNOWAIT=ON -DEVENT__SIZEOF_PTHREAD_T=$((TERMUX_ARCH_BITS/8)) " ================================================ FILE: packages/libevent/evdns.c.patch ================================================ diff -uNr libevent-release-2.1.8-stable/evdns.c libevent-release-2.1.8-stable.mod/evdns.c --- libevent-release-2.1.8-stable/evdns.c 2017-01-26 01:37:15.000000000 +0200 +++ libevent-release-2.1.8-stable.mod/evdns.c 2017-09-12 12:58:45.352988051 +0300 @@ -52,6 +52,9 @@ #include "evconfig-private.h" #include +#ifdef __ANDROID__ +# include +#endif #ifndef _FORTIFY_SOURCE #define _FORTIFY_SOURCE 3 @@ -3602,7 +3605,7 @@ evutil_snprintf(path_out, len_out, "%s%s", path, hostfile); return path_out; #else - return mm_strdup("/etc/hosts"); + return mm_strdup("@TERMUX_PREFIX@/etc/hosts"); #endif } @@ -3959,6 +3962,21 @@ int r; #ifdef _WIN32 r = evdns_base_config_windows_nameservers(base); +#elif defined(__ANDROID__) + /** From: http://www.programering.com/a/MjMwcjMwATA.html */ + int add_servers = 0; + char buf[PROP_VALUE_MAX]; + r = __system_property_get("net.dns1", buf); + if (r >= 7) { + add_servers++; + evdns_base_nameserver_ip_add(base, buf); + } + r = __system_property_get("net.dns2", buf); + if (r >= 7) { + add_servers++; + evdns_base_nameserver_ip_add(base, buf); + } + if (add_servers == 0) evdns_base_nameserver_ip_add(base, "8.8.8.8"); #else r = evdns_base_resolv_conf_parse(base, DNS_OPTIONS_ALL, "/etc/resolv.conf"); #endif ================================================ FILE: packages/libevent/evutil.c.patch ================================================ diff -u -r ../libevent-release-2.1.8-stable/evutil.c ./evutil.c --- ../libevent-release-2.1.8-stable/evutil.c 2017-01-26 00:37:15.000000000 +0100 +++ ./evutil.c 2017-07-07 01:04:14.746540880 +0200 @@ -47,6 +47,7 @@ #include #endif #ifdef EVENT__HAVE_UNISTD_H +#define __USE_GNU 1 /* For pipe2(). */ #include #endif #ifdef EVENT__HAVE_FCNTL_H ================================================ FILE: packages/libevent/evutil_rand.c.patch ================================================ diff -u -r ../libevent-release-2.1.8-stable/evutil_rand.c ./evutil_rand.c --- ../libevent-release-2.1.8-stable/evutil_rand.c 2017-01-26 00:37:15.000000000 +0100 +++ ./evutil_rand.c 2017-01-27 23:51:13.124764486 +0100 @@ -195,8 +195,10 @@ void evutil_secure_rng_add_bytes(const char *buf, size_t n) { +#ifndef __ANDROID__ arc4random_addrandom((unsigned char*)buf, n>(size_t)INT_MAX ? INT_MAX : (int)n); +#endif } void ================================================ FILE: packages/libexif/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://libexif.github.io/ TERMUX_PKG_DESCRIPTION="Library for reading and writing EXIF image metadata" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=0.6.21 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/libexif/libexif/${TERMUX_PKG_VERSION}/libexif-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SHA256=16cdaeb62eb3e6dfab2435f7d7bccd2f37438d21c5218ec4e58efa9157d4d41a TERMUX_PKG_BREAKS="libexif-dev" TERMUX_PKG_REPLACES="libexif-dev" ================================================ FILE: packages/libexpat/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://libexpat.github.io/ TERMUX_PKG_DESCRIPTION="XML parsing C library" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_VERSION=2.2.9 TERMUX_PKG_SRCURL=https://github.com/libexpat/libexpat/releases/download/R_${TERMUX_PKG_VERSION//./_}/expat-$TERMUX_PKG_VERSION.tar.bz2 TERMUX_PKG_SHA256=f1063084dc4302a427dabcca499c8312b3a32a29b7d2506653ecc8f950a9a237 TERMUX_PKG_BREAKS="libexpat-dev" TERMUX_PKG_REPLACES="libexpat-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--without-xmlwf --without-docbook" ================================================ FILE: packages/libffi/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://sourceware.org/libffi/ TERMUX_PKG_DESCRIPTION="Library providing a portable, high level programming interface to various calling conventions" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=3.3 TERMUX_PKG_SRCURL=ftp://sourceware.org/pub/libffi/libffi-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056 TERMUX_PKG_BREAKS="libffi-dev" TERMUX_PKG_REPLACES="libffi-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-multi-os-directory" TERMUX_PKG_RM_AFTER_INSTALL="lib/libffi-${TERMUX_PKG_VERSION}/include" termux_step_pre_configure() { if [ $TERMUX_ARCH = arm ]; then CFLAGS+=" -fno-integrated-as" fi } termux_step_post_configure() { # work around since mmap can't be written and marked executable in android anymore from userspace echo "#define FFI_MMAP_EXEC_WRIT 1" >> fficonfig.h } ================================================ FILE: packages/libflac/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://xiph.org/flac/ TERMUX_PKG_DESCRIPTION="FLAC (Free Lossless Audio Codec) library" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.3.3 TERMUX_PKG_SRCURL=http://downloads.xiph.org/releases/flac/flac-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=213e82bd716c9de6db2f98bcadbc4c24c7e2efe8c75939a1a84e28539c4e1748 TERMUX_PKG_DEPENDS="libc++, libogg" TERMUX_PKG_BREAKS="libflac-dev" TERMUX_PKG_REPLACES="libflac-dev" ================================================ FILE: packages/libflac/flac.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="bin/flac bin/metaflac share/man/man1" TERMUX_SUBPKG_DESCRIPTION="FLAC (Free Lossless Audio Codec) command-line tool" ================================================ FILE: packages/libgc/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.hboehm.info/gc/ TERMUX_PKG_DESCRIPTION="Library providing the Boehm-Demers-Weiser conservative garbage collector" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=(8.0.4 7.6.10) TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=(https://github.com/ivmai/bdwgc/releases/download/v$TERMUX_PKG_VERSION/gc-$TERMUX_PKG_VERSION.tar.gz https://github.com/ivmai/libatomic_ops/releases/download/v${TERMUX_PKG_VERSION[1]}/libatomic_ops-${TERMUX_PKG_VERSION[1]}.tar.gz) TERMUX_PKG_SHA256=(436a0ddc67b1ac0b0405b61a9675bca9e075c8156f4debd1d06f3a56c7cd289d 587edf60817f56daf1e1ab38a4b3c729b8e846ff67b4f62a6157183708f099af) TERMUX_PKG_BREAKS="libgc-dev" TERMUX_PKG_REPLACES="libgc-dev" TERMUX_PKG_RM_AFTER_INSTALL="share/gc" termux_step_post_extract_package() { mv libatomic_ops-${TERMUX_PKG_VERSION[1]} libatomic_ops ./autogen.sh } ================================================ FILE: packages/libgc/include-private-gcconfig.h.patch ================================================ diff -u -r ../gc-8.0.2/include/private/gcconfig.h ./include/private/gcconfig.h --- ../gc-8.0.2/include/private/gcconfig.h 2018-12-23 21:28:41.000000000 +0000 +++ ./include/private/gcconfig.h 2019-01-20 21:31:50.050945027 +0000 @@ -2283,6 +2283,7 @@ # define HBLKSIZE 4096 # endif # ifdef LINUX +# define SEARCH_FOR_DATA_START # define OS_TYPE "LINUX" # define LINUX_STACKBOTTOM # define DYNAMIC_LOADING ================================================ FILE: packages/libgcrypt/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/libgcrypt/ TERMUX_PKG_DESCRIPTION="General purpose cryptographic library based on the code from GnuPG" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=1.8.5 TERMUX_PKG_SHA256=3b4a2a94cb637eff5bdebbcaf46f4d95c4f25206f459809339cdada0eb577ac3 TERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_DEPENDS="libgpg-error" TERMUX_PKG_BREAKS="libgcrypt-dev" TERMUX_PKG_REPLACES="libgcrypt-dev" # configure tries to detect pthreads by linking with -lpthread, which does not exist on Android: TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" ac_cv_lib_pthread_pthread_create=yes --disable-jent-support " termux_step_pre_configure() { # libgcrypt uses syslog, which we redirect to android logging: LDFLAGS="$LDFLAGS -llog" CFLAGS+=" -no-integrated-as" if [ $TERMUX_ARCH = "arm" ]; then # See http://marc.info/?l=gnupg-devel&m=139136972631909&w=3 CFLAGS+=" -mno-unaligned-access" # Avoid text relocations: TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" gcry_cv_gcc_inline_asm_neon=no" elif [ $TERMUX_ARCH = "i686" ] || [ $TERMUX_ARCH = "x86_64" ]; then # Fix i686 android build, also in https://bugzilla.gnome.org/show_bug.cgi?id=724050 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --disable-asm" fi } ================================================ FILE: packages/libgcrypt/fix-hardcoded-paths.patch ================================================ diff -uNr libgcrypt-1.8.1/random/random.c libgcrypt-1.8.1.mod/random/random.c --- libgcrypt-1.8.1/random/random.c 2017-06-24 14:34:29.000000000 +0300 +++ libgcrypt-1.8.1.mod/random/random.c 2017-09-12 10:37:13.012994125 +0300 @@ -40,7 +40,7 @@ #include "cipher.h" /* For _gcry_sha1_hash_buffer(). */ /* The name of a file used to globally configure the RNG. */ -#define RANDOM_CONF_FILE "/etc/gcrypt/random.conf" +#define RANDOM_CONF_FILE "@TERMUX_PREFIX@/etc/gcrypt/random.conf" /* If not NULL a progress function called from certain places and the diff -uNr libgcrypt-1.8.1/random/rndunix.c libgcrypt-1.8.1.mod/random/rndunix.c --- libgcrypt-1.8.1/random/rndunix.c 2017-05-23 18:30:34.000000000 +0300 +++ libgcrypt-1.8.1.mod/random/rndunix.c 2017-09-12 10:54:50.432993369 +0300 @@ -226,6 +226,42 @@ const int hasAlternative; /* Whether source has alt.location */ } dataSources[] = { + // For Android + { "/system/bin/vmstat", "-s", SC(-3), NULL, 0, 0, 0, 1 }, + { "/system/xbin/vmstat", "-s", SC(-3), NULL, 0, 0, 0, 1 }, + { "/system/bin/netstat", "-s", SC(2), NULL, 0, 0, 0, 1 }, + { "/system/xbin/netstat", "-s", SC(2), NULL, 0, 0, 0, 1 }, + { "/system/bin/mpstat", NULL, SC(1), NULL, 0, 0, 0, 0 }, + { "/system/xbin/mpstat", NULL, SC(1), NULL, 0, 0, 0, 0 }, + { "/system/bin/df", NULL, SC(1), NULL, 0, 0, 0, 0 }, + { "/system/xbin/df", NULL, SC(1), NULL, 0, 0, 0, 0 }, + { "/system/bin/iostat", NULL, SC(SC_0), NULL, 0, 0, 0, 0 }, + { "/system/xbin/iostat", NULL, SC(SC_0), NULL, 0, 0, 0, 0 }, + { "/system/bin/uptime", NULL, SC(SC_0), NULL, 0, 0, 0, 1 }, + { "/system/xbin/uptime", NULL, SC(SC_0), NULL, 0, 0, 0, 1 }, + { "/system/bin/ps", "aux", SC(0.3), NULL, 0, 0, 0, 1 }, + { "/system/xbin/ps", "aux", SC(0.3), NULL, 0, 0, 0, 1 }, + { "/system/bin/arp", "-a", SC(0.1), NULL, 0, 0, 0, 1 }, + { "/system/xbin/arp", "-a", SC(0.1), NULL, 0, 0, 0, 1 }, + + // For Termux + { "@TERMUX_PREFIX@/bin/vmstat", "-s", SC(-3), NULL, 0, 0, 0, 1 }, + { "@TERMUX_PREFIX@/bin/applets/vmstat", "-s", SC(-3), NULL, 0, 0, 0, 1 }, + { "@TERMUX_PREFIX@/bin/netstat", "-s", SC(2), NULL, 0, 0, 0, 1 }, + { "@TERMUX_PREFIX@/bin/applets/netstat", "-s", SC(2), NULL, 0, 0, 0, 1 }, + { "@TERMUX_PREFIX@/bin/mpstat", NULL, SC(1), NULL, 0, 0, 0, 0 }, + { "@TERMUX_PREFIX@/bin/applets/mpstat", NULL, SC(1), NULL, 0, 0, 0, 0 }, + { "@TERMUX_PREFIX@/bin/df", NULL, SC(1), NULL, 0, 0, 0, 0 }, + { "@TERMUX_PREFIX@/bin/applets/df", NULL, SC(1), NULL, 0, 0, 0, 0 }, + { "@TERMUX_PREFIX@/bin/iostat", NULL, SC(SC_0), NULL, 0, 0, 0, 0 }, + { "@TERMUX_PREFIX@/bin/applets/iostat", NULL, SC(SC_0), NULL, 0, 0, 0, 0 }, + { "@TERMUX_PREFIX@/bin/uptime", NULL, SC(SC_0), NULL, 0, 0, 0, 1 }, + { "@TERMUX_PREFIX@/bin/applets/uptime", NULL, SC(SC_0), NULL, 0, 0, 0, 1 }, + { "@TERMUX_PREFIX@/bin/ps", "aux", SC(0.3), NULL, 0, 0, 0, 1 }, + { "@TERMUX_PREFIX@/bin/applets/ps", "aux", SC(0.3), NULL, 0, 0, 0, 1 }, + { "@TERMUX_PREFIX@/bin/arp", "-a", SC(0.1), NULL, 0, 0, 0, 1 }, + { "@TERMUX_PREFIX@/bin/applets/arp", "-a", SC(0.1), NULL, 0, 0, 0, 1 }, + { "/bin/vmstat", "-s", SC(-3), NULL, 0, 0, 0, 1 }, { "/usr/bin/vmstat", "-s", SC(-3), NULL, 0, 0, 0, 0}, { "/bin/vmstat", "-c", SC(-3), NULL, 0, 0, 0, 1 }, diff -uNr libgcrypt-1.8.1/src/fips.c libgcrypt-1.8.1.mod/src/fips.c --- libgcrypt-1.8.1/src/fips.c 2016-04-07 18:30:08.000000000 +0300 +++ libgcrypt-1.8.1.mod/src/fips.c 2017-09-12 10:36:08.292994171 +0300 @@ -36,7 +36,7 @@ /* The name of the file used to force libgcrypt into fips mode. */ -#define FIPS_FORCE_FILE "/etc/gcrypt/fips_enabled" +#define FIPS_FORCE_FILE "@TERMUX_PREFIX@/etc/gcrypt/fips_enabled" /* The states of the finite state machine used in fips mode. */ diff -uNr libgcrypt-1.8.1/src/hwfeatures.c libgcrypt-1.8.1.mod/src/hwfeatures.c --- libgcrypt-1.8.1/src/hwfeatures.c 2017-06-24 14:34:29.000000000 +0300 +++ libgcrypt-1.8.1.mod/src/hwfeatures.c 2017-09-12 10:37:03.892994132 +0300 @@ -33,7 +33,7 @@ #include "hwf-common.h" /* The name of a file used to globally disable selected features. */ -#define HWF_DENY_FILE "/etc/gcrypt/hwf.deny" +#define HWF_DENY_FILE "@TERMUX_PREFIX@/etc/gcrypt/hwf.deny" /* A table to map hardware features to a string. */ static struct ================================================ FILE: packages/libgd/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://libgd.github.io/ TERMUX_PKG_DESCRIPTION="GD is an open source code library for the dynamic creation of images by programmers" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_VERSION=2.2.5 TERMUX_PKG_REVISION=6 TERMUX_PKG_SHA256=a66111c9b4a04e818e9e2a37d7ae8d4aae0939a100a36b0ffb52c706a09074b5 TERMUX_PKG_SRCURL=https://github.com/libgd/libgd/releases/download/gd-${TERMUX_PKG_VERSION}/libgd-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="freetype, fontconfig, libiconv, libjpeg-turbo, libpng, libtiff, libwebp, zlib" TERMUX_PKG_BREAKS="libgd-dev" TERMUX_PKG_REPLACES="libgd-dev" # Disable vpx support for now, look at https://github.com/gagern/libgd/commit/d41eb72cd4545c394578332e5c102dee69e02ee8 # for enabling: TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--without-vpx --without-x" ================================================ FILE: packages/libgfshare/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.digital-scurf.org/software/libgfshare TERMUX_PKG_DESCRIPTION="Utilities for multi-way secret-sharing" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=2.0.0 TERMUX_PKG_REVISION=6 TERMUX_PKG_SRCURL=http://www.digital-scurf.org/files/libgfshare/libgfshare-$TERMUX_PKG_VERSION.tar.bz2 TERMUX_PKG_SHA256=86f602860133c828356b7cf7b8c319ba9b27adf70a624fe32275ba1ed268331f TERMUX_PKG_BREAKS="libgfshare-dev" TERMUX_PKG_REPLACES="libgfshare-dev" termux_step_post_configure() { gcc -DHAVE_CONFIG_H \ -I. \ -I"$TERMUX_PKG_SRCDIR" \ -I"$TERMUX_PKG_SRCDIR"/include \ "$TERMUX_PKG_SRCDIR"/src/gfshare_maketable.c \ -o gfshare_maketable touch -d "next hour" gfshare_maketable } ================================================ FILE: packages/libgit2/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://libgit2.github.com/ TERMUX_PKG_DESCRIPTION="C library implementing Git core methods" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=0.28.3 TERMUX_PKG_SRCURL=https://github.com/libgit2/libgit2/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=ee5344730fe11ce7c86646e19c2d257757be293f5a567548d398fb3af8b8e53b TERMUX_PKG_DEPENDS="libcurl, openssl, libssh2, zlib" TERMUX_PKG_BREAKS="libgit2-dev" TERMUX_PKG_REPLACES="libgit2-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-DBUILD_CLAR=OFF" ================================================ FILE: packages/libgit2/fix-etc-dir-path.patch ================================================ diff -uNr libgit2-0.26.0/src/sysdir.c libgit2-0.26.0.mod/src/sysdir.c --- libgit2-0.26.0/src/sysdir.c 2017-06-14 14:31:20.000000000 +0300 +++ libgit2-0.26.0.mod/src/sysdir.c 2017-09-12 11:57:35.382990676 +0300 @@ -30,7 +30,7 @@ #ifdef GIT_WIN32 return git_win32__find_system_dirs(out, L"etc\\"); #else - return git_buf_sets(out, "/etc"); + return git_buf_sets(out, "@TERMUX_PREFIX@/etc"); #endif } ================================================ FILE: packages/libgmime/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://spruce.sourceforge.net/gmime/ TERMUX_PKG_DESCRIPTION="MIME message parser and creator" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=3.2.5 TERMUX_PKG_SRCURL=https://download.gnome.org/sources/gmime/${TERMUX_PKG_VERSION:0:3}/gmime-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=fb7556501f85c3bf3e65fdd82697cbc4fa4b55dccd33ad14239ce0197e78ba59 TERMUX_PKG_DEPENDS="glib, libffi, libiconv, libidn2, zlib" TERMUX_PKG_BREAKS="libgmime-dev" TERMUX_PKG_REPLACES="libgmime-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" ac_cv_have_iconv_detect_h=yes --with-libiconv=gnu --disable-glibtest --disable-crypto " ================================================ FILE: packages/libgmime/iconv-detect.h.patch ================================================ diff -N -a -u -r ../gmime-2.6.23/iconv-detect.h ./iconv-detect.h --- ../gmime-2.6.23/iconv-detect.h 1970-01-01 01:00:00.000000000 +0100 +++ ./iconv-detect.h 2017-04-06 18:24:52.423896227 +0200 @@ -0,0 +1,5 @@ +/* This is an auto-generated header, DO NOT EDIT! */ + +#define ICONV_ISO_INT_FORMAT "iso-%u-%u" +#define ICONV_ISO_STR_FORMAT "iso-%u-%s" +#define ICONV_10646 "UCS-4BE" ================================================ FILE: packages/libgmp/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://gmplib.org/ TERMUX_PKG_DESCRIPTION="Library for arbitrary precision arithmetic" TERMUX_PKG_LICENSE="LGPL-3.0" TERMUX_PKG_VERSION=6.1.2 TERMUX_PKG_REVISION=4 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gmp/gmp-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912 TERMUX_PKG_BREAKS="libgmp-dev" TERMUX_PKG_REPLACES="libgmp-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-cxx" termux_step_pre_configure() { # the cxx tests fail because it won't link properly without this CXXFLAGS+=" -L$TERMUX_PREFIX/lib" } ================================================ FILE: packages/libgnutls/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnutls.org/ TERMUX_PKG_DESCRIPTION="Secure communications library implementing the SSL, TLS and DTLS protocols and technologies around them" TERMUX_PKG_LICENSE="LGPL-2.1" TERMUX_PKG_VERSION=3.6.11.1 TERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/gnutls/v${TERMUX_PKG_VERSION:0:3}/gnutls-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=fbba12f3db9a55dbf027e14111755817ec44b57eabec3e8089aac8ac6f533cf8 TERMUX_PKG_DEPENDS="libgmp, libnettle, ca-certificates, libidn2, libunistring" TERMUX_PKG_BREAKS="libgnutls-dev" TERMUX_PKG_REPLACES="libgnutls-dev" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --enable-cxx --disable-hardware-acceleration --disable-openssl-compatibility --with-default-trust-store-file=$TERMUX_PREFIX/etc/tls/cert.pem --with-system-priority-file=${TERMUX_PREFIX}/etc/gnutls/default-priorities --with-included-libtasn1 --without-p11-kit " termux_step_pre_configure() { CFLAGS+=" -DNO_INLINE_GETPASS=1" } ================================================ FILE: packages/libgnutls/gnutls.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="bin/ share/man/man1/" TERMUX_SUBPKG_DESCRIPTION="Commandline utilities for interfacing with the gnutls library" ================================================ FILE: packages/libgpg-error/atexit.patch ================================================ --- src/src/estream.c 2017-02-28 09:11:05.000000000 +0000 +++ ./_patches/estream.c 2017-05-14 23:41:57.522426391 +0000 @@ -510,7 +510,11 @@ { static int initialized; +#ifdef __ANDROID__ + if (initialized < 2) +#else if (!initialized) +#endif { initialized = 1; atexit (do_deinit); ================================================ FILE: packages/libgpg-error/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnupg.org/related_software/libgpg-error/ TERMUX_PKG_DESCRIPTION="Small library that defines common error values for all GnuPG components" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=1.36 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SHA256=babd98437208c163175c29453f8681094bcaf92968a15cafb1a276076b33c97c TERMUX_PKG_BREAKS="libgpg-error-dev" TERMUX_PKG_REPLACES="libgpg-error-dev" TERMUX_PKG_RM_AFTER_INSTALL="share/common-lisp" termux_step_post_extract_package() { # Upstream only has Android definitions for platform-specific lock objects. # See https://lists.gnupg.org/pipermail/gnupg-devel/2014-January/028203.html # for how to generate a lock-obj header file on devices. # For aarch64 this was generated on a device: cp $TERMUX_PKG_BUILDER_DIR/lock-obj-pub.aarch64-unknown-linux-android.h $TERMUX_PKG_SRCDIR/src/syscfg/ if [ $TERMUX_ARCH = i686 ]; then # Android i686 has same config as arm (verified by generating a file on a i686 device): cp $TERMUX_PKG_SRCDIR/src/syscfg/lock-obj-pub.arm-unknown-linux-androideabi.h \ $TERMUX_PKG_SRCDIR/src/syscfg/lock-obj-pub.linux-android.h elif [ $TERMUX_ARCH = x86_64 ]; then # FIXME: Generate on device. cp $TERMUX_PKG_BUILDER_DIR/lock-obj-pub.aarch64-unknown-linux-android.h \ $TERMUX_PKG_SRCDIR/src/syscfg/lock-obj-pub.linux-android.h fi } termux_step_pre_configure() { autoreconf -fi # USE_POSIX_THREADS_WEAK is being enabled for on-device build and causes # errors, so force-disable it. sed -i 's/USE_POSIX_THREADS_WEAK/DONT_USE_POSIX_THREADS_WEAK/g' configure } ================================================ FILE: packages/libgpg-error/gawk5.0-support.patch ================================================ From 7865041c77f4f7005282f10f9b6666b19072fbdf Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Mon, 15 Apr 2019 15:10:44 +0900 Subject: [PATCH] awk: Prepare for Gawk 5.0. * src/Makefile.am: Use pkg_namespace (instead of namespace). * src/mkerrnos.awk: Likewise. * lang/cl/mkerrcodes.awk: Don't escape # in regexp. * src/mkerrcodes.awk, src/mkerrcodes1.awk, src/mkerrcodes2.awk: Ditto. -- In Gawk 5.0, regexp routines are replaced by Gnulib implementation, which only allows escaping specific characters. GnuPG-bug-id: 4459 Reported-by: Marius Schamschula Signed-off-by: NIIBE Yutaka --- lang/cl/mkerrcodes.awk | 2 +- src/Makefile.am | 2 +- src/mkerrcodes.awk | 2 +- src/mkerrcodes1.awk | 2 +- src/mkerrcodes2.awk | 2 +- src/mkerrnos.awk | 2 +- src/mkstrtable.awk | 10 +++++----- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lang/cl/mkerrcodes.awk b/lang/cl/mkerrcodes.awk index ae29043..9a1fc18 100644 --- a/lang/cl/mkerrcodes.awk +++ b/lang/cl/mkerrcodes.awk @@ -122,7 +122,7 @@ header { } !header { - sub (/\#.+/, ""); + sub (/#.+/, ""); sub (/[ ]+$/, ""); # Strip trailing space and tab characters. if (/^$/) diff --git a/src/Makefile.am b/src/Makefile.am index ce1b882..f2590cb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -293,7 +293,7 @@ code-from-errno.h: mkerrcodes$(EXEEXT_FOR_BUILD) Makefile errnos-sym.h: Makefile mkstrtable.awk errnos.in $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \ - -v prefix=GPG_ERR_ -v namespace=errnos_ \ + -v prefix=GPG_ERR_ -v pkg_namespace=errnos_ \ $(srcdir)/errnos.in >$@ diff --git a/src/mkerrcodes.awk b/src/mkerrcodes.awk index 46d436c..e9c857c 100644 --- a/src/mkerrcodes.awk +++ b/src/mkerrcodes.awk @@ -85,7 +85,7 @@ header { } !header { - sub (/\#.+/, ""); + sub (/#.+/, ""); sub (/[ ]+$/, ""); # Strip trailing space and tab characters. if (/^$/) diff --git a/src/mkerrcodes1.awk b/src/mkerrcodes1.awk index a771a73..4578e29 100644 --- a/src/mkerrcodes1.awk +++ b/src/mkerrcodes1.awk @@ -81,7 +81,7 @@ header { } !header { - sub (/\#.+/, ""); + sub (/#.+/, ""); sub (/[ ]+$/, ""); # Strip trailing space and tab characters. if (/^$/) diff --git a/src/mkerrcodes2.awk b/src/mkerrcodes2.awk index ea58503..188f7a4 100644 --- a/src/mkerrcodes2.awk +++ b/src/mkerrcodes2.awk @@ -91,7 +91,7 @@ header { } !header { - sub (/\#.+/, ""); + sub (/#.+/, ""); sub (/[ ]+$/, ""); # Strip trailing space and tab characters. if (/^$/) diff --git a/src/mkerrnos.awk b/src/mkerrnos.awk index f79df66..15b1aad 100644 --- a/src/mkerrnos.awk +++ b/src/mkerrnos.awk @@ -83,7 +83,7 @@ header { } !header { - sub (/\#.+/, ""); + sub (/#.+/, ""); sub (/[ ]+$/, ""); # Strip trailing space and tab characters. if (/^$/) diff --git a/src/mkstrtable.awk b/src/mkstrtable.awk index c9de9c1..285e45f 100644 --- a/src/mkstrtable.awk +++ b/src/mkstrtable.awk @@ -77,7 +77,7 @@ # # The variable prefix can be used to prepend a string to each message. # -# The variable namespace can be used to prepend a string to each +# The variable pkg_namespace can be used to prepend a string to each # variable and macro name. BEGIN { @@ -102,7 +102,7 @@ header { print "/* The purpose of this complex string table is to produce"; print " optimal code with a minimum of relocations. */"; print ""; - print "static const char " namespace "msgstr[] = "; + print "static const char " pkg_namespace "msgstr[] = "; header = 0; } else @@ -110,7 +110,7 @@ header { } !header { - sub (/\#.+/, ""); + sub (/#.+/, ""); sub (/[ ]+$/, ""); # Strip trailing space and tab characters. if (/^$/) @@ -150,7 +150,7 @@ END { else print " gettext_noop (\"" last_msgstr "\");"; print ""; - print "static const int " namespace "msgidx[] ="; + print "static const int " pkg_namespace "msgidx[] ="; print " {"; for (i = 0; i < coded_msgs; i++) print " " pos[i] ","; @@ -158,7 +158,7 @@ END { print " };"; print ""; print "static GPG_ERR_INLINE int"; - print namespace "msgidxof (int code)"; + print pkg_namespace "msgidxof (int code)"; print "{"; print " return (0 ? 0"; -- 2.21.0 ================================================ FILE: packages/libgpg-error/lock-obj-pub.aarch64-unknown-linux-android.h ================================================ ## lock-obj-pub.armv8l-unknown-linux-gnu.h ## File created by gen-posix-lock-obj - DO NOT EDIT ## To be included by mkheader into gpg-error.h typedef struct { long _vers; union { volatile char _priv[40]; long _x_align; long *_xp_align; } u; } gpgrt_lock_t; #define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \ 0,0,0,0,0,0,0,0, \ 0,0,0,0,0,0,0,0, \ 0,0,0,0,0,0,0,0, \ 0,0,0,0,0,0,0,0}}} ## ## Local Variables: ## mode: c ## buffer-read-only: t ## End: ## ================================================ FILE: packages/libgraphite/CMakeLists.txt.patch ================================================ Fixes "undefined reference to '__cxa_call_unexpected" on arm. diff -u -r ../graphite-1.3.9/CMakeLists.txt ./CMakeLists.txt --- ../graphite-1.3.9/CMakeLists.txt 2016-11-11 10:53:21.000000000 +0100 +++ ./CMakeLists.txt 2017-01-19 11:54:59.187814558 +0100 @@ -58,7 +58,6 @@ message(STATUS "Using vm machine type: ${GRAPHITE2_VM_TYPE}") add_subdirectory(src) -add_subdirectory(tests) add_subdirectory(doc) if (NOT (GRAPHITE2_NSEGCACHE OR GRAPHITE2_NFILEFACE)) add_subdirectory(gr2fonttest) ================================================ FILE: packages/libgraphite/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://github.com/silnrsi/graphite TERMUX_PKG_DESCRIPTION="Font system for multiple languages" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=1.3.13 TERMUX_PKG_REVISION=3 TERMUX_PKG_SRCURL=https://github.com/silnrsi/graphite/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=2f9f609deeddfe2b193502adc8df3b0396694b799a433c36e85fd1242e654cd9 TERMUX_PKG_DEPENDS="libc++" TERMUX_PKG_BREAKS="libgraphite-dev" TERMUX_PKG_REPLACES="libgraphite-dev" TERMUX_PKG_RM_AFTER_INSTALL="bin/gr2fonttest" ================================================ FILE: packages/libgraphite/src-CMakeLists.txt.patch ================================================ diff -u -r ../graphite-1.3.9/src/CMakeLists.txt ./src/CMakeLists.txt --- ../graphite-1.3.9/src/CMakeLists.txt 2016-11-11 10:53:21.000000000 +0100 +++ ./src/CMakeLists.txt 2017-01-19 05:12:08.903024071 +0100 @@ -152,4 +152,4 @@ install(TARGETS graphite2 EXPORT graphite2 LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} PUBLIC_HEADER DESTINATION include/graphite2 RUNTIME DESTINATION bin) -install(EXPORT graphite2 DESTINATION share/graphite2 NAMESPACE gr2_) +install(EXPORT graphite2 DESTINATION lib/cmake/graphite2 NAMESPACE gr2_) ================================================ FILE: packages/libgrpc/CMakeLists.txt.diff ================================================ diff -u -r ../cache/checkout-1.20.1/CMakeLists.txt ./CMakeLists.txt --- ../cache/checkout-1.20.1/CMakeLists.txt 2019-05-05 19:34:14.719680525 +0000 +++ ./CMakeLists.txt 2019-05-05 19:44:36.428274714 +0000 @@ -206,7 +206,7 @@ COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE} ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR} --cpp_out=${_gRPC_PROTO_GENS_DIR} - --plugin=protoc-gen-grpc=${_gRPC_CPP_PLUGIN} + --plugin=protoc-gen-grpc=@PATH_TO_PLUGIN@ ${_protobuf_include_path} ${REL_FIL} DEPENDS ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin ================================================ FILE: packages/libgrpc/CMakeLists.txt.patch ================================================ --- ./CMakeLists.txt 2017-06-28 01:16:01.000000000 +0530 +++ ../CMakeLists.txt 2017-07-08 22:10:35.062570096 +0530 @@ -272,7 +272,7 @@ if(_gRPC_PLATFORM_MAC) set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m pthread) elseif(UNIX) - set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} rt m pthread) + set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m) endif() if(WIN32 AND MSVC) @@ -813,12 +813,6 @@ target_link_libraries(gpr ${_gRPC_ALLTARGETS_LIBRARIES} ) -if (_gRPC_PLATFORM_ANDROID) - target_link_libraries(gpr - android - log - ) -endif (_gRPC_PLATFORM_ANDROID) foreach(_hdr include/grpc/support/alloc.h ================================================ FILE: packages/libgrpc/Makefile.patch ================================================ diff -u -r ../grpc-1.8.3/Makefile ./Makefile --- ../grpc-1.8.3/Makefile 2017-12-31 20:38:59.000000000 +0000 +++ ./Makefile 2018-01-13 00:48:23.449627239 +0000 @@ -369,7 +369,7 @@ endif ifeq ($(SYSTEM),Linux) -LIBS = dl rt m pthread +LIBS = dl m LDFLAGS += -pthread endif ================================================ FILE: packages/libgrpc/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://grpc.io/ TERMUX_PKG_DESCRIPTION="High performance, open source, general RPC framework that puts mobile and HTTP/2 first" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas" TERMUX_PKG_VERSION=1.25.0 TERMUX_PKG_DEPENDS="libc++, openssl, protobuf, c-ares, zlib" TERMUX_PKG_BREAKS="libgrpc-dev" TERMUX_PKG_REPLACES="libgrpc-dev" TERMUX_PKG_BUILD_DEPENDS="libprotobuf" TERMUX_PKG_HOSTBUILD=true TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DCMAKE_STRIP=$(which strip) -DGIT_EXECUTABLE=$(which git) -DBUILD_SHARED_LIBS=ON -DgRPC_CARES_PROVIDER=package -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_SSL_PROVIDER=package -DgRPC_ZLIB_PROVIDER=package -DRUN_HAVE_POSIX_REGEX=0 -DRUN_HAVE_STD_REGEX=0 -DRUN_HAVE_STEADY_CLOCK=0 -DProtobuf_PROTOC_LIBRARY=$TERMUX_PREFIX/lib/libprotoc.so " termux_step_extract_package() { local CHECKED_OUT_FOLDER=$TERMUX_PKG_CACHEDIR/checkout-$TERMUX_PKG_VERSION if [ ! -d $CHECKED_OUT_FOLDER ]; then local TMP_CHECKOUT=$TERMUX_PKG_TMPDIR/tmp-checkout rm -Rf $TMP_CHECKOUT mkdir -p $TMP_CHECKOUT git clone --depth 1 \ --branch v$TERMUX_PKG_VERSION \ https://github.com/grpc/grpc.git \ $TMP_CHECKOUT cd $TMP_CHECKOUT git submodule update --init # --depth 1 mv $TMP_CHECKOUT $CHECKED_OUT_FOLDER fi mkdir $TERMUX_PKG_SRCDIR cd $TERMUX_PKG_SRCDIR cp -Rf $CHECKED_OUT_FOLDER/* . termux_setup_protobuf } termux_step_host_build() { termux_setup_cmake cd $TERMUX_PKG_SRCDIR export LD=gcc export LDXX=g++ # -Wno-error=class-memaccess is used to avoid # src/core/lib/security/credentials/oauth2/oauth2_credentials.cc:336:61: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct grpc_oauth2_token_fetcher_credentials’; use assignment or value-initialization instead [-Werror=class-memaccess] # memset(c, 0, sizeof(grpc_oauth2_token_fetcher_credentials)); # when building version 1.17.2: CXXFLAGS="-Wno-error=class-memaccess" \ CFLAGS="-Wno-implicit-fallthrough" \ make -j $TERMUX_MAKE_PROCESSES \ HAS_SYSTEM_PROTOBUF=false \ prefix=$TERMUX_PKG_HOSTBUILD_DIR \ install make clean } termux_step_pre_configure() { sed "s|@PATH_TO_PLUGIN@|$TERMUX_PKG_HOSTBUILD_DIR/bin/grpc_cpp_plugin|g" \ $TERMUX_PKG_BUILDER_DIR/CMakeLists.txt.diff \ | patch -p1 export GRPC_CROSS_COMPILE=true } ================================================ FILE: packages/libgrpc/fix-arg-list-too-long.patch.beforehostbuild ================================================ --- a/Makefile 2018-06-26 11:07:45.948160976 +0200 +++ b/Makefile 2019-06-26 11:04:25.798966336 +0200 @@ -2820,13 +2820,15 @@ install-headers_c: $(E) "[INSTALL] Installing public C headers" - $(Q) $(foreach h, $(PUBLIC_HEADERS_C), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1 - $(Q) $(foreach h, $(PUBLIC_HEADERS_C), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1 + $(Q) for h in $(PUBLIC_HEADERS_C); do \ + $(INSTALL) -D $$h $(prefix)/$$h ; \ + done install-headers_cxx: $(E) "[INSTALL] Installing public C++ headers" - $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1 - $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1 + $(Q) for h in $(PUBLIC_HEADERS_CXX); do \ + $(INSTALL) -D $$h $(prefix)/$$h ; \ + done install-static: install-static_c install-static_cxx --- a/templates/Makefile.template 2019-06-26 12:38:36.777292299 +0200 +++ b/templates/Makefile.template 2019-06-26 12:48:35.668550020 +0200 @@ -1302,13 +1302,15 @@ install-headers_c: $(E) "[INSTALL] Installing public C headers" - $(Q) $(foreach h, $(PUBLIC_HEADERS_C), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1 - $(Q) $(foreach h, $(PUBLIC_HEADERS_C), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1 + $(Q) for h in $(PUBLIC_HEADERS_C); do \ + $(INSTALL) -D $$h $(prefix)/$$h ; \ + done install-headers_cxx: $(E) "[INSTALL] Installing public C++ headers" - $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1 - $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1 + $(Q) for h in $(PUBLIC_HEADERS_CXX); do \ + $(INSTALL) -D $$h $(prefix)/$$h ; \ + done install-static: install-static_c install-static_cxx ================================================ FILE: packages/libgrpc/log_android.cc.patch ================================================ diff -u -r ../cache/checkout-1.14.1/src/core/lib/gpr/log_android.cc ./src/core/lib/gpr/log_android.cc --- ../cache/checkout-1.14.1/src/core/lib/gpr/log_android.cc 2018-08-21 11:52:18.904711327 +0000 +++ ./src/core/lib/gpr/log_android.cc 2018-08-21 12:04:56.616148484 +0000 @@ -27,18 +27,6 @@ #include #include -static android_LogPriority severity_to_log_priority(gpr_log_severity severity) { - switch (severity) { - case GPR_LOG_SEVERITY_DEBUG: - return ANDROID_LOG_DEBUG; - case GPR_LOG_SEVERITY_INFO: - return ANDROID_LOG_INFO; - case GPR_LOG_SEVERITY_ERROR: - return ANDROID_LOG_ERROR; - } - return ANDROID_LOG_DEFAULT; -} - void gpr_log(const char* file, int line, gpr_log_severity severity, const char* format, ...) { /* Avoid message construction if gpr_log_message won't log */ @@ -67,7 +55,7 @@ asprintf(&output, "%s:%d] %s", display_file, args->line, args->message); - __android_log_write(severity_to_log_priority(args->severity), "GRPC", output); + // __android_log_write(severity_to_log_priority(args->severity), "GRPC", output); /* allocated by asprintf => use free, not gpr_free */ free(output); ================================================ FILE: packages/libgrpc/src-core-lib-grpc-wrap_memcpy.cc.patch ================================================ diff -u -r ../cache/checkout-1.12.0/src/core/lib/gpr/wrap_memcpy.cc ./src/core/lib/gpr/wrap_memcpy.cc --- ../cache/checkout-1.12.0/src/core/lib/gpr/wrap_memcpy.cc 2018-05-22 13:07:29.307092222 +0000 +++ ./src/core/lib/gpr/wrap_memcpy.cc 2018-05-23 22:21:40.602239126 +0000 @@ -28,7 +28,7 @@ extern "C" { #ifdef __linux__ -#if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT) +#if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT) && !defined(__ANDROID__) __asm__(".symver memcpy,memcpy@GLIBC_2.2.5"); void* __wrap_memcpy(void* destination, const void* source, size_t num) { return memcpy(destination, source, num); ================================================ FILE: packages/libgsasl/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gsasl TERMUX_PKG_DESCRIPTION="GNU SASL library" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.8.1 TERMUX_PKG_SHA256=19e2f90525c531010918c50bb1febef0d7115d620150cc66153b9ce73ff814e6 TERMUX_PKG_SRCURL=https://download.savannah.nongnu.org/releases/gsasl/libgsasl-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_DEPENDS="libidn" TERMUX_PKG_BREAKS="libgsasl-dev" TERMUX_PKG_REPLACES="libgsasl-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--without-libgcrypt" ================================================ FILE: packages/libical/CMakeLists.txt.patch ================================================ Avoid opportunistic linkage against libdb and libicu. diff -u -r ../libical-3.0.1/CMakeLists.txt ./CMakeLists.txt --- ../libical-3.0.1/CMakeLists.txt 2017-11-19 14:32:53.000000000 +0000 +++ ./CMakeLists.txt 2017-12-08 23:54:59.745527096 +0000 @@ -154,47 +154,6 @@ set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS True) endif() -# libicu is highly recommended for RSCALE support -# libicu can be found at http://www.icu-project.org -# RSCALE info at http://tools.ietf.org/html/rfc7529 -find_package(ICU) -set_package_properties(ICU PROPERTIES - TYPE RECOMMENDED - PURPOSE "For RSCALE (RFC7529) support" -) -add_feature_info( - "RSCALE support (RFC7529)" - ICU_FOUND - "build in RSCALE support" -) -if(ICU_FOUND) - set(REQUIRES_PRIVATE_ICU "Requires.private: icu-i18n") #for libical.pc - set(HAVE_LIBICU 1) - if(ICU_MAJOR_VERSION VERSION_GREATER 50) - set(HAVE_ICU_DANGI TRUE) - else() - set(HAVE_ICU_DANGI FALSE) - endif() -endif() -if(ICU_I18N_FOUND) - set(HAVE_LIBICU_I18N 1) -endif() - -# compile in Berkeley DB support -find_package(BDB) -set_package_properties(BDB PROPERTIES - TYPE OPTIONAL - PURPOSE "For Berkeley DB storage support" -) -add_feature_info( - "Berkeley DB storage support" - BDB_FOUND - "build in support for Berkeley DB storage" -) -if(BDB_FOUND) - set(HAVE_BDB True) -endif() - # MSVC specific definitions if(WIN32) if(MSVC) ================================================ FILE: packages/libical/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://libical.github.io/libical/ TERMUX_PKG_DESCRIPTION="Libical is an Open Source implementation of the iCalendar protocols and protocol data units" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=3.0.6 TERMUX_PKG_SRCURL=https://github.com/libical/libical/releases/download/v$TERMUX_PKG_VERSION/libical-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=5c8a21c2b732ece4a33e5c862970b4f35a8548bbcda50de5695f6fc211ac4d97 TERMUX_PKG_DEPENDS="libc++, libxml2" TERMUX_PKG_BREAKS="libical-dev" TERMUX_PKG_REPLACES="libical-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DSHARED_ONLY=true -DICAL_GLIB=false -DUSE_BUILTIN_TZDATA=true -DPERL_EXECUTABLE=/usr/bin/perl" ================================================ FILE: packages/libical/src-libical-CMakeLists.txt.patch ================================================ diff -u -r ../libical-3.0.1/src/libical/CMakeLists.txt ./src/libical/CMakeLists.txt --- ../libical-3.0.1/src/libical/CMakeLists.txt 2017-11-19 15:32:53.000000000 +0100 +++ ./src/libical/CMakeLists.txt 2017-12-09 22:14:42.254898817 +0100 @@ -17,7 +17,7 @@ include_directories(${ICU_INCLUDE_DIR}) endif() -set(PACKAGE_DATA_DIR "\\\"${CMAKE_INSTALL_PREFIX}/share/libical\\\"") +set(PACKAGE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/libical") add_definitions(-DPACKAGE_DATA_DIR="${PACKAGE_DATA_DIR}") set(ICALSCRIPTS ${CMAKE_SOURCE_DIR}/scripts/) ================================================ FILE: packages/libiconv/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/libiconv/ TERMUX_PKG_DESCRIPTION="An implementation of iconv()" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=1.16 TERMUX_PKG_REVISION=3 TERMUX_PKG_SRCURL=https://ftp.gnu.org/pub/gnu/libiconv/libiconv-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04 TERMUX_PKG_BREAKS="libandroid-support (<= 24), libiconv-dev, libandroid-support-dev" TERMUX_PKG_REPLACES="libandroid-support (<= 24), libiconv-dev, libandroid-support-dev" # Enable extra encodings (such as CP437) needed by some programs: TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-extra-encodings" ================================================ FILE: packages/libiconv/iconv.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="bin/iconv" TERMUX_SUBPKG_DESCRIPTION="Utility converting between different character encodings" ================================================ FILE: packages/libicu/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://site.icu-project.org/home TERMUX_PKG_DESCRIPTION='International Components for Unicode library' TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas" TERMUX_PKG_VERSION=65.1 TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/icu4c-${TERMUX_PKG_VERSION//./_}-src.tar.xz TERMUX_PKG_SHA256=bd002bdeb2e854a224c2617ba1d0e9ccea7fde3065682333902e234dce4dd380 TERMUX_PKG_DEPENDS="libc++" TERMUX_PKG_BREAKS="libicu-dev" TERMUX_PKG_REPLACES="libicu-dev" TERMUX_PKG_HOSTBUILD=true TERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS="--disable-samples --disable-tests" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-samples --disable-tests --with-cross-build=$TERMUX_PKG_HOSTBUILD_DIR" termux_step_post_extract_package() { TERMUX_PKG_SRCDIR+="/source" } ================================================ FILE: packages/libicu/icu-devtools.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="bin/ share/man/man1/ share/man/man8" TERMUX_SUBPKG_DESCRIPTION="Development utilities for International Components for Unicode" ================================================ FILE: packages/libid3tag/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.underbit.com/products/mad/ TERMUX_PKG_DESCRIPTION="MAD ID3 tag manipulation library" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=0.15.1b TERMUX_PKG_REVISION=3 TERMUX_PKG_SRCURL=ftp://ftp.mars.org/pub/mpeg/libid3tag-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151 TERMUX_PKG_DEPENDS="zlib" TERMUX_PKG_BREAKS="libid3tag-dev" TERMUX_PKG_REPLACES="libid3tag-dev" ================================================ FILE: packages/libidn/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/libidn/ TERMUX_PKG_DESCRIPTION="GNU Libidn library, implementation of IETF IDN specifications" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=1.35 TERMUX_PKG_REVISION=2 TERMUX_PKG_SHA256=f11af1005b46b7b15d057d7f107315a1ad46935c7fcdf243c16e46ec14f0fe1e TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/libidn/libidn-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="libiconv" TERMUX_PKG_BREAKS="libidn-dev" TERMUX_PKG_REPLACES="libidn-dev" # Remove the idn tool for now, add it as subpackage if desired:: TERMUX_PKG_RM_AFTER_INSTALL="bin/idn share/man/man1/idn.1 share/emacs" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-ld-version-script" ================================================ FILE: packages/libidn2/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/libidn/#libidn2 TERMUX_PKG_DESCRIPTION="Free software implementation of IDNA2008, Punycode and TR46" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="lokesh @hax4us" TERMUX_PKG_VERSION=2.3.0 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/libidn/libidn2-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=e1cb1db3d2e249a6a3eb6f0946777c2e892d5c5dc7bd91c74394fc3a01cab8b5 TERMUX_PKG_DEPENDS="libunistring, libandroid-support" TERMUX_PKG_BREAKS="libidn2-dev" TERMUX_PKG_REPLACES="libidn2-dev" ================================================ FILE: packages/libisl/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://isl.gforge.inria.fr/ TERMUX_PKG_DESCRIPTION="Library for manipulating sets and relations of integer points bounded by linear constraints" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=0.22 TERMUX_PKG_SHA256=6c8bc56c477affecba9c59e2c9f026967ac8bad01b51bdd07916db40a517b9fa TERMUX_PKG_SRCURL=http://isl.gforge.inria.fr/isl-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_DEPENDS="libgmp" TERMUX_PKG_BREAKS="libisl-dev" TERMUX_PKG_REPLACES="libisl-dev" ================================================ FILE: packages/libjansson/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.digip.org/jansson/ TERMUX_PKG_DESCRIPTION="C library for encoding, decoding and manipulating JSON data" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=2.12 TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=76260d30e9bbd0ef392798525e8cd7fe59a6450c54ca6135672e3cd6a1642941 TERMUX_PKG_BREAKS="libjansson-dev" TERMUX_PKG_REPLACES="libjansson-dev" TERMUX_PKG_SRCURL=https://github.com/akheron/jansson/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { autoreconf -fi } ================================================ FILE: packages/libjasper/CMakeLists.txt.patch ================================================ diff -uNr jasper-version-2.0.16/CMakeLists.txt jasper-version-2.0.16.mod/CMakeLists.txt --- jasper-version-2.0.16/CMakeLists.txt 2019-03-12 20:04:35.000000000 +0200 +++ jasper-version-2.0.16.mod/CMakeLists.txt 2019-08-16 21:46:51.751881755 +0300 @@ -323,7 +323,7 @@ find_library(MATH_LIBRARY m) if (NOT MATH_LIBRARY) - set(MATH_LIBRARY "") + set(MATH_LIBRARY "-lm") endif() ################################################################################ ================================================ FILE: packages/libjasper/build.sh ================================================ TERMUX_PKG_HOMEPAGE=http://www.ece.uvic.ca/~frodo/jasper/ TERMUX_PKG_DESCRIPTION="Library for manipulating JPEG-2000 files" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_VERSION=2.0.16 TERMUX_PKG_REVISION=4 TERMUX_PKG_SRCURL=https://github.com/mdadams/jasper/archive/version-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=f1d8b90f231184d99968f361884e2054a1714fdbbd9944ba1ae4ebdcc9bbfdb1 TERMUX_PKG_DEPENDS="libjpeg-turbo" TERMUX_PKG_BREAKS="libjasper-dev" TERMUX_PKG_REPLACES="libjasper-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -H$TERMUX_PKG_SRCDIR -B$TERMUX_PKG_BUILDDIR -DCMAKE_INSTALL_LIBDIR=$TERMUX_PREFIX/lib " ================================================ FILE: packages/libjasper/libjasper-utils.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="bin/ share/man/man1/" TERMUX_SUBPKG_DESCRIPTION="JPEG-2000 utilities" ================================================ FILE: packages/libjpeg-turbo/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://libjpeg-turbo.virtualgl.org TERMUX_PKG_DESCRIPTION="Library for reading and writing JPEG image files" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_VERSION=2.0.3 TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/libjpeg-turbo/${TERMUX_PKG_VERSION}/libjpeg-turbo-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=4246de500544d4ee408ee57048aa4aadc6f165fc17f141da87669f20ed3241b7 TERMUX_PKG_BREAKS="libjpeg-turbo-dev" TERMUX_PKG_REPLACES="libjpeg-turbo-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-DWITH_JPEG8=1" ================================================ FILE: packages/libjpeg-turbo/libjpeg-turbo-progs.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE="bin/ share/man/man1/" TERMUX_SUBPKG_DESCRIPTION="Programs for manipulating JPEG files" ================================================ FILE: packages/libksba/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://gnupg.org/related_software/libksba/ TERMUX_PKG_DESCRIPTION="Library for using X.509 certificates and CMS (Cryptographic Message Syntax) easily accessible" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=1.3.5 TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/libksba/libksba-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SHA256=41444fd7a6ff73a79ad9728f985e71c9ba8cd3e5e53358e70d5f066d35c1a340 TERMUX_PKG_DEPENDS="libgpg-error" TERMUX_PKG_BREAKS="libksba-dev" TERMUX_PKG_REPLACES="libksba-dev" ================================================ FILE: packages/libllvm/ORCv2.rst.patch ================================================ From fe4cc4507a5f23efd105194b017d28311d1620e4 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Wed, 31 Jul 2019 18:07:37 +0000 Subject: [PATCH] [docs] Add references to unreferenced footnotes. Thanks to Stefan Granitz for catching the issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367458 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/ORCv2.rst | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/ORCv2.rst b/docs/ORCv2.rst index 7423c041d40a..4f9e08b9a154 100644 --- a/docs/ORCv2.rst +++ b/docs/ORCv2.rst @@ -153,8 +153,8 @@ Design Overview ORC's JIT'd program model aims to emulate the linking and symbol resolution rules used by the static and dynamic linkers. This allows ORC to JIT arbitrary LLVM IR, including IR produced by an ordinary static compiler (e.g. -clang) that uses constructs like symbol linkage and visibility, and weak and -common symbol definitions. +clang) that uses constructs like symbol linkage and visibility, and weak [4]_ +and common symbol definitions. To see how this works, imagine a program ``foo`` which links against a pair of dynamic libraries: ``libA`` and ``libB``. On the command line, building this @@ -326,7 +326,7 @@ prefix in LLVM 8.0, and have deprecation warnings attached in LLVM 9.0. In LLVM 10.0 ORCv1 will be removed entirely. Transitioning from ORCv1 to ORCv2 should be easy for most clients. Most of the -ORCv1 layers and utilities have ORCv2 counterparts[2]_ that can be directly +ORCv1 layers and utilities have ORCv2 counterparts [2]_ that can be directly substituted. However there are some design differences between ORCv1 and ORCv2 to be aware of: @@ -497,8 +497,8 @@ locking must be done explicitly: } Clients wishing to maximize possibilities for concurrent compilation will want -to create every new ThreadSafeModule on a new ThreadSafeContext. For this reason -a convenience constructor for ThreadSafeModule is provided that implicitly +to create every new ThreadSafeModule on a new ThreadSafeContext [3]_. For this +reason a convenience constructor for ThreadSafeModule is provided that implicitly constructs a new ThreadSafeContext value from a std::unique_ptr: .. code-block:: c++ @@ -622,11 +622,11 @@ TBD: Speculative compilation. Object Caches. .. [3] Sharing ThreadSafeModules in a concurrent compilation can be dangerous: if interdependent modules are loaded on the same context, but compiled - on different threads a deadlock may occur (with each compile waiting for - the other(s) to complete, and the other(s) unable to proceed because the - context is locked). - -.. [4] Mostly. Weak definitions are handled correctly within dylibs, but if - multiple dylibs provide a weak definition of a symbol each will end up - with its own definition (similar to how weak symbols in Windows DLLs - behave). This will be fixed in the future. \ No newline at end of file + on different threads a deadlock may occur, with each compile waiting for + the other to complete, and the other unable to proceed because the + context is locked. + +.. [4] Weak definitions are currently handled correctly within dylibs, but if + multiple dylibs provide a weak definition of a symbol then each will end + up with its own definition (similar to how weak definitions are handled + in Windows DLLs). This will be fixed in the future. ================================================ FILE: packages/libllvm/build.sh ================================================ TERMUX_PKG_HOMEPAGE=https://clang.llvm.org/ TERMUX_PKG_DESCRIPTION="Modular compiler and toolchain technologies library" TERMUX_PKG_LICENSE="NCSA" TERMUX_PKG_VERSION=9.0.0 TERMUX_PKG_REVISION=2 TERMUX_PKG_SHA256=(d6a0565cf21f22e9b4353b2eb92622e8365000a9e90a16b09b56f8157eabfe84 7ba81eef7c22ca5da688fdf9d88c20934d2d6b40bfe150ffd338900890aa4610 31c6748b235d09723fb73fea0c816ed5a3fab0f96b66f8fbc546a0fcc8688f91 9979eb1133066376cc0be29d1682bc0b0e7fb541075b391061679111ae4d3b5b) TERMUX_PKG_SRCURL=(https://releases.llvm.org/$TERMUX_PKG_VERSION/llvm-$TERMUX_PKG_VERSION.src.tar.xz https://releases.llvm.org/$TERMUX_PKG_VERSION/cfe-$TERMUX_PKG_VERSION.src.tar.xz https://releases.llvm.org/$TERMUX_PKG_VERSION/lld-$TERMUX_PKG_VERSION.src.tar.xz https://releases.llvm.org/$TERMUX_PKG_VERSION/openmp-$TERMUX_PKG_VERSION.src.tar.xz ) TERMUX_PKG_HOSTBUILD=true TERMUX_PKG_RM_AFTER_INSTALL=" bin/clang-check bin/clang-import-test bin/clang-offload-bundler bin/git-clang-format bin/macho-dump lib/libgomp.a lib/libiomp5.a " TERMUX_PKG_DEPENDS="binutils, libc++, ncurses, ndk-sysroot, libffi, zlib" # Replace gcc since gcc is deprecated by google on android and is not maintained upstream. # Conflict with clang versions earlier than 3.9.1-3 since they bundled llvm. TERMUX_PKG_CONFLICTS="gcc, clang (<< 3.9.1-3)" TERMUX_PKG_BREAKS="libclang, libclang-dev, libllvm-dev" TERMUX_PKG_REPLACES="gcc, libclang, libclang-dev, libllvm-dev" # See http://llvm.org/docs/CMake.html: TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DPYTHON_EXECUTABLE=$(which python3) -DLLVM_ENABLE_PIC=ON -DLLVM_ENABLE_LIBEDIT=OFF -DLLVM_BUILD_TESTS=OFF -DLLVM_INCLUDE_TESTS=OFF -DCLANG_DEFAULT_CXX_STDLIB=libc++ -DCLANG_INCLUDE_TESTS=OFF -DCLANG_TOOL_C_INDEX_TEST_BUILD=OFF -DC_INCLUDE_DIRS=$TERMUX_PREFIX/include -DLLVM_LINK_LLVM_DYLIB=ON -DLLVM_TABLEGEN=$TERMUX_PKG_HOSTBUILD_DIR/bin/llvm-tblgen -DCLANG_TABLEGEN=$TERMUX_PKG_HOSTBUILD_DIR/bin/clang-tblgen -DLIBOMP_ENABLE_SHARED=FALSE -DOPENMP_ENABLE_LIBOMPTARGET=OFF -DLLVM_BINUTILS_INCDIR=$TERMUX_PREFIX/include -DLLVM_ENABLE_SPHINX=ON -DSPHINX_OUTPUT_MAN=ON -DLLVM_TARGETS_TO_BUILD=all -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=RISCV -DPERL_EXECUTABLE=$(which perl) -DLLVM_ENABLE_FFI=ON -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=AVR " TERMUX_PKG_FORCE_CMAKE=true TERMUX_PKG_HAS_DEBUG=false # Debug build succeeds but make install with: # cp: cannot stat '../src/projects/openmp/runtime/exports/common.min.50.ompt.optional/include/omp.h': No such file or directory # common.min.50.ompt.optional should be common.deb.50.ompt.optional when doing debug build termux_step_post_extract_package() { mv cfe-${TERMUX_PKG_VERSION}.src tools/clang mv lld-${TERMUX_PKG_VERSION}.src tools/lld mv openmp-${TERMUX_PKG_VERSION}.src projects/openmp } termux_step_host_build() { termux_setup_cmake cmake -G "Unix Makefiles" $TERMUX_PKG_SRCDIR \ -DLLVM_BUILD_TESTS=OFF \ -DLLVM_INCLUDE_TESTS=OFF make -j $TERMUX_MAKE_PROCESSES clang-tblgen llvm-tblgen } termux_step_pre_configure() { mkdir projects/openmp/runtime/src/android cp $TERMUX_PKG_BUILDER_DIR/nl_types.h projects/openmp/runtime/src/android cp $TERMUX_PKG_BUILDER_DIR/nltypes_stubs.cpp projects/openmp/runtime/src/android cd $TERMUX_PKG_BUILDDIR export LLVM_DEFAULT_TARGET_TRIPLE=$TERMUX_HOST_PLATFORM export LLVM_TARGET_ARCH if [ $TERMUX_ARCH = "arm" ]; then LLVM_TARGET_ARCH=ARM elif [ $TERMUX_ARCH = "aarch64" ]; then LLVM_TARGET_ARCH=AArch64 elif [ $TERMUX_ARCH = "i686" ]; then LLVM_TARGET_ARCH=X86 elif [ $TERMUX_ARCH = "x86_64" ]; then LLVM_TARGET_ARCH=X86 else termux_error_exit "Invalid arch: $TERMUX_ARCH" fi # see CMakeLists.txt and tools/clang/CMakeLists.txt TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DLLVM_DEFAULT_TARGET_TRIPLE=$LLVM_DEFAULT_TARGET_TRIPLE" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DLLVM_TARGET_ARCH=$LLVM_TARGET_ARCH -DLLVM_TARGETS_TO_BUILD=all" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DLLVM_HOST_TRIPLE=$LLVM_DEFAULT_TARGET_TRIPLE" } termux_step_make() { ninja || zsh } termux_step_post_make_install() { if [ $TERMUX_ARCH = "arm" ]; then cp ../src/projects/openmp/runtime/exports/common.min/include/omp.h $TERMUX_PREFIX/include else cp ../src/projects/openmp/runtime/exports/common.min.ompt.optional/include/omp.h $TERMUX_PREFIX/include fi if [ "$TERMUX_CMAKE_BUILD" = Ninja ]; then ninja docs-llvm-man else make docs-llvm-man fi cp docs/man/* $TERMUX_PREFIX/share/man/man1 cd $TERMUX_PREFIX/bin for tool in clang clang++ cc c++ cpp gcc g++ ${TERMUX_HOST_PLATFORM}-{clang,clang++,gcc,g++,cpp}; do ln -f -s clang-${TERMUX_PKG_VERSION:0:1} $tool done } termux_step_post_massage() { sed $TERMUX_PKG_BUILDER_DIR/llvm-config.in \ -e "s|@TERMUX_PKG_VERSION@|$TERMUX_PKG_VERSION|g" \ -e "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|g" \ -e "s|@TERMUX_PKG_SRCDIR@|$TERMUX_PKG_SRCDIR|g" \ -e "s|@LLVM_TARGET_ARCH@|$LLVM_TARGET_ARCH|g" \ -e "s|@LLVM_DEFAULT_TARGET_TRIPLE@|$LLVM_DEFAULT_TARGET_TRIPLE|g" \ -e "s|@TERMUX_ARCH@|$TERMUX_ARCH|g" > $TERMUX_PREFIX/bin/llvm-config chmod 755 $TERMUX_PREFIX/bin/llvm-config cp $TERMUX_PKG_HOSTBUILD_DIR/bin/llvm-tblgen $TERMUX_PREFIX/bin cp $TERMUX_PKG_HOSTBUILD_DIR/bin/clang-tblgen $TERMUX_PREFIX/bin } ================================================ FILE: packages/libllvm/clang.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE=" bin/c++ bin/cc bin/*clang* bin/*cpp bin/*g++ bin/*gcc bin/scan-build lib/clang lib/libomp.a libexec/ share/clang share/man/man1/scan-build.1 " TERMUX_SUBPKG_DESCRIPTION="C language frontend for LLVM" ================================================ FILE: packages/libllvm/cxx-libm.patch ================================================ diff --git a/tools/clang/lib/Driver/ToolChains/Gnu.cpp~ b/tools/clang/lib/Driver/ToolChains/Gnu.cpp index 2ad4509..4d0b060 100644 --- a/tools/clang/lib/Driver/ToolChains/Gnu.cpp~ +++ b/tools/clang/lib/Driver/ToolChains/Gnu.cpp @@ -483,7 +483,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, if (OnlyLibstdcxxStatic) CmdArgs.push_back("-Bdynamic"); } - CmdArgs.push_back("-lm"); } // Silence warnings when linking C code with a C++ '-stdlib' argument. Args.ClaimAllArgs(options::OPT_stdlib_EQ); @@ -513,6 +512,9 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, AddRunTimeLibs(ToolChain, D, CmdArgs, Args); + if (D.CCCIsCXX()) + CmdArgs.push_back("-lm"); + if (WantPthread && !isAndroid) CmdArgs.push_back("-lpthread"); ================================================ FILE: packages/libllvm/lld.subpackage.sh ================================================ TERMUX_SUBPKG_INCLUDE=" include/lld/ lib/liblldConfig.a lib/liblldCore.a lib/liblldDriver.a lib/liblldReaderWriter.a lib/liblldMachO.a lib/liblldYAML.a bin/lld bin/lld-link bin/ld.lld bin/wasm-ld bin/ld64.lld lib/liblldCOFF.a lib/liblldELF.a " TERMUX_SUBPKG_DESCRIPTION="LD replace based on LLVM" ================================================ FILE: packages/libllvm/llvm-config.in ================================================ #!/bin/sh show_help () { echo "usage: llvm-config